|
@@ -10,7 +10,7 @@
|
|
|
size="small"
|
|
|
class="el-button--small-yh "
|
|
|
:loading="buttonLoading"
|
|
|
- :disabled="!form.id"
|
|
|
+ :disabled="!form.id || viewDisabled"
|
|
|
@click.stop="mainCheck">
|
|
|
请核
|
|
|
</el-button>
|
|
@@ -19,7 +19,7 @@
|
|
|
<el-button
|
|
|
type="success"
|
|
|
:loading="buttonLoading"
|
|
|
- :disabled="!form.id"
|
|
|
+ :disabled="!form.id || viewDisabled"
|
|
|
size="small"
|
|
|
>
|
|
|
业务处理<i class="el-icon-arrow-down el-icon--right"></i>
|
|
@@ -56,12 +56,15 @@
|
|
|
<crop-select
|
|
|
v-model="form.corpId"
|
|
|
corpType="KG"
|
|
|
+ :disabled="viewDisabled"
|
|
|
style="width: 100%"
|
|
|
></crop-select>
|
|
|
</template>
|
|
|
<template slot="corpAttn">
|
|
|
<el-select
|
|
|
v-model="form.corpAttn"
|
|
|
+ :disabled="viewDisabled"
|
|
|
+ icon="el-icon-edit"
|
|
|
remote
|
|
|
filterable
|
|
|
clearable
|
|
@@ -78,6 +81,7 @@
|
|
|
<template slot="salesName">
|
|
|
<el-select
|
|
|
v-model="form.salesName"
|
|
|
+ :disabled="viewDisabled"
|
|
|
remote
|
|
|
filterable
|
|
|
clearable
|
|
@@ -94,6 +98,7 @@
|
|
|
<template slot="sourceBusiness">
|
|
|
<el-select
|
|
|
v-model="form.sourceBusiness"
|
|
|
+ :disabled="viewDisabled"
|
|
|
filterable
|
|
|
clearable
|
|
|
>
|
|
@@ -145,6 +150,7 @@
|
|
|
<el-button type="primary"
|
|
|
size="small"
|
|
|
icon="el-icon-plus"
|
|
|
+ :disabled="viewDisabled"
|
|
|
@click="serviceDialog = true">录入明细
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -157,11 +163,6 @@
|
|
|
<!-- </template>-->
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click="rowCellTwo(row,index)"
|
|
|
- >{{row.$cellEdit?'修改完成':'修改'}}</el-button>
|
|
|
- <el-button
|
|
|
v-if="row.status !== 5"
|
|
|
type="text"
|
|
|
size="small"
|
|
@@ -171,13 +172,20 @@
|
|
|
v-if="row.status === 5"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
+ :disabled="viewDisabled"
|
|
|
@click="cancelCloseAccount(row)"
|
|
|
>取消结算</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="small"
|
|
|
+ @click="rowCellTwo(row,index)"
|
|
|
+ :disabled="row.strStatus == '结算完成' || viewDisabled"
|
|
|
+ >{{row.$cellEdit?'修改完成':'修改'}}</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
@click="rowDel(row,index)"
|
|
|
- :disabled="row.strStatus == '结算完成'"
|
|
|
+ :disabled="row.strStatus == '结算完成' || viewDisabled"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
<template slot="userid" slot-scope="{row,index}">
|
|
@@ -235,19 +243,16 @@
|
|
|
<el-row>
|
|
|
<el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:6" :key="index">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
- <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="formTwo[item.prop]" size="small" type="datetime" :disabled="item.disabled?true:false" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
- <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="formTwo[item.prop]" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"/>
|
|
|
- <el-select v-else-if="item.prop === 'paymentType'" style="width: 100%" v-model="formTwo[item.prop]" size="small" placeholder="请选择" clearable filterable>
|
|
|
- <el-option v-for="(item,index) in paymentTerm" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="formTwo[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
- <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="formTwo[item.prop]" @change="debitChange" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
|
|
|
+ <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="formTwo[item.prop]" size="small" type="datetime" :disabled="item.disabled?true:false || viewDisabled" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="formTwo[item.prop]" size="small" type="date" :disabled="viewDisabled" placeholder="选择日期" value-format="yyyy-MM-dd"/>
|
|
|
+ <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="formTwo[item.prop]" :disabled="viewDisabled" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
+ <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="formTwo[item.prop]" @change="debitChange" :disabled="item.disabled?true:false || viewDisabled" size="small" autocomplete="off" placeholder="请输入">
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- <el-input type="age" v-else-if="item.type === 'unit'" v-model="formTwo[item.prop]" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
|
|
|
+ <el-input type="age" v-else-if="item.type === 'unit'" v-model="formTwo[item.prop]" :disabled="item.disabled?true:false || viewDisabled" size="small" autocomplete="off" placeholder="请输入">
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- <el-input type="age" v-else v-model="formTwo[item.prop]" :disabled="item.disabled?true:false" size="small" value="0" autocomplete="off" placeholder="请输入">
|
|
|
+ <el-input type="age" v-else v-model="formTwo[item.prop]" :disabled="item.disabled?true:false || viewDisabled" size="small" value="0" autocomplete="off" placeholder="请输入">
|
|
|
<template v-if="item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'" slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
@@ -375,21 +380,7 @@
|
|
|
:close-on-press-escape="false">
|
|
|
<el-form :model="accountFormData" ref="accountFormData">
|
|
|
<el-form-item label="账户名称" class="landConFrom-input" prop="accountName" :rules="rules">
|
|
|
- <el-select
|
|
|
- v-model="accountFormData.accountName"
|
|
|
- style="width: 220px;"
|
|
|
- placeholder="请选择"
|
|
|
- size="small"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item,index) in accountNameDic"
|
|
|
- :key="index"
|
|
|
- :label="item.realName"
|
|
|
- :value="item.realName">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input v-model="accountFormData.accountName" style="width: 220px;" size="small" clearable placeholder="请输入" ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="结算日期" class="landConFrom-input" prop="payTime" :rules="rules">
|
|
|
<el-date-picker type="date" v-model="accountFormData.payTime" value-format="yyyy-MM-dd HH:mm:ss" size="small" clearable placeholder="日期" ></el-date-picker>
|
|
@@ -412,10 +403,6 @@
|
|
|
//服务列表接口
|
|
|
import {getServiceProjectList,getServiceTypeTree,} from "@/api/workManagement/serviceProject";
|
|
|
import serviceOption from "./configuration/serviceDialogList.json";
|
|
|
- //业务字典
|
|
|
- import { getDictionary } from "@/api/system/dictbiz";
|
|
|
- // 当前登录人
|
|
|
- import { getUserInfo } from "@/api/system/user";
|
|
|
//用户组件
|
|
|
import userOption from "./configuration/userList.json";
|
|
|
import { getList } from "@/api/system/user";
|
|
@@ -448,14 +435,14 @@
|
|
|
formTwo:{},
|
|
|
optionFrom:{},
|
|
|
account:{},
|
|
|
- data: [],
|
|
|
+ data:[],
|
|
|
dataList:[],
|
|
|
crudSelection:[],
|
|
|
corpAttnDic:[],
|
|
|
salesNameDic:[],
|
|
|
sourceBusinessDic:[],
|
|
|
- accountNameDic:[],
|
|
|
buttonLoading:false,
|
|
|
+ viewDisabled:false,
|
|
|
deptDicData:[],//任务部门数据
|
|
|
serviceDialog:false,//服务导入窗口
|
|
|
userDialog:false,//用户导入窗口
|
|
@@ -471,7 +458,6 @@
|
|
|
dicData:[]
|
|
|
},
|
|
|
detailsSelect: {},
|
|
|
- paymentTerm:[],
|
|
|
//顶部from数据
|
|
|
option: {
|
|
|
menuBtn: false,
|
|
@@ -632,14 +618,7 @@
|
|
|
{
|
|
|
label: '收款方式',
|
|
|
prop: 'paymentType',
|
|
|
- type:'select',
|
|
|
- dataType: "number",
|
|
|
width: 120,
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=affair_payment_term",
|
|
|
- props: {
|
|
|
- label: "dictValue",
|
|
|
- value: "dictKey"
|
|
|
- },
|
|
|
},
|
|
|
{
|
|
|
label: '开始日期',
|
|
@@ -779,7 +758,6 @@
|
|
|
if(index <= 20){
|
|
|
this.corpAttnDic.push(item)
|
|
|
this.salesNameDic.push(item)
|
|
|
- this.accountNameDic.push(item)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -788,9 +766,6 @@
|
|
|
this.getWorkDicts("source_Business").then(res =>{
|
|
|
this.sourceBusinessDic = res.data.data;
|
|
|
})
|
|
|
- this.getWorkDicts("affair_payment_term").then(res =>{
|
|
|
- this.paymentTerm = res.data.data;
|
|
|
- })
|
|
|
|
|
|
if(this.detailData.id){
|
|
|
this.id = BigInt(this.detailData.id);//字符串转数字 超长用BigInt
|
|
@@ -810,12 +785,10 @@
|
|
|
this.$set(this.formTwo,"balanceAmount",0)
|
|
|
this.$set(this.formTwo,"createUserName", this.$store.getters.userInfo.user_name)
|
|
|
|
|
|
- getSysNo().then(res =>{
|
|
|
- this.$set(this.form,"sysNo", res.data.data)
|
|
|
- let date = new Date();
|
|
|
- let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
|
|
- this.$set(this.formTwo,"createTime",strDate)
|
|
|
- });
|
|
|
+ let date = new Date();
|
|
|
+ let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
|
|
+ this.$set(this.formTwo,"createTime",strDate)
|
|
|
+
|
|
|
}
|
|
|
if(this.$route.query.itemId){
|
|
|
this.id = this.$route.query.itemId
|
|
@@ -837,7 +810,6 @@
|
|
|
this.tab1 = true;
|
|
|
this.tab2 = false;
|
|
|
this.tab3 = false;
|
|
|
-
|
|
|
if(this.secondDisable === 1){
|
|
|
this.data_two = this.data
|
|
|
}
|
|
@@ -868,7 +840,6 @@
|
|
|
this.tab1 = false;
|
|
|
this.tab2 = false;
|
|
|
this.tab3 = true;
|
|
|
-
|
|
|
if(this.secondDisable === 0){
|
|
|
this.data_one = this.data
|
|
|
}
|
|
@@ -1013,6 +984,13 @@
|
|
|
//请核
|
|
|
mainCheck(){
|
|
|
if(this.verificationData()){
|
|
|
+ this.detailsCollection()
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
+ if (this.dataList[i].strStatus !== "结算完成") {
|
|
|
+ return this.$message.error(`明细列表存在未结算数据,请检查!`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
masterCheck(this.form.id).then(res=>{
|
|
|
if(res.data.success){
|
|
|
this.$message.success("操作成功!")
|
|
@@ -1031,20 +1009,7 @@
|
|
|
editMainProject(type){
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if(valid){
|
|
|
-
|
|
|
- if(this.secondDisable === 0){
|
|
|
- this.data_one = this.data
|
|
|
- }
|
|
|
- if(this.secondDisable === 1){
|
|
|
- this.data_two = this.data
|
|
|
- }
|
|
|
- if(this.secondDisable === 2){
|
|
|
- this.data_three = this.data
|
|
|
- }
|
|
|
-
|
|
|
- this.dataList = []
|
|
|
- this.dataList.push(...this.data_one,...this.data_two,...this.data_three)
|
|
|
-
|
|
|
+ this.detailsCollection()
|
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
|
if (this.dataList[i].userid === (null || "")) {
|
|
|
return this.$message.error(`请输入明细列表第${i + 1}行的承做人`);
|
|
@@ -1085,8 +1050,61 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ createData(){
|
|
|
+ if(this.verificationData()){
|
|
|
+ this.$confirm("确定创建新的单据吗?", "提示", {
|
|
|
+ confirmButtonText: "保存",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.form = {}
|
|
|
+ this.oldForm = {}
|
|
|
+ this.formTwo = {}
|
|
|
+ this.oldFormTwo = {}
|
|
|
+ this.dataList = []
|
|
|
+ this.oldData = []
|
|
|
+ this.upLoadData = []
|
|
|
+ this.oldUpLoadData = []
|
|
|
+
|
|
|
+ this.$set(this.formTwo,"corpAttn",this.$store.getters.userInfo.user_name)
|
|
|
+ this.$set(this.formTwo,"salesName",this.$store.getters.userInfo.user_name)
|
|
|
+
|
|
|
+ this.$set(this.formTwo,"debitAmount",0)
|
|
|
+ this.$set(this.formTwo,"advanceAmount",0)
|
|
|
+ this.$set(this.formTwo,"settlmentAmount",0)
|
|
|
+ this.$set(this.formTwo,"balanceAmount",0)
|
|
|
+ this.$set(this.formTwo,"createUserName", this.$store.getters.userInfo.user_name)
|
|
|
+
|
|
|
+ let date = new Date();
|
|
|
+ let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
|
|
+ this.$set(this.formTwo,"createTime",strDate)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //明细合集
|
|
|
+ detailsCollection(){
|
|
|
+ if(this.secondDisable === 0){
|
|
|
+ this.data = this.data_one
|
|
|
+ }
|
|
|
+ if(this.secondDisable === 1){
|
|
|
+ this.data = this.data_two
|
|
|
+ }
|
|
|
+ if(this.secondDisable === 2){
|
|
|
+ this.data = this.data_three
|
|
|
+ }
|
|
|
+
|
|
|
+ this.dataList = []
|
|
|
+ this.dataList.push(...this.data_one,...this.data_two,...this.data_three)
|
|
|
+ },
|
|
|
afterEcho(data){
|
|
|
this.form = data;
|
|
|
+ this.viewDisabled = this.form.status !== 0? true : false
|
|
|
+ this.option.column.forEach(item =>{
|
|
|
+ if( item.prop == "cname" ){
|
|
|
+ this.$set(item,"disabled",this.viewDisabled)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
this.formTwo = Object.assign({},data);
|
|
|
|
|
|
delete this.formTwo.cname;
|
|
@@ -1098,6 +1116,7 @@
|
|
|
|
|
|
this.oldForm = Object.assign({},data);
|
|
|
this.oldFormTwo = Object.assign({},data);
|
|
|
+
|
|
|
if(data.itemList){
|
|
|
this.dataList = data.itemList;
|
|
|
this.oldData = this.deepClone(data.itemList)
|
|
@@ -1107,15 +1126,15 @@
|
|
|
this.data_two=this.dataList.filter(item=>item.projectType === 1)
|
|
|
this.data_three=this.dataList.filter(item=>item.projectType === 2)
|
|
|
|
|
|
-
|
|
|
+ //判断当前所处哪个明细下 给data赋值
|
|
|
if(this.secondDisable === 0){
|
|
|
- this.data = this.data_one
|
|
|
+ this.data = this.data_one
|
|
|
}
|
|
|
if(this.secondDisable === 1){
|
|
|
- this.data = this.data_two
|
|
|
+ this.data = this.data_two
|
|
|
}
|
|
|
if(this.secondDisable === 2){
|
|
|
- this.data = this.data_three
|
|
|
+ this.data = this.data_three
|
|
|
}
|
|
|
}
|
|
|
if(data.filesList){
|
|
@@ -1124,6 +1143,7 @@
|
|
|
}
|
|
|
},
|
|
|
verificationData(){
|
|
|
+ this.detailsCollection()
|
|
|
if(contrastObj(this.form,this.oldForm)||contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.dataList,this.oldData)
|
|
|
|| contrastList(this.upLoadData,this.oldUpLoadData)
|
|
|
) {
|
|
@@ -1296,7 +1316,8 @@
|
|
|
},
|
|
|
//返回主营项目列表
|
|
|
backToList(){
|
|
|
- if(contrastObj(this.form,this.oldForm) || contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.data,this.oldData)
|
|
|
+ this.detailsCollection()
|
|
|
+ if(contrastObj(this.form,this.oldForm) || contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.dataList,this.oldData)
|
|
|
|| contrastList(this.upLoadData,this.oldUpLoadData)
|
|
|
){
|
|
|
this.$confirm("当前页面有未保存数据,是否保存数据?", "提示", {
|
|
@@ -1403,6 +1424,11 @@
|
|
|
// })
|
|
|
// },
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ dataList:function (list) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|