2024-02-27需求变更

This commit is contained in:
曹磊 2024-04-16 11:34:24 +08:00
parent d79fc9b89e
commit e61c6ac10a
10 changed files with 18975 additions and 18049 deletions

View File

@ -1,6 +1,3 @@
### 为了项目的长远发展renren-fast-vue已迁移到 【[renren-ui](https://gitee.com/renrenio/renren-ui)】里面以后会在renren-ui里面进行更新维护感谢支持 :smiley:
<br>
## renren-fast-vue ## renren-fast-vue
- renren-fast-vue基于vue、element-ui构建开发实现[renren-fast](https://gitee.com/renrenio/renren-fast)后台管理前端功能,提供一套更优的前端解决方案 - renren-fast-vue基于vue、element-ui构建开发实现[renren-fast](https://gitee.com/renrenio/renren-fast)后台管理前端功能,提供一套更优的前端解决方案
- 前后端分离通过token进行数据交互可独立部署 - 前后端分离通过token进行数据交互可独立部署
@ -8,7 +5,12 @@
- 动态菜单,通过菜单管理统一管理访问路由 - 动态菜单,通过菜单管理统一管理访问路由
- 数据切换通过mock配置对接口数据mock模拟数据进行切换 - 数据切换通过mock配置对接口数据mock模拟数据进行切换
- 发布时可动态配置CDN静态资源切换新旧版本 - 发布时可动态配置CDN静态资源切换新旧版本
- 演示地址:[http://demo.open.renren.io/renren-fast](http://demo.open.renren.io/renren-fast) (账号密码admin/admin) - 演示环境http://demo.open.renren.io/renren-security
## 不安装python解决node-sass版本问题的最新解决方案
npm install 第一次报错后,再运行
npm install node-sass@npm:sass --ignore-scripts
完了直接npm run dev成功
![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133529_ff15f192_63154.png "01.png") ![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133529_ff15f192_63154.png "01.png")
![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133537_7a1b2d85_63154.png "02.png") ![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133537_7a1b2d85_63154.png "02.png")
@ -20,3 +22,4 @@
## 更新日志 ## 更新日志
每个版本的详细更改都记录在[release notes](https://github.com/renrenio/renren-fast-vue/releases)中。 每个版本的详细更改都记录在[release notes](https://github.com/renrenio/renren-fast-vue/releases)中。

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>工程项目管理平台</title> <title>人人快速开发平台</title>
<% if (process.env.NODE_ENV === 'production') { %> <% if (process.env.NODE_ENV === 'production') { %>
<!-- 生产环境 --> <!-- 生产环境 -->
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script> <script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script>
@ -22,4 +22,4 @@
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>

34990
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
"gulp-replace": "1.0.0", "gulp-replace": "1.0.0",
"gulp-shell": "0.8.0", "gulp-shell": "0.8.0",
"lodash": "4.17.5", "lodash": "4.17.5",
"node-sass": "^6.0.1", "node-sass": "npm:sass@^1.75.0",
"npm": "^6.9.0", "npm": "^6.9.0",
"sass-loader": "6.0.6", "sass-loader": "6.0.6",
"svg-sprite-loader": "3.7.3", "svg-sprite-loader": "3.7.3",

View File

@ -857,6 +857,9 @@
this.dataOldExcelForm = { this.dataOldExcelForm = {
...data.businessSsjdexcel ...data.businessSsjdexcel
} }
} else {
this.dataExcelForm.id = ''
this.dataExcelForm.contractId = this.dataForm.id
} }
} }
}) })

View File

@ -7,7 +7,7 @@
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('business:businesscontract:save')" type="primary" @click="addOrUpdateHandle(null,0)">新增</el-button> <el-button v-if="isAuth('business:businesscontract:save')" type="primary" @click="addOrUpdateHandle(null,0)">新增</el-button>
<!-- <el-button v-if="isAuth('business:businesscontract:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>--> <!-- <el-button v-if="isAuth('business:businesscontract:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>-->
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -16,12 +16,12 @@
v-loading="dataListLoading" v-loading="dataListLoading"
@selection-change="selectionChangeHandle" @selection-change="selectionChangeHandle"
style="width: 100%;"> style="width: 100%;">
<!-- <el-table-column <!-- <el-table-column
type="selection" type="selection"
header-align="center" header-align="center"
align="center" align="center"
width="50"> width="50">
</el-table-column>--> </el-table-column>-->
<el-table-column <el-table-column
type="index" type="index"
header-align="center" header-align="center"
@ -67,7 +67,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="isAuth('business:businesscontract:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id, 1)">修改</el-button> <el-button v-if="isAuth('business:businesscontract:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id, 1)">修改</el-button>
<!-- <el-button v-if="isAuth('business:businesscontract:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>--> <!-- <el-button v-if="isAuth('business:businesscontract:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -86,112 +86,112 @@
</template> </template>
<script> <script>
import AddOrUpdate from './businesscontract-add-or-update' import AddOrUpdate from './businesscontract-add-or-update'
export default { export default {
data () { data () {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/business/businesscontract/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = []
data.page.list.forEach((item) => {
if (item.contractNewName !== null && item.contractNewName !== '') {
item.contractName = item.contractNewName
}
if (item.excelContractMoneyNew !== null && item.contractNewName !== '') {
item.excelContractMoney = item.excelContractMoneyNew
}
this.dataList.push(item)
})
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
}, },
components: { //
AddOrUpdate sizeChangeHandle (val) {
}, this.pageSize = val
activated () { this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
methods: { //
// currentChangeHandle (val) {
getDataList () { this.pageIndex = val
this.dataListLoading = true this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id, num) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, num)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/business/businesscontract/list'), url: this.$http.adornUrl('/business/businesscontract/delete'),
method: 'get', method: 'post',
params: this.$http.adornParams({ data: this.$http.adornData(ids, false)
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = [] this.$message({
data.page.list.forEach((item) => { message: '操作成功',
if (item.contractNewName !== null && item.contractNewName !== '') { type: 'success',
item.contractName = item.contractNewName duration: 1500,
onClose: () => {
this.getDataList()
} }
if (item.excelContractMoneyNew !== null && item.contractNewName !== '') {
item.excelContractMoney = item.excelContractMoneyNew
}
this.dataList.push(item)
}) })
this.totalPage = data.page.totalCount
} else { } else {
this.dataList = [] this.$message.error(data.msg)
this.totalPage = 0
} }
this.dataListLoading = false
}) })
}, })
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id, num) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, num)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/business/businesscontract/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
} }
} }
}
</script> </script>

View File

@ -4,87 +4,87 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="日期" prop="outTime"> <el-form-item label="日期" prop="outTime">
<el-date-picker <el-date-picker
v-model="dataForm.outTime" v-model="dataForm.outTime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="支出金额" prop="outMoney"> <el-form-item label="支出金额" prop="outMoney">
<el-input v-model="dataForm.outMoney" placeholder="支出金额" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input> <el-input v-model="dataForm.outMoney" placeholder="支出金额" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="内容" prop="outNr"> <el-form-item label="内容" prop="outNr">
<el-input v-model="dataForm.outNr" placeholder="内容"></el-input> <el-input v-model="dataForm.outNr" placeholder="内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="支付方式" prop="outWay"> <el-form-item label="支付方式" prop="outWay">
<el-select <el-select
v-model="dataForm.outWay" v-model="dataForm.outWay"
placeholder="选择支付方式" placeholder="选择支付方式"
style="width: 90%;" style="width: 90%;"
> >
<el-option <el-option
v-for="item in payList" v-for="item in payList"
:key="item.dictId" :key="item.dictId"
:label="item.name" :label="item.name"
:value="item.dictId" :value="item.dictId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="支出类别" prop="outType"> <el-form-item label="支出类别" prop="outType">
<el-select <el-select
v-model="dataForm.outType" v-model="dataForm.outType"
placeholder="选择支出类别" placeholder="选择支出类别"
style="width: 90%;" style="width: 90%;"
@change="selectZc" @change="selectZc"
> >
<el-option <el-option
v-for="item in expenseList" v-for="item in expenseList"
:key="item.dictId" :key="item.dictId"
:label="item.name" :label="item.name"
:value="item.dictId" :value="item.dictId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="立项归属" prop="outProject"> <el-form-item label="立项归属" prop="outProject">
<el-select <el-select
v-model="dataForm.outProject" v-model="dataForm.outProject"
placeholder="选择立项归属" placeholder="选择立项归属"
style="width: 90%;" style="width: 90%;"
> >
<el-option <el-option
v-for="item in projectList" v-for="item in projectList"
:key="item.projectId" :key="item.projectId"
:label="item.project" :label="item.project"
:value="item.projectId" :value="item.projectId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="isShow" label="收款人" prop="outPayee"> <el-form-item v-if="isShow" label="收款人" prop="outPayee">
<el-input v-if="!selectskr" v-model="dataForm.outPayee" placeholder="收款人"></el-input> <el-input v-if="!selectskr" v-model="dataForm.outPayee" placeholder="收款人"></el-input>
<el-select <el-select
v-else v-else
v-model="dataForm.outPayee" v-model="dataForm.outPayee"
placeholder="选择收款人" placeholder="选择收款人"
style="width: 90%;" style="width: 90%;"
> >
<el-option <el-option
v-for="item in recipientList" v-for="item in recipientList"
:label="item.name" :label="item.name"
:value="item.dictId" :value="item.dictId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="地址" prop="outPayeeAddress">--> <!-- <el-form-item label="地址" prop="outPayeeAddress">-->
<!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeeAddress" placeholder="地址"></el-input>--> <!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeeAddress" placeholder="地址"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="电话" prop="outPayeePhone">--> <!-- <el-form-item label="电话" prop="outPayeePhone">-->
<!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeePhone" placeholder="电话"></el-input>--> <!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeePhone" placeholder="电话"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="outRemark">--> <!-- <el-form-item label="备注" prop="outRemark">-->
<!-- <el-input v-model="dataForm.outRemark" placeholder="备注"></el-input>--> <!-- <el-input v-model="dataForm.outRemark" placeholder="备注"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
@ -94,255 +94,255 @@
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
isShow: false, isShow: false,
visible: false, visible: false,
selectskr: false, // selectskr: false, //
otherZclbDisabled: true, // otherZclbDisabled: true, //
dataForm: { dataForm: {
id: 0, id: 0,
outTime: '', outTime: '',
outMoney: '', outMoney: '',
outNr: '', outNr: '',
outWay: '', outWay: '',
outType: '', outType: '',
outProject: '', outProject: '',
outPayee: '', outPayee: '',
outPayeeAddress: '', outPayeeAddress: '',
outPayeePhone: '', outPayeePhone: '',
outRemark: '', outRemark: '',
status: 0, status: 0,
writeUserId: '', // id writeUserId: '', // id
approval: 0 approval: 0
}, },
dataOldForm: { dataOldForm: {
id: 0, id: 0,
outTime: '', outTime: '',
outMoney: '', outMoney: '',
outNr: '', outNr: '',
outWay: '', outWay: '',
outType: '', outType: '',
outProject: '', outProject: '',
outPayee: '', outPayee: '',
outPayeeAddress: '', outPayeeAddress: '',
outPayeePhone: '', outPayeePhone: '',
outRemark: '', outRemark: '',
status: 0, status: 0,
writeUserId: '', // id writeUserId: '', // id
approval: 0 approval: 0
}, },
userId: '', userId: '',
authenticName: '', authenticName: '',
projectList: [], // projectList: [], //
payList: [], // payList: [], //
recipientList: [], // recipientList: [], //
recipientList_nbzz: [], // _ recipientList_nbzz: [], // _
recipientList_all: [], // _ recipientList_all: [], // _
expenseList: [], // expenseList: [], //
dataRule: { dataRule: {
outTime: [ outTime: [
{ required: true, message: '日期不能为空', trigger: 'blur' } { required: true, message: '日期不能为空', trigger: 'blur' }
] ]
}
} }
}, }
methods: { },
init (id) { methods: {
this.dataForm.id = id || 0 init (id) {
this.dataForm.approval = 0 this.dataForm.id = id || 0
this.visible = true this.dataForm.approval = 0
this.$nextTick(() => { this.visible = true
this.$refs['dataForm'].resetFields() this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
// //
this.$http.request({
url: this.$http.adornUrl('/sys/user/info'),
method: 'get'
}).then(({data}) => {
if (data && data.code === 0) {
this.userId = data.user.userId
this.authenticName = data.user.authenticName
if (data.user.userId === 10 || data.user.userId === 1) {
this.isShow = true
}
}
//
this.$http.request({ this.$http.request({
url: this.$http.adornUrl('/sys/user/info'), url: this.$http.adornUrl('/business/businessoutlay/allList'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
// console.log(data);
if (data && data.code === 0) { if (data && data.code === 0) {
this.userId = data.user.userId this.projectList = data.page
this.authenticName = data.user.authenticName this.projectList.forEach((item) => {
if (data.user.userId === 10 || data.user.userId === 1) { if (item.projectNewName !== null) {
this.isShow = true item.project = item.projectNewName
} }
})
} }
//
this.$http.request({ this.$http.request({
url: this.$http.adornUrl('/business/businessoutlay/allList'), url: this.$http.adornUrl('/business/businessoutlay/selectAllContainsDeparturePage'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
// console.log(data);
if (data && data.code === 0) { if (data && data.code === 0) {
this.projectList = data.page this.recipientList_all = data.page
this.projectList.forEach((item) => {
if (item.projectNewName !== null) {
item.project = item.projectNewName
}
})
} }
this.$http.request({ this.$http.request({
url: this.$http.adornUrl('/business/businessoutlay/selectAllContainsDeparturePage'), url: this.$http.adornUrl('/business/businessoutlay/dictList'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
// console.log(data);
if (data && data.code === 0) { if (data && data.code === 0) {
this.recipientList_all = data.page data.data.forEach((item) => {
if (item.dictCode === 'pay_type') {
this.payList = item.children
} else if (item.dictCode === 'recipient') {
this.recipientList = []
item.children.forEach((item2) => {
item2.dictId = item2.dictId.toString()
this.recipientList.push(item2)
})
this.recipientList_nbzz = []
this.recipientList.forEach((item2) => {
if (item2.name === '肖爽' || item2.name === '侯吉庆' || item2.name === '李现举') {
this.recipientList_nbzz.push(item2)
}
})
} else if (item.dictCode === 'expense_type') {
this.expenseList = item.children
}
})
} }
this.$http.request({ if (this.dataForm.id && this.dataForm.id !== 0) {
url: this.$http.adornUrl('/business/businessoutlay/dictList'), this.$http({
method: 'get' url: this.$http.adornUrl(`/business/businessoutlay/info/${this.dataForm.id}`),
}).then(({data}) => { method: 'get',
// console.log(data); params: this.$http.adornParams()
if (data && data.code === 0) { }).then(({data}) => {
data.data.forEach((item) => { if (data && data.code === 0) {
if (item.dictCode === 'pay_type') { this.dataForm = {
this.payList = item.children ...data.businessOutlay
} else if (item.dictCode === 'recipient') {
this.recipientList = []
item.children.forEach((item2) => {
item2.dictId = item2.dictId.toString()
this.recipientList.push(item2)
})
this.recipientList_nbzz = []
this.recipientList.forEach((item2) => {
if (item2.name === '肖爽' || item2.name === '侯吉庆' || item2.name === '李现举') {
this.recipientList_nbzz.push(item2)
}
})
} else if (item.dictCode === 'expense_type') {
this.expenseList = item.children
} }
}) this.dataOldForm = {
} ...data.businessOutlay
if (this.dataForm.id && this.dataForm.id !== 0) {
this.$http({
url: this.$http.adornUrl(`/business/businessoutlay/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = {
...data.businessOutlay
}
this.dataOldForm = {
...data.businessOutlay
}
this.selectZc()
} }
}) this.selectZc()
} }
}) })
}
}) })
}) })
}) })
}) })
}, })
// },
dataFormSubmit () { //
// if (this.authenticName !== '') { dataFormSubmit () {
this.dataForm.writeUserId = this.userId // if (this.authenticName !== '') {
// } this.dataForm.writeUserId = this.userId
this.$refs['dataForm'].validate((valid) => { // }
if (valid) { this.$refs['dataForm'].validate((valid) => {
// if (valid) {
// if (this.dataForm.id && this.dataForm.id !== 0) { //
// if (this.dataForm.approval === 1) { // if (this.dataForm.id && this.dataForm.id !== 0) {
// this.$message('') // if (this.dataForm.approval === 1) {
// } else if (this.dataForm.approval === 0 && JSON.stringify(this.dataForm) === JSON.stringify(this.dataOldForm)) { // this.$message('')
// this.$message('') // } else if (this.dataForm.approval === 0 && JSON.stringify(this.dataForm) === JSON.stringify(this.dataOldForm)) {
// } else { // this.$message('')
// this.$http({ // } else {
// url: this.$http.adornUrl(`/business/businessoutlay/update`), // this.$http({
// method: 'post', // url: this.$http.adornUrl(`/business/businessoutlay/update`),
// data: this.$http.adornData({ // method: 'post',
// 'id': this.dataForm.id, // data: this.$http.adornData({
// 'approval': 1 // 'id': this.dataForm.id,
// }) // 'approval': 1
// }) // })
// // // })
// this.$http.request({ // //
// url: this.$http.adornUrl('/business/businessapproval/save'), // this.$http.request({
// method: 'post', // url: this.$http.adornUrl('/business/businessapproval/save'),
// data: this.$http.adornData({ // method: 'post',
// 'approvalId': this.dataForm.id, // data: this.$http.adornData({
// 'approvalName': this.dataForm.outTime, // 'approvalId': this.dataForm.id,
// 'approvalData': JSON.stringify(this.dataForm), // 'approvalName': this.dataForm.outTime,
// 'approvalOldData': JSON.stringify(this.dataOldForm), // 'approvalData': JSON.stringify(this.dataForm),
// 'approvalType': 6, // 'approvalOldData': JSON.stringify(this.dataOldForm),
// 'approvalSuccess': 0 // 'approvalType': 6,
// }) // 'approvalSuccess': 0
// }).then(({data}) => { // })
// if (data && data.code == 0) { // }).then(({data}) => {
// this.$message({ // if (data && data.code == 0) {
// message: '', // this.$message({
// type: 'success', // message: '',
// duration: 1500, // type: 'success',
// onClose: () => { // duration: 1500,
// this.visible = false // onClose: () => {
// this.$emit('refreshDataList') // this.visible = false
// } // this.$emit('refreshDataList')
// }) // }
// } else { // })
// this.$message.error(data.msg) // } else {
// } // this.$message.error(data.msg)
// }) // }
// } // })
// } else { // }
this.$http({ // } else {
url: this.$http.adornUrl(`/business/businessoutlay/save`), this.$http({
method: 'post', url: this.$http.adornUrl(`/business/businessoutlay/save`),
data: this.$http.adornData({ method: 'post',
'id': this.dataForm.id, data: this.$http.adornData({
'outTime': this.dataForm.outTime, 'id': this.dataForm.id,
'outMoney': this.dataForm.outMoney, 'outTime': this.dataForm.outTime,
'outNr': this.dataForm.outNr, 'outMoney': this.dataForm.outMoney,
'outWay': this.dataForm.outWay, 'outNr': this.dataForm.outNr,
'outType': this.dataForm.outType, 'outWay': this.dataForm.outWay,
'outProject': this.dataForm.outProject, 'outType': this.dataForm.outType,
'outPayee': this.dataForm.outPayee, 'outProject': this.dataForm.outProject,
'outPayeeAddress': this.dataForm.outPayeeAddress, 'outPayee': this.dataForm.outPayee,
'outPayeePhone': this.dataForm.outPayeePhone, 'outPayeeAddress': this.dataForm.outPayeeAddress,
'outRemark': this.dataForm.outRemark, 'outPayeePhone': this.dataForm.outPayeePhone,
'status': 0, 'outRemark': this.dataForm.outRemark,
'writeUserId': this.dataForm.writeUserId, 'status': 0,
'approval': 0 'writeUserId': this.dataForm.writeUserId,
}) 'approval': 0
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
}) })
// } }).then(({data}) => {
} if (data && data.code === 0) {
}) this.$message({
}, message: '操作成功',
selectZc () { type: 'success',
if (this.dataForm.outType === 141 || this.dataForm.outType === 146) { duration: 1500,
this.selectskr = true onClose: () => {
if (this.dataForm.outType === 141) { this.visible = false
this.recipientList = [] this.$emit('refreshDataList')
this.recipientList = this.recipientList_all }
} else { })
this.recipientList = [] } else {
this.recipientList = this.recipientList_nbzz this.$message.error(data.msg)
} }
this.otherZclbDisabled = true })
} else { // }
this.selectskr = false
this.otherZclbDisabled = false
} }
})
},
selectZc () {
if (this.dataForm.outType === 141 || this.dataForm.outType === 146) {
this.selectskr = true
if (this.dataForm.outType === 141) {
this.recipientList = []
this.recipientList = this.recipientList_all
} else {
this.recipientList = []
this.recipientList = this.recipientList_nbzz
}
this.otherZclbDisabled = true
} else {
this.selectskr = false
this.otherZclbDisabled = false
} }
} }
} }
}
</script> </script>

View File

@ -96,24 +96,24 @@
align="center" align="center"
label="收款人"> label="收款人">
</el-table-column> </el-table-column>
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- prop="outPayeeAddress"--> <!-- prop="outPayeeAddress"-->
<!-- header-align="center"--> <!-- header-align="center"-->
<!-- align="center"--> <!-- align="center"-->
<!-- label="地址">--> <!-- label="地址">-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- prop="outPayeePhone"--> <!-- prop="outPayeePhone"-->
<!-- header-align="center"--> <!-- header-align="center"-->
<!-- align="center"--> <!-- align="center"-->
<!-- label="电话">--> <!-- label="电话">-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- prop="outRemark"--> <!-- prop="outRemark"-->
<!-- header-align="center"--> <!-- header-align="center"-->
<!-- align="center"--> <!-- align="center"-->
<!-- label="备注">--> <!-- label="备注">-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
@ -140,187 +140,187 @@
</template> </template>
<script> <script>
import AddOrUpdate from './businessoutlay-add-or-update' import AddOrUpdate from './businessoutlay-add-or-update'
export default { export default {
data () { data () {
return { return {
dataForm: { dataForm: {
key: '', key: '',
start: '' start: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
projectList: [], // projectList: [], //
payList: [], // payList: [], //
recipientList: [], // recipientList: [], //
expenseList: [], // expenseList: [], //
addOrUpdateVisible: false, addOrUpdateVisible: false,
userId: '', userId: '',
authenticName: '', authenticName: '',
sysYear: '', sysYear: '',
isShow: false isShow: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
async mounted () { async mounted () {
if (new Date().getMonth() + 1 === 1 || new Date().getMonth() + 1 === 2) { if (new Date().getMonth() + 1 === 1 || new Date().getMonth() + 1 === 2) {
this.sysYear = new Date().getFullYear() - 1 this.sysYear = new Date().getFullYear() - 1
} else { } else {
this.sysYear = new Date().getFullYear() this.sysYear = new Date().getFullYear()
} }
await this.$http.request({ await this.$http.request({
url: this.$http.adornUrl('/sys/user/info'), url: this.$http.adornUrl('/sys/user/info'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.userId = data.user.userId this.userId = data.user.userId
this.authenticName = data.user.authenticName this.authenticName = data.user.authenticName
if (data.user.userId === 10 || data.user.userId === 1) { if (data.user.userId === 10 || data.user.userId === 1) {
this.isShow = true this.isShow = true
}
}
})
await this.$http.request({
url: this.$http.adornUrl('/business/businessoutlay/dictList'),
method: 'get'
}).then(({data}) => {
// console.log(data);
if (data && data.code === 0) {
data.data.forEach((item) => {
if (item.dictCode === 'pay_type') {
this.payList = item.children
} else if (item.dictCode === 'recipient') {
this.recipientList = item.children
} else if (item.dictCode === 'expense_type') {
this.expenseList = item.children
} }
} })
}) }
await this.$http.request({ })
url: this.$http.adornUrl('/business/businessoutlay/dictList'), //
method: 'get' await this.$http.request({
}).then(({data}) => { url: this.$http.adornUrl('/business/businessoutlay/allList'),
// console.log(data); method: 'get'
if (data && data.code === 0) { }).then(({data}) => {
data.data.forEach((item) => { // console.log(data);
if (item.dictCode === 'pay_type') { if (data && data.code === 0) {
this.payList = item.children this.projectList = data.page
} else if (item.dictCode === 'recipient') { // console.log(this.projectList);
this.recipientList = item.children this.projectList.forEach((item) => {
} else if (item.dictCode === 'expense_type') { if (item.projectNewName !== null) {
this.expenseList = item.children item.project = item.projectNewName
} }
}) })
} }
}) })
//
await this.$http.request({
url: this.$http.adornUrl('/business/businessoutlay/allList'),
method: 'get'
}).then(({data}) => {
// console.log(data);
if (data && data.code === 0) {
this.projectList = data.page
// console.log(this.projectList);
this.projectList.forEach((item) => {
if (item.projectNewName !== null) {
item.project = item.projectNewName
}
})
}
})
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.dataList = []
this.$http({
url: this.$http.adornUrl('/business/businessoutlay/pcListNoPage'),
method: 'get',
params: this.$http.adornParams({
'start': this.dataForm.start,
'end': this.dataForm.end,
'writeUserId': this.userId,
'page': this.pageIndex,
'limit': this.pageSize
})
}).then(({data}) => {
this.totalPage = data.page.totalCount
if (this.authenticName === '管理员') {
this.dataList = data.page.list
this.recipientList.forEach((item) => {
if (item.dictId.toString() === item.outPayee) {
item.outPayee = item.name
}
})
} else {
data.page.list.forEach((item) => {
if (item.writeUserId === this.userId) { //
this.recipientList.forEach((item) => {
if (item.dictId.toString() === item.outPayee) {
item.outPayee = item.name
}
})
this.dataList.push(item)
}
})
}
})
this.dataListLoading = false
},
onExport () {
if (this.authenticName === '管理员') {
window.open(this.$http.adornUrl('/business/businessoutlay/export'))
} else {
window.open(this.$http.adornUrl('/business/businessoutlay/export?writeUserId=' + this.userId))
}
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
methods: { //
// currentChangeHandle (val) {
getDataList () { this.pageIndex = val
this.dataListLoading = true this.getDataList()
this.dataList = [] },
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/business/businessoutlay/pcListNoPage'), url: this.$http.adornUrl('/business/businessoutlay/delete'),
method: 'get', method: 'post',
params: this.$http.adornParams({ data: this.$http.adornData(ids, false)
'start': this.dataForm.start,
'end': this.dataForm.end,
'writeUserId': this.userId,
'page': this.pageIndex,
'limit': this.pageSize
})
}).then(({data}) => { }).then(({data}) => {
this.totalPage = data.page.totalCount if (data && data.code === 0) {
if (this.authenticName === '管理员') { this.$message({
this.dataList = data.page.list message: '操作成功',
this.recipientList.forEach((item) => { type: 'success',
if (item.dictId.toString() === item.outPayee) { duration: 1500,
item.outPayee = item.name onClose: () => {
this.getDataList()
} }
}) })
} else { } else {
data.page.list.forEach((item) => { this.$message.error(data.msg)
if (item.writeUserId === this.userId) { //
this.recipientList.forEach((item) => {
if (item.dictId.toString() === item.outPayee) {
item.outPayee = item.name
}
})
this.dataList.push(item)
}
})
} }
}) })
this.dataListLoading = false })
},
onExport () {
if (this.authenticName === '管理员') {
window.open(this.$http.adornUrl('/business/businessoutlay/export'))
} else {
window.open(this.$http.adornUrl('/business/businessoutlay/export?writeUserId=' + this.userId))
}
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/business/businessoutlay/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
} }
} }
}
</script> </script>

View File

@ -4,42 +4,42 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible"> :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="日期" prop="outinDate"> <el-form-item label="日期" prop="outinDate">
<el-date-picker @change="bindChange($event)" <el-date-picker @change="bindChange($event)"
:disabled="!!dataForm.id" :disabled="!!dataForm.id"
v-model="dataForm.outinDate" v-model="dataForm.outinDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="昨日余额" prop="outinYdayBalance"> <el-form-item label="昨日余额" prop="outinYdayBalance">
<el-input disabled v-model="dataForm.outinYdayBalance" placeholder="昨日余额" @change="jrYe()" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input> <el-input disabled v-model="dataForm.outinYdayBalance" placeholder="昨日余额" @change="jrYe()" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="今日收入" prop="outinTdayIncome"> <el-form-item label="今日收入" prop="outinTdayIncome">
<el-input v-model="dataForm.outinTdayIncome" placeholder="今日收入" @change="jrYe()" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input> <el-input v-model="dataForm.outinTdayIncome" placeholder="今日收入" @change="jrYe()" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="今日支出" prop="outinTdayOut"> <el-form-item label="今日支出" prop="outinTdayOut">
<el-input disabled v-model="dataForm.outinTdayOut" placeholder="今日支出" @change="jrYe()" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input> <el-input disabled v-model="dataForm.outinTdayOut" placeholder="今日支出" @change="jrYe()" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="今日余额" prop="outinTdayBalance"> <el-form-item label="今日余额" prop="outinTdayBalance">
<el-input disabled v-model="dataForm.outinTdayBalance" placeholder="今日余额" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input> <el-input disabled v-model="dataForm.outinTdayBalance" placeholder="今日余额" onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')"></el-input>
<!-- <el-button @click="jrYe()">计算</el-button>--> <!-- <el-button @click="jrYe()">计算</el-button>-->
</el-form-item> </el-form-item>
<el-form-item label="收款方式" prop="outinCreditingWay"> <el-form-item label="收款方式" prop="outinCreditingWay">
<el-select <el-select
v-model="dataForm.outinCreditingWay" v-model="dataForm.outinCreditingWay"
placeholder="选择收款方式" placeholder="选择收款方式"
style="width: 90%;" style="width: 90%;"
> >
<el-option <el-option
v-for="item in payList" v-for="item in payList"
:key="item.dictId" :key="item.dictId"
:label="item.name" :label="item.name"
:value="item.dictId" :value="item.dictId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="收入类别" prop="outType"> <el-form-item label="收入类别" prop="outType">
<el-select <el-select
v-model="dataForm.outType" v-model="dataForm.outType"
@ -54,9 +54,9 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="outinRemark"> <el-form-item label="备注" prop="outinRemark">
<el-input v-model="dataForm.outinRemark" placeholder="备注"></el-input> <el-input v-model="dataForm.outinRemark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
@ -66,97 +66,71 @@
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
outinDate: '', outinDate: '',
outinYdayBalance: '', outinYdayBalance: '',
outinTdayIncome: '', outinTdayIncome: '',
outinTdayOut: '', outinTdayOut: '',
outinTdayBalance: '', outinTdayBalance: '',
outinCreditingWay: '', outinCreditingWay: '',
outType: '', outType: '',
outinRemark: '', outinRemark: '',
status: 0, status: 0,
writeUserId: '', // id writeUserId: '', // id
approval: 0 approval: 0
}, },
dataOldForm: { dataOldForm: {
id: 0, id: 0,
outinDate: '', outinDate: '',
outinYdayBalance: '', outinYdayBalance: '',
outinTdayIncome: '', outinTdayIncome: '',
outinTdayOut: '', outinTdayOut: '',
outinTdayBalance: '', outinTdayBalance: '',
outinCreditingWay: '', outinCreditingWay: '',
outType: '', outType: '',
outinRemark: '', outinRemark: '',
status: 0, status: 0,
writeUserId: '', // id writeUserId: '', // id
approval: 0 approval: 0
}, },
userId: '', userId: '',
authenticName: '', authenticName: '',
// //
payList: [], payList: [],
expenseList: [], // expenseList: [], //
dataRule: { dataRule: {
outinDate: [ outinDate: [
{ required: true, message: '日期不能为空', trigger: 'blur' } { required: true, message: '日期不能为空', trigger: 'blur' }
] ]
}
} }
}, }
methods: { },
init (id) { methods: {
this.dataForm.id = id || 0 init (id) {
this.dataForm.approval = 0 this.dataForm.id = id || 0
this.visible = true this.dataForm.approval = 0
this.$nextTick(() => { this.visible = true
this.$refs['dataForm'].resetFields() this.$nextTick(() => {
if (this.dataForm.id && this.dataForm.id !== 0) { this.$refs['dataForm'].resetFields()
this.$http({ if (this.dataForm.id && this.dataForm.id !== 0) {
url: this.$http.adornUrl(`/business/businessoutlayincome/info/${this.dataForm.id}`), this.$http({
method: 'get', url: this.$http.adornUrl(`/business/businessoutlayincome/info/${this.dataForm.id}`),
params: this.$http.adornParams() method: 'get',
}).then(({data}) => { params: this.$http.adornParams()
if (data && data.code === 0) { }).then(({data}) => {
this.dataForm = { if (data && data.code === 0) {
...data.businessOutlayIncome this.dataForm = {
} ...data.businessOutlayIncome
this.dataOldForm = {
...data.businessOutlayIncome
}
} }
// this.dataOldForm = {
this.$http.request({ ...data.businessOutlayIncome
url: this.$http.adornUrl('/sys/user/info'), }
method: 'get' }
}).then(({data}) => {
if (data && data.code === 0) {
this.userId = data.user.userId
this.authenticName = data.user.authenticName
// //
// this.$http.request({
// url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'),
// method: 'post',
// data: {
// 'writeUserId': this.userId,
// 'outinRemark': this.dataForm.outinDate
// }
// }).then(({data}) => {
// if(data && data.code == 0){
// this.dataForm.outinYdayBalance = data.zrye;
// this.dataForm.outinTdayOut = data.jrzc;
// }
// })
}
})
})
} else {
// //
this.$http.request({ this.$http.request({
url: this.$http.adornUrl('/sys/user/info'), url: this.$http.adornUrl('/sys/user/info'),
@ -165,156 +139,148 @@
if (data && data.code === 0) { if (data && data.code === 0) {
this.userId = data.user.userId this.userId = data.user.userId
this.authenticName = data.user.authenticName this.authenticName = data.user.authenticName
if(this.dataForm.outinDate == null || this.dataForm.outinDate == undefined || this.dataForm.outinDate ==''){ // //
return // this.$http.request({
} // url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'),
// // method: 'post',
this.$http.request({ // data: {
url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'), // 'writeUserId': this.userId,
method: 'post', // 'outinRemark': this.dataForm.outinDate
data: { // }
'writeUserId': this.userId, // }).then(({data}) => {
'outinRemark': this.dataForm.outinDate // if(data && data.code == 0){
} // this.dataForm.outinYdayBalance = data.zrye;
}).then(({data}) => { // this.dataForm.outinTdayOut = data.jrzc;
if(data && data.code == 0){ // }
this.dataForm.outinYdayBalance = data.zrye; // })
this.dataForm.outinTdayOut = data.jrzc;
this.jrYe();
}
})
} }
}) })
} })
} else {
//
this.$http.request({ this.$http.request({
url: this.$http.adornUrl('/business/businessoutlay/dictList'), url: this.$http.adornUrl('/sys/user/info'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
// console.log(data);
if (data && data.code === 0) { if (data && data.code === 0) {
data.data.forEach((item) => { this.userId = data.user.userId
if (item.dictCode === 'pay_type') { this.authenticName = data.user.authenticName
this.payList = item.children if(this.dataForm.outinDate == null || this.dataForm.outinDate == undefined || this.dataForm.outinDate ==''){
return
}
//
this.$http.request({
url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'),
method: 'post',
data: {
'writeUserId': this.userId,
'outinRemark': this.dataForm.outinDate
} }
if (item.dictCode === 'expense_type') { }).then(({data}) => {
this.expenseList = item.children if(data && data.code == 0){
this.dataForm.outinYdayBalance = data.zrye;
this.dataForm.outinTdayOut = data.jrzc;
this.jrYe();
} }
}) })
} }
}) })
})
},
jrYe () {
let v1 = this.dataForm.outinYdayBalance
if (!v1) {
v1 = 0
} else {
v1 = parseFloat(this.dataForm.outinYdayBalance)
} }
let v2 = this.dataForm.outinTdayIncome
if (!v2) {
v2 = 0
} else {
v2 = parseFloat(this.dataForm.outinTdayIncome)
}
let v3 = this.dataForm.outinTdayOut
if (!v3) {
v3 = 0
} else {
v3 = parseFloat(this.dataForm.outinTdayOut)
}
this.dataForm.outinTdayBalance = (v1 + v2 - v3).toFixed(2)
this.$forceUpdate()
},
bindChange: function (e) {
this.dataForm.outinDate = e;
//
this.$http.request({ this.$http.request({
url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'), url: this.$http.adornUrl('/business/businessoutlay/dictList'),
method: 'post', method: 'get'
data: {
'writeUserId': this.userId,
'outinRemark': this.dataForm.outinDate
}
}).then(({data}) => { }).then(({data}) => {
console.log(data); // console.log(data);
if(data && data.code == 0){ if (data && data.code === 0) {
this.dataForm.outinYdayBalance = data.zrye; data.data.forEach((item) => {
this.dataForm.outinTdayOut = data.jrzc; if (item.dictCode === 'pay_type') {
this.jrYe(); this.payList = item.children
}
if (item.dictCode === 'expense_type') {
this.expenseList = item.children
}
})
} }
}) })
}, })
},
jrYe () {
let v1 = this.dataForm.outinYdayBalance
if (!v1) {
v1 = 0
} else {
v1 = parseFloat(this.dataForm.outinYdayBalance)
}
let v2 = this.dataForm.outinTdayIncome
if (!v2) {
v2 = 0
} else {
v2 = parseFloat(this.dataForm.outinTdayIncome)
}
let v3 = this.dataForm.outinTdayOut
if (!v3) {
v3 = 0
} else {
v3 = parseFloat(this.dataForm.outinTdayOut)
}
this.dataForm.outinTdayBalance = (v1 + v2 - v3).toFixed(2)
this.$forceUpdate()
},
// bindChange: function (e) {
dataFormSubmit () { this.dataForm.outinDate = e;
if (this.authenticName !== '管理员') { //
this.dataForm.writeUserId = this.userId this.$http.request({
url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'),
method: 'post',
data: {
'writeUserId': this.userId,
'outinRemark': this.dataForm.outinDate
} }
this.jrYe(); }).then(({data}) => {
this.$refs['dataForm'].validate((valid) => { console.log(data);
if (valid) { if(data && data.code == 0){
// this.dataForm.outinYdayBalance = data.zrye;
/*if (this.dataForm.id && this.dataForm.id !== 0) { this.dataForm.outinTdayOut = data.jrzc;
if (this.dataForm.approval === 1) { this.jrYe();
this.$message('待上次申请审批之后,在重新申请') }
} else if (this.dataForm.approval === 0 && JSON.stringify(this.dataForm) === JSON.stringify(this.dataOldForm)) { })
this.$message('请修改后在进行提交') },
} else {
this.$http({ //
url: this.$http.adornUrl(`/business/businessoutlayincome/update`), dataFormSubmit () {
method: 'post', if (this.authenticName !== '管理员') {
data: this.$http.adornData({ this.dataForm.writeUserId = this.userId
'id': this.dataForm.id, }
'approval': 1 this.jrYe();
}) this.$refs['dataForm'].validate((valid) => {
}) if (valid) {
// //
this.$http.request({ /*if (this.dataForm.id && this.dataForm.id !== 0) {
url: this.$http.adornUrl('/business/businessapproval/save'), if (this.dataForm.approval === 1) {
method: 'post', this.$message('待上次申请审批之后,在重新申请')
data: this.$http.adornData({ } else if (this.dataForm.approval === 0 && JSON.stringify(this.dataForm) === JSON.stringify(this.dataOldForm)) {
'approvalId': this.dataForm.id, this.$message('请修改后在进行提交')
'approvalName': this.dataForm.outinDate,
'approvalData': JSON.stringify(this.dataForm),
'approvalOldData': JSON.stringify(this.dataOldForm),
'approvalType': 7,
'approvalSuccess': 0
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
} else { } else {
this.$http({ this.$http({
url: this.$http.adornUrl(`/business/businessoutlayincome/save`), url: this.$http.adornUrl(`/business/businessoutlayincome/update`),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': this.dataForm.id || undefined, 'id': this.dataForm.id,
'outinDate': this.dataForm.outinDate, 'approval': 1
'outinYdayBalance': this.dataForm.outinYdayBalance, })
'outinTdayIncome': this.dataForm.outinTdayIncome, })
'outinTdayOut': this.dataForm.outinTdayOut, //
'outinTdayBalance': this.dataForm.outinTdayBalance, this.$http.request({
'outinCreditingWay': this.dataForm.outinCreditingWay, url: this.$http.adornUrl('/business/businessapproval/save'),
'outinPayId': this.dataForm.outinPayId, method: 'post',
'outinRemark': this.dataForm.outinRemark, data: this.$http.adornData({
'status': this.dataForm.status, 'approvalId': this.dataForm.id,
'writeUserId': this.dataForm.writeUserId, 'approvalName': this.dataForm.outinDate,
'approval': this.dataForm.approval 'approvalData': JSON.stringify(this.dataForm),
'approvalOldData': JSON.stringify(this.dataOldForm),
'approvalType': 7,
'approvalSuccess': 0
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -331,7 +297,8 @@
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}*/ }
} else {
this.$http({ this.$http({
url: this.$http.adornUrl(`/business/businessoutlayincome/save`), url: this.$http.adornUrl(`/business/businessoutlayincome/save`),
method: 'post', method: 'post',
@ -343,11 +310,11 @@
'outinTdayOut': this.dataForm.outinTdayOut, 'outinTdayOut': this.dataForm.outinTdayOut,
'outinTdayBalance': this.dataForm.outinTdayBalance, 'outinTdayBalance': this.dataForm.outinTdayBalance,
'outinCreditingWay': this.dataForm.outinCreditingWay, 'outinCreditingWay': this.dataForm.outinCreditingWay,
'outinPayId': this.dataForm.outinPayId,
'outinRemark': this.dataForm.outinRemark, 'outinRemark': this.dataForm.outinRemark,
'outType': this.dataForm.outType, 'status': this.dataForm.status,
'status': 0,
'writeUserId': this.dataForm.writeUserId, 'writeUserId': this.dataForm.writeUserId,
'approval': 0 'approval': this.dataForm.approval
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -364,9 +331,42 @@
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
} }*/
}) this.$http({
} url: this.$http.adornUrl(`/business/businessoutlayincome/save`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'outinDate': this.dataForm.outinDate,
'outinYdayBalance': this.dataForm.outinYdayBalance,
'outinTdayIncome': this.dataForm.outinTdayIncome,
'outinTdayOut': this.dataForm.outinTdayOut,
'outinTdayBalance': this.dataForm.outinTdayBalance,
'outinCreditingWay': this.dataForm.outinCreditingWay,
'outinRemark': this.dataForm.outinRemark,
'outType': this.dataForm.outType,
'status': 0,
'writeUserId': this.dataForm.writeUserId,
'approval': 0
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
} }
} }
}
</script> </script>

View File

@ -121,176 +121,176 @@
</template> </template>
<script> <script>
/* eslint-disable spaced-comment */ /* eslint-disable spaced-comment */
import AddOrUpdate from './businessoutlayincome-add-or-update' import AddOrUpdate from './businessoutlayincome-add-or-update'
export default { export default {
data () { data () {
return { return {
dataForm: { dataForm: {
key: '', key: '',
start: '' start: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
payList: [], // payList: [], //
expenseList: [], // expenseList: [], //
addOrUpdateVisible: false, addOrUpdateVisible: false,
userId: '', userId: '',
authenticName: '', authenticName: '',
sysYear: '' sysYear: ''
}
},
components: {
AddOrUpdate
},
async mounted () {
if (new Date().getMonth() + 1 === 1 || new Date().getMonth() + 1 === 2) {
this.sysYear = new Date().getFullYear() - 1
} else {
this.sysYear = new Date().getFullYear()
}
await this.$http.request({
url: this.$http.adornUrl('/sys/user/info'),
method: 'get'
}).then(({data}) => {
if (data && data.code === 0) {
this.userId = data.user.userId
this.authenticName = data.user.authenticName
} }
}, })
components: { await this.$http.request({
AddOrUpdate url: this.$http.adornUrl('/business/businessoutlay/dictList'),
}, method: 'get'
async mounted () { }).then(({data}) => {
if (new Date().getMonth() + 1 === 1 || new Date().getMonth() + 1 === 2) { // console.log(data);
this.sysYear = new Date().getFullYear() - 1 if (data && data.code === 0) {
} else { data.data.forEach((item) => {
this.sysYear = new Date().getFullYear() if (item.dictCode === 'pay_type') {
this.payList = item.children
}
if (item.dictCode === 'expense_type') {
this.expenseList = item.children
}
})
} }
await this.$http.request({ })
url: this.$http.adornUrl('/sys/user/info'),
method: 'get' this.getDataList()
}).then(({data}) => { },
if (data && data.code === 0) { methods: {
this.userId = data.user.userId //
this.authenticName = data.user.authenticName getDataList () {
} // eslint-disable-next-line eqeqeq
}) if (!(this.authenticName == '管理员' || this.authenticName == '侯德生' || this.authenticName == '侯吉庆' || this.authenticName == '李现举' || this.authenticName === '侯吉光' || this.authenticName === '肖爽')) {
await this.$http.request({ return
url: this.$http.adornUrl('/business/businessoutlay/dictList'), }
this.dataListLoading = true
//
/*this.$http.request({
url: this.$http.adornUrl('/sys/user/listNoPage'),
method: 'get' method: 'get'
}).then(({data}) => { }).then(({data}) => {
// console.log(data); // console.log(data);
if (data && data.code === 0) { if (data && data.code === 0) {
data.data.forEach((item) => { data.page.forEach((item) => {
if (item.dictCode === 'pay_type') { if (item.authenticName == '侯德生' || item.authenticName == '侯吉庆' || item.authenticName == '李现举' || item.authenticName === '侯吉光') {
this.payList = item.children this.userId = item.userId
this.authenticName = item.authenticName
} }
if (item.dictCode === 'expense_type') { })
this.expenseList = item.children }
})*/
this.dataList = []
this.$http({
url: this.$http.adornUrl('/business/businessoutlayincome/pcListPage'),
method: 'get',
params: this.$http.adornParams({
'start': this.dataForm.start,
'end': this.dataForm.end,
'writeUserId': this.userId,
'page': this.pageIndex,
'limit': this.pageSize
})
}).then(({data}) => {
this.totalPage = data.page.totalCount
if (this.authenticName === '管理员') {
this.dataList = data.page.list
} else {
data.page.list.forEach((item) => {
if (item.writeUserId === this.userId) { //
this.dataList.push(item)
} }
}) })
} }
}) })
this.dataListLoading = false
},
onExport () {
if (this.authenticName === '管理员') {
window.open(this.$http.adornUrl('/business/businessoutlayincome/export'))
} else {
window.open(this.$http.adornUrl('/business/businessoutlayincome/export?writeUserId=' + this.userId))
}
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
methods: { //
// currentChangeHandle (val) {
getDataList () { this.pageIndex = val
// eslint-disable-next-line eqeqeq this.getDataList()
if (!(this.authenticName == '管理员' || this.authenticName == '侯德生' || this.authenticName == '侯吉庆' || this.authenticName == '李现举' || this.authenticName === '侯吉光' || this.authenticName === '肖爽')) { },
return //
} selectionChangeHandle (val) {
this.dataListSelections = val
this.dataListLoading = true },
// /
// addOrUpdateHandle (id) {
/*this.$http.request({ this.addOrUpdateVisible = true
url: this.$http.adornUrl('/sys/user/listNoPage'), this.$nextTick(() => {
method: 'get' this.$refs.addOrUpdate.init(id)
}).then(({data}) => { })
// console.log(data); },
if (data && data.code === 0) { //
data.page.forEach((item) => { deleteHandle (id) {
if (item.authenticName == '侯德生' || item.authenticName == '侯吉庆' || item.authenticName == '李现举' || item.authenticName === '侯吉光') { var ids = id ? [id] : this.dataListSelections.map(item => {
this.userId = item.userId return item.id
this.authenticName = item.authenticName })
} this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
}) confirmButtonText: '确定',
} cancelButtonText: '取消',
})*/ type: 'warning'
this.dataList = [] }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/business/businessoutlayincome/pcListPage'), url: this.$http.adornUrl('/business/businessoutlayincome/delete'),
method: 'get', method: 'post',
params: this.$http.adornParams({ data: this.$http.adornData(ids, false)
'start': this.dataForm.start,
'end': this.dataForm.end,
'writeUserId': this.userId,
'page': this.pageIndex,
'limit': this.pageSize
})
}).then(({data}) => { }).then(({data}) => {
this.totalPage = data.page.totalCount if (data && data.code === 0) {
if (this.authenticName === '管理员') { this.$message({
this.dataList = data.page.list message: '操作成功',
} else { type: 'success',
data.page.list.forEach((item) => { duration: 1500,
if (item.writeUserId === this.userId) { // onClose: () => {
this.dataList.push(item) this.getDataList()
} }
}) })
} else {
this.$message.error(data.msg)
} }
}) })
this.dataListLoading = false })
},
onExport () {
if (this.authenticName === '管理员') {
window.open(this.$http.adornUrl('/business/businessoutlayincome/export'))
} else {
window.open(this.$http.adornUrl('/business/businessoutlayincome/export?writeUserId=' + this.userId))
}
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/business/businessoutlayincome/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
} }
} }
}
</script> </script>