2024-02-27需求变更
This commit is contained in:
parent
d79fc9b89e
commit
e61c6ac10a
11
README.md
11
README.md
|
@ -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基于vue、element-ui构建开发,实现[renren-fast](https://gitee.com/renrenio/renren-fast)后台管理前端功能,提供一套更优的前端解决方案
|
||||
- 前后端分离,通过token进行数据交互,可独立部署
|
||||
|
@ -8,7 +5,12 @@
|
|||
- 动态菜单,通过菜单管理统一管理访问路由
|
||||
- 数据切换,通过mock配置对接口数据/mock模拟数据进行切换
|
||||
- 发布时,可动态配置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,成功
|
||||
|
||||

|
||||

|
||||
|
@ -20,3 +22,4 @@
|
|||
|
||||
## 更新日志
|
||||
每个版本的详细更改都记录在[release notes](https://github.com/renrenio/renren-fast-vue/releases)中。
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>工程项目管理平台</title>
|
||||
<title>人人快速开发平台</title>
|
||||
<% if (process.env.NODE_ENV === 'production') { %>
|
||||
<!-- 生产环境 -->
|
||||
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,7 @@
|
|||
"gulp-replace": "1.0.0",
|
||||
"gulp-shell": "0.8.0",
|
||||
"lodash": "4.17.5",
|
||||
"node-sass": "^6.0.1",
|
||||
"node-sass": "npm:sass@^1.75.0",
|
||||
"npm": "^6.9.0",
|
||||
"sass-loader": "6.0.6",
|
||||
"svg-sprite-loader": "3.7.3",
|
||||
|
|
|
@ -857,6 +857,9 @@
|
|||
this.dataOldExcelForm = {
|
||||
...data.businessSsjdexcel
|
||||
}
|
||||
} else {
|
||||
this.dataExcelForm.id = ''
|
||||
this.dataExcelForm.contractId = this.dataForm.id
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<el-form-item>
|
||||
<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: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>
|
||||
<el-table
|
||||
|
@ -16,12 +16,12 @@
|
|||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<!-- <el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>-->
|
||||
<!-- <el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>-->
|
||||
<el-table-column
|
||||
type="index"
|
||||
header-align="center"
|
||||
|
@ -67,7 +67,7 @@
|
|||
label="操作">
|
||||
<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: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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -86,112 +86,112 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './businesscontract-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
import AddOrUpdate from './businesscontract-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
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
|
||||
},
|
||||
activated () {
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
// 当前页
|
||||
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/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
url: this.$http.adornUrl('/business/businesscontract/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = []
|
||||
data.page.list.forEach((item) => {
|
||||
if (item.contractNewName !== null && item.contractNewName !== '') {
|
||||
item.contractName = item.contractNewName
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
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 {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
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>
|
||||
|
|
|
@ -4,87 +4,87 @@
|
|||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="日期" prop="outTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.outTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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-form-item>
|
||||
<el-form-item label="内容" prop="outNr">
|
||||
<el-input v-model="dataForm.outNr" placeholder="内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="outWay">
|
||||
<el-select
|
||||
v-model="dataForm.outWay"
|
||||
placeholder="选择支付方式"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in payList"
|
||||
:key="item.dictId"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支出类别" prop="outType">
|
||||
<el-select
|
||||
v-model="dataForm.outType"
|
||||
placeholder="选择支出类别"
|
||||
style="width: 90%;"
|
||||
@change="selectZc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in expenseList"
|
||||
:key="item.dictId"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="立项归属" prop="outProject">
|
||||
<el-select
|
||||
v-model="dataForm.outProject"
|
||||
placeholder="选择立项归属"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.project"
|
||||
:value="item.projectId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isShow" label="收款人" prop="outPayee">
|
||||
<el-input v-if="!selectskr" v-model="dataForm.outPayee" placeholder="收款人"></el-input>
|
||||
<el-select
|
||||
v-else
|
||||
v-model="dataForm.outPayee"
|
||||
placeholder="选择收款人"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in recipientList"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="地址" prop="outPayeeAddress">-->
|
||||
<!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeeAddress" placeholder="地址"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="电话" prop="outPayeePhone">-->
|
||||
<!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeePhone" placeholder="电话"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="备注" prop="outRemark">-->
|
||||
<!-- <el-input v-model="dataForm.outRemark" placeholder="备注"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="日期" prop="outTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.outTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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-form-item>
|
||||
<el-form-item label="内容" prop="outNr">
|
||||
<el-input v-model="dataForm.outNr" placeholder="内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="outWay">
|
||||
<el-select
|
||||
v-model="dataForm.outWay"
|
||||
placeholder="选择支付方式"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in payList"
|
||||
:key="item.dictId"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支出类别" prop="outType">
|
||||
<el-select
|
||||
v-model="dataForm.outType"
|
||||
placeholder="选择支出类别"
|
||||
style="width: 90%;"
|
||||
@change="selectZc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in expenseList"
|
||||
:key="item.dictId"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="立项归属" prop="outProject">
|
||||
<el-select
|
||||
v-model="dataForm.outProject"
|
||||
placeholder="选择立项归属"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.project"
|
||||
:value="item.projectId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isShow" label="收款人" prop="outPayee">
|
||||
<el-input v-if="!selectskr" v-model="dataForm.outPayee" placeholder="收款人"></el-input>
|
||||
<el-select
|
||||
v-else
|
||||
v-model="dataForm.outPayee"
|
||||
placeholder="选择收款人"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in recipientList"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="地址" prop="outPayeeAddress">-->
|
||||
<!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeeAddress" placeholder="地址"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="电话" prop="outPayeePhone">-->
|
||||
<!-- <el-input :disabled="otherZclbDisabled" v-model="dataForm.outPayeePhone" placeholder="电话"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="备注" prop="outRemark">-->
|
||||
<!-- <el-input v-model="dataForm.outRemark" placeholder="备注"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
|
@ -94,255 +94,255 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
isShow: false,
|
||||
visible: false,
|
||||
selectskr: false, // 收款人
|
||||
otherZclbDisabled: true, // 其他支出类别不可以
|
||||
dataForm: {
|
||||
id: 0,
|
||||
outTime: '',
|
||||
outMoney: '',
|
||||
outNr: '',
|
||||
outWay: '',
|
||||
outType: '',
|
||||
outProject: '',
|
||||
outPayee: '',
|
||||
outPayeeAddress: '',
|
||||
outPayeePhone: '',
|
||||
outRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
dataOldForm: {
|
||||
id: 0,
|
||||
outTime: '',
|
||||
outMoney: '',
|
||||
outNr: '',
|
||||
outWay: '',
|
||||
outType: '',
|
||||
outProject: '',
|
||||
outPayee: '',
|
||||
outPayeeAddress: '',
|
||||
outPayeePhone: '',
|
||||
outRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
projectList: [], // 立项信息
|
||||
payList: [], // 支付方式
|
||||
recipientList: [], // 收款人
|
||||
recipientList_nbzz: [], // 收款人_内部转账
|
||||
recipientList_all: [], // 收款人_全部
|
||||
expenseList: [], // 支出类别
|
||||
dataRule: {
|
||||
outTime: [
|
||||
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
isShow: false,
|
||||
visible: false,
|
||||
selectskr: false, // 收款人
|
||||
otherZclbDisabled: true, // 其他支出类别不可以
|
||||
dataForm: {
|
||||
id: 0,
|
||||
outTime: '',
|
||||
outMoney: '',
|
||||
outNr: '',
|
||||
outWay: '',
|
||||
outType: '',
|
||||
outProject: '',
|
||||
outPayee: '',
|
||||
outPayeeAddress: '',
|
||||
outPayeePhone: '',
|
||||
outRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
dataOldForm: {
|
||||
id: 0,
|
||||
outTime: '',
|
||||
outMoney: '',
|
||||
outNr: '',
|
||||
outWay: '',
|
||||
outType: '',
|
||||
outProject: '',
|
||||
outPayee: '',
|
||||
outPayeeAddress: '',
|
||||
outPayeePhone: '',
|
||||
outRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
projectList: [], // 立项信息
|
||||
payList: [], // 支付方式
|
||||
recipientList: [], // 收款人
|
||||
recipientList_nbzz: [], // 收款人_内部转账
|
||||
recipientList_all: [], // 收款人_全部
|
||||
expenseList: [], // 支出类别
|
||||
dataRule: {
|
||||
outTime: [
|
||||
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.dataForm.approval = 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.dataForm.approval = 0
|
||||
this.visible = true
|
||||
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({
|
||||
url: this.$http.adornUrl('/sys/user/info'),
|
||||
url: this.$http.adornUrl('/business/businessoutlay/allList'),
|
||||
method: 'get'
|
||||
}).then(({data}) => {
|
||||
// console.log(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.projectList = data.page
|
||||
this.projectList.forEach((item) => {
|
||||
if (item.projectNewName !== null) {
|
||||
item.project = item.projectNewName
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取立项数据
|
||||
this.$http.request({
|
||||
url: this.$http.adornUrl('/business/businessoutlay/allList'),
|
||||
url: this.$http.adornUrl('/business/businessoutlay/selectAllContainsDeparturePage'),
|
||||
method: 'get'
|
||||
}).then(({data}) => {
|
||||
// console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.projectList = data.page
|
||||
this.projectList.forEach((item) => {
|
||||
if (item.projectNewName !== null) {
|
||||
item.project = item.projectNewName
|
||||
}
|
||||
})
|
||||
this.recipientList_all = data.page
|
||||
}
|
||||
this.$http.request({
|
||||
url: this.$http.adornUrl('/business/businessoutlay/selectAllContainsDeparturePage'),
|
||||
url: this.$http.adornUrl('/business/businessoutlay/dictList'),
|
||||
method: 'get'
|
||||
}).then(({data}) => {
|
||||
// console.log(data);
|
||||
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({
|
||||
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.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
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
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.dataOldForm = {
|
||||
...data.businessOutlay
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
this.selectZc()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
// if (this.authenticName !== '管理员') {
|
||||
this.dataForm.writeUserId = this.userId
|
||||
// }
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 进入审批
|
||||
// if (this.dataForm.id && this.dataForm.id !== 0) {
|
||||
// if (this.dataForm.approval === 1) {
|
||||
// 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/businessoutlay/update`),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData({
|
||||
// 'id': this.dataForm.id,
|
||||
// 'approval': 1
|
||||
// })
|
||||
// })
|
||||
// // 提交到审批表中
|
||||
// this.$http.request({
|
||||
// url: this.$http.adornUrl('/business/businessapproval/save'),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData({
|
||||
// 'approvalId': this.dataForm.id,
|
||||
// 'approvalName': this.dataForm.outTime,
|
||||
// 'approvalData': JSON.stringify(this.dataForm),
|
||||
// 'approvalOldData': JSON.stringify(this.dataOldForm),
|
||||
// 'approvalType': 6,
|
||||
// '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 {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/business/businessoutlay/save`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id,
|
||||
'outTime': this.dataForm.outTime,
|
||||
'outMoney': this.dataForm.outMoney,
|
||||
'outNr': this.dataForm.outNr,
|
||||
'outWay': this.dataForm.outWay,
|
||||
'outType': this.dataForm.outType,
|
||||
'outProject': this.dataForm.outProject,
|
||||
'outPayee': this.dataForm.outPayee,
|
||||
'outPayeeAddress': this.dataForm.outPayeeAddress,
|
||||
'outPayeePhone': this.dataForm.outPayeePhone,
|
||||
'outRemark': this.dataForm.outRemark,
|
||||
'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)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
// if (this.authenticName !== '管理员') {
|
||||
this.dataForm.writeUserId = this.userId
|
||||
// }
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 进入审批
|
||||
// if (this.dataForm.id && this.dataForm.id !== 0) {
|
||||
// if (this.dataForm.approval === 1) {
|
||||
// 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/businessoutlay/update`),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData({
|
||||
// 'id': this.dataForm.id,
|
||||
// 'approval': 1
|
||||
// })
|
||||
// })
|
||||
// // 提交到审批表中
|
||||
// this.$http.request({
|
||||
// url: this.$http.adornUrl('/business/businessapproval/save'),
|
||||
// method: 'post',
|
||||
// data: this.$http.adornData({
|
||||
// 'approvalId': this.dataForm.id,
|
||||
// 'approvalName': this.dataForm.outTime,
|
||||
// 'approvalData': JSON.stringify(this.dataForm),
|
||||
// 'approvalOldData': JSON.stringify(this.dataOldForm),
|
||||
// 'approvalType': 6,
|
||||
// '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 {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/business/businessoutlay/save`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id,
|
||||
'outTime': this.dataForm.outTime,
|
||||
'outMoney': this.dataForm.outMoney,
|
||||
'outNr': this.dataForm.outNr,
|
||||
'outWay': this.dataForm.outWay,
|
||||
'outType': this.dataForm.outType,
|
||||
'outProject': this.dataForm.outProject,
|
||||
'outPayee': this.dataForm.outPayee,
|
||||
'outPayeeAddress': this.dataForm.outPayeeAddress,
|
||||
'outPayeePhone': this.dataForm.outPayeePhone,
|
||||
'outRemark': this.dataForm.outRemark,
|
||||
'status': 0,
|
||||
'writeUserId': this.dataForm.writeUserId,
|
||||
'approval': 0
|
||||
})
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
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
|
||||
}).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)
|
||||
}
|
||||
})
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -96,24 +96,24 @@
|
|||
align="center"
|
||||
label="收款人">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="outPayeeAddress"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- label="地址">-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="outPayeePhone"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- label="电话">-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="outRemark"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- label="备注">-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="outPayeeAddress"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- label="地址">-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="outPayeePhone"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- label="电话">-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="outRemark"-->
|
||||
<!-- header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- label="备注">-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
|
@ -140,187 +140,187 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './businessoutlay-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: '',
|
||||
start: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
projectList: [], // 立项信息
|
||||
payList: [], // 支付方式
|
||||
recipientList: [], // 收款人
|
||||
expenseList: [], // 支出类别
|
||||
addOrUpdateVisible: false,
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
sysYear: '',
|
||||
isShow: false
|
||||
}
|
||||
},
|
||||
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()
|
||||
}
|
||||
import AddOrUpdate from './businessoutlay-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: '',
|
||||
start: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
projectList: [], // 立项信息
|
||||
payList: [], // 支付方式
|
||||
recipientList: [], // 收款人
|
||||
expenseList: [], // 支出类别
|
||||
addOrUpdateVisible: false,
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
sysYear: '',
|
||||
isShow: false
|
||||
}
|
||||
},
|
||||
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
|
||||
if (data.user.userId === 10 || data.user.userId === 1) {
|
||||
this.isShow = true
|
||||
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
|
||||
if (data.user.userId === 10 || data.user.userId === 1) {
|
||||
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'
|
||||
}).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/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
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
// 获取立项数据
|
||||
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()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.dataList = []
|
||||
// 当前页
|
||||
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/pcListNoPage'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'start': this.dataForm.start,
|
||||
'end': this.dataForm.end,
|
||||
'writeUserId': this.userId,
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize
|
||||
})
|
||||
url: this.$http.adornUrl('/business/businessoutlay/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).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
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} 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.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
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>
|
||||
|
|
|
@ -4,42 +4,42 @@
|
|||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="日期" prop="outinDate">
|
||||
<el-date-picker @change="bindChange($event)"
|
||||
:disabled="!!dataForm.id"
|
||||
v-model="dataForm.outinDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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-form-item>
|
||||
<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-form-item>
|
||||
<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-form-item>
|
||||
<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-button @click="jrYe()">计算</el-button>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="收款方式" prop="outinCreditingWay">
|
||||
<el-select
|
||||
v-model="dataForm.outinCreditingWay"
|
||||
placeholder="选择收款方式"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in payList"
|
||||
:key="item.dictId"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="outinDate">
|
||||
<el-date-picker @change="bindChange($event)"
|
||||
:disabled="!!dataForm.id"
|
||||
v-model="dataForm.outinDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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-form-item>
|
||||
<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-form-item>
|
||||
<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-form-item>
|
||||
<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-button @click="jrYe()">计算</el-button>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="收款方式" prop="outinCreditingWay">
|
||||
<el-select
|
||||
v-model="dataForm.outinCreditingWay"
|
||||
placeholder="选择收款方式"
|
||||
style="width: 90%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in payList"
|
||||
:key="item.dictId"
|
||||
:label="item.name"
|
||||
:value="item.dictId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="收入类别" prop="outType">
|
||||
<el-select
|
||||
v-model="dataForm.outType"
|
||||
|
@ -54,9 +54,9 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="outinRemark">
|
||||
<el-input v-model="dataForm.outinRemark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="outinRemark">
|
||||
<el-input v-model="dataForm.outinRemark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
|
@ -66,97 +66,71 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
outinDate: '',
|
||||
outinYdayBalance: '',
|
||||
outinTdayIncome: '',
|
||||
outinTdayOut: '',
|
||||
outinTdayBalance: '',
|
||||
outinCreditingWay: '',
|
||||
outType: '',
|
||||
outinRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
dataOldForm: {
|
||||
id: 0,
|
||||
outinDate: '',
|
||||
outinYdayBalance: '',
|
||||
outinTdayIncome: '',
|
||||
outinTdayOut: '',
|
||||
outinTdayBalance: '',
|
||||
outinCreditingWay: '',
|
||||
outType: '',
|
||||
outinRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
// 字典内容
|
||||
payList: [],
|
||||
expenseList: [], // 收入类别
|
||||
dataRule: {
|
||||
outinDate: [
|
||||
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
outinDate: '',
|
||||
outinYdayBalance: '',
|
||||
outinTdayIncome: '',
|
||||
outinTdayOut: '',
|
||||
outinTdayBalance: '',
|
||||
outinCreditingWay: '',
|
||||
outType: '',
|
||||
outinRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
dataOldForm: {
|
||||
id: 0,
|
||||
outinDate: '',
|
||||
outinYdayBalance: '',
|
||||
outinTdayIncome: '',
|
||||
outinTdayOut: '',
|
||||
outinTdayBalance: '',
|
||||
outinCreditingWay: '',
|
||||
outType: '',
|
||||
outinRemark: '',
|
||||
status: 0,
|
||||
writeUserId: '', // 填写人id
|
||||
approval: 0
|
||||
},
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
// 字典内容
|
||||
payList: [],
|
||||
expenseList: [], // 收入类别
|
||||
dataRule: {
|
||||
outinDate: [
|
||||
{ required: true, message: '日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.dataForm.approval = 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id && this.dataForm.id !== 0) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/business/businessoutlayincome/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm = {
|
||||
...data.businessOutlayIncome
|
||||
}
|
||||
this.dataOldForm = {
|
||||
...data.businessOutlayIncome
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.dataForm.approval = 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id && this.dataForm.id !== 0) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/business/businessoutlayincome/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm = {
|
||||
...data.businessOutlayIncome
|
||||
}
|
||||
// 获取登录人信息
|
||||
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
|
||||
// // 获取对应的数据
|
||||
// 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.dataOldForm = {
|
||||
...data.businessOutlayIncome
|
||||
}
|
||||
}
|
||||
// 获取登录人信息
|
||||
this.$http.request({
|
||||
url: this.$http.adornUrl('/sys/user/info'),
|
||||
|
@ -165,156 +139,148 @@
|
|||
if (data && data.code === 0) {
|
||||
this.userId = data.user.userId
|
||||
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',
|
||||
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;
|
||||
this.jrYe();
|
||||
}
|
||||
})
|
||||
// // 获取对应的数据
|
||||
// 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({
|
||||
url: this.$http.adornUrl('/business/businessoutlay/dictList'),
|
||||
url: this.$http.adornUrl('/sys/user/info'),
|
||||
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
|
||||
this.userId = data.user.userId
|
||||
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',
|
||||
data: {
|
||||
'writeUserId': this.userId,
|
||||
'outinRemark': this.dataForm.outinDate
|
||||
}
|
||||
if (item.dictCode === 'expense_type') {
|
||||
this.expenseList = item.children
|
||||
}).then(({data}) => {
|
||||
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({
|
||||
url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'),
|
||||
method: 'post',
|
||||
data: {
|
||||
'writeUserId': this.userId,
|
||||
'outinRemark': this.dataForm.outinDate
|
||||
}
|
||||
url: this.$http.adornUrl('/business/businessoutlay/dictList'),
|
||||
method: 'get'
|
||||
}).then(({data}) => {
|
||||
console.log(data);
|
||||
if(data && data.code == 0){
|
||||
this.dataForm.outinYdayBalance = data.zrye;
|
||||
this.dataForm.outinTdayOut = data.jrzc;
|
||||
this.jrYe();
|
||||
// console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
data.data.forEach((item) => {
|
||||
if (item.dictCode === 'pay_type') {
|
||||
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()
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
if (this.authenticName !== '管理员') {
|
||||
this.dataForm.writeUserId = this.userId
|
||||
bindChange: function (e) {
|
||||
this.dataForm.outinDate = e;
|
||||
// 获取对应的数据
|
||||
this.$http.request({
|
||||
url: this.$http.adornUrl('/business/businessoutlayincome/getCalcVal'),
|
||||
method: 'post',
|
||||
data: {
|
||||
'writeUserId': this.userId,
|
||||
'outinRemark': this.dataForm.outinDate
|
||||
}
|
||||
this.jrYe();
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 进入审批
|
||||
/*if (this.dataForm.id && this.dataForm.id !== 0) {
|
||||
if (this.dataForm.approval === 1) {
|
||||
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`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id,
|
||||
'approval': 1
|
||||
})
|
||||
})
|
||||
// 提交到审批表中
|
||||
this.$http.request({
|
||||
url: this.$http.adornUrl('/business/businessapproval/save'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'approvalId': this.dataForm.id,
|
||||
'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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}).then(({data}) => {
|
||||
console.log(data);
|
||||
if(data && data.code == 0){
|
||||
this.dataForm.outinYdayBalance = data.zrye;
|
||||
this.dataForm.outinTdayOut = data.jrzc;
|
||||
this.jrYe();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
if (this.authenticName !== '管理员') {
|
||||
this.dataForm.writeUserId = this.userId
|
||||
}
|
||||
this.jrYe();
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 进入审批
|
||||
/*if (this.dataForm.id && this.dataForm.id !== 0) {
|
||||
if (this.dataForm.approval === 1) {
|
||||
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/save`),
|
||||
url: this.$http.adornUrl(`/business/businessoutlayincome/update`),
|
||||
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,
|
||||
'outinPayId': this.dataForm.outinPayId,
|
||||
'outinRemark': this.dataForm.outinRemark,
|
||||
'status': this.dataForm.status,
|
||||
'writeUserId': this.dataForm.writeUserId,
|
||||
'approval': this.dataForm.approval
|
||||
'id': this.dataForm.id,
|
||||
'approval': 1
|
||||
})
|
||||
})
|
||||
// 提交到审批表中
|
||||
this.$http.request({
|
||||
url: this.$http.adornUrl('/business/businessapproval/save'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'approvalId': this.dataForm.id,
|
||||
'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) {
|
||||
|
@ -331,7 +297,8 @@
|
|||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}*/
|
||||
}
|
||||
} else {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/business/businessoutlayincome/save`),
|
||||
method: 'post',
|
||||
|
@ -343,11 +310,11 @@
|
|||
'outinTdayOut': this.dataForm.outinTdayOut,
|
||||
'outinTdayBalance': this.dataForm.outinTdayBalance,
|
||||
'outinCreditingWay': this.dataForm.outinCreditingWay,
|
||||
'outinPayId': this.dataForm.outinPayId,
|
||||
'outinRemark': this.dataForm.outinRemark,
|
||||
'outType': this.dataForm.outType,
|
||||
'status': 0,
|
||||
'status': this.dataForm.status,
|
||||
'writeUserId': this.dataForm.writeUserId,
|
||||
'approval': 0
|
||||
'approval': this.dataForm.approval
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
|
@ -364,9 +331,42 @@
|
|||
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>
|
||||
|
|
|
@ -121,176 +121,176 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable spaced-comment */
|
||||
/* eslint-disable spaced-comment */
|
||||
|
||||
import AddOrUpdate from './businessoutlayincome-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: '',
|
||||
start: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
payList: [], // 收款方式
|
||||
expenseList: [], // 收入类别
|
||||
addOrUpdateVisible: false,
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
sysYear: ''
|
||||
import AddOrUpdate from './businessoutlayincome-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: '',
|
||||
start: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
payList: [], // 收款方式
|
||||
expenseList: [], // 收入类别
|
||||
addOrUpdateVisible: false,
|
||||
userId: '',
|
||||
authenticName: '',
|
||||
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: {
|
||||
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('/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
|
||||
}
|
||||
if (item.dictCode === 'expense_type') {
|
||||
this.expenseList = item.children
|
||||
}
|
||||
})
|
||||
}
|
||||
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
|
||||
}
|
||||
})
|
||||
await this.$http.request({
|
||||
url: this.$http.adornUrl('/business/businessoutlay/dictList'),
|
||||
})
|
||||
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (!(this.authenticName == '管理员' || this.authenticName == '侯德生' || this.authenticName == '侯吉庆' || this.authenticName == '李现举' || this.authenticName === '侯吉光' || this.authenticName === '肖爽')) {
|
||||
return
|
||||
}
|
||||
|
||||
this.dataListLoading = true
|
||||
|
||||
// 获取系统用户信息
|
||||
/*this.$http.request({
|
||||
url: this.$http.adornUrl('/sys/user/listNoPage'),
|
||||
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
|
||||
data.page.forEach((item) => {
|
||||
if (item.authenticName == '侯德生' || item.authenticName == '侯吉庆' || item.authenticName == '李现举' || item.authenticName === '侯吉光') {
|
||||
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()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (!(this.authenticName == '管理员' || this.authenticName == '侯德生' || this.authenticName == '侯吉庆' || this.authenticName == '李现举' || this.authenticName === '侯吉光' || this.authenticName === '肖爽')) {
|
||||
return
|
||||
}
|
||||
|
||||
this.dataListLoading = true
|
||||
|
||||
// 获取系统用户信息
|
||||
/*this.$http.request({
|
||||
url: this.$http.adornUrl('/sys/user/listNoPage'),
|
||||
method: 'get'
|
||||
}).then(({data}) => {
|
||||
// console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
data.page.forEach((item) => {
|
||||
if (item.authenticName == '侯德生' || item.authenticName == '侯吉庆' || item.authenticName == '李现举' || item.authenticName === '侯吉光') {
|
||||
this.userId = item.userId
|
||||
this.authenticName = item.authenticName
|
||||
}
|
||||
})
|
||||
}
|
||||
})*/
|
||||
this.dataList = []
|
||||
// 当前页
|
||||
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/pcListPage'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'start': this.dataForm.start,
|
||||
'end': this.dataForm.end,
|
||||
'writeUserId': this.userId,
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize
|
||||
})
|
||||
url: this.$http.adornUrl('/business/businessoutlayincome/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).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)
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue