Browse Source

完成事务

qinbai 4 years ago
parent
commit
f8854417f8

+ 4 - 1
src/api/workManagement/mainProject.js

@@ -42,13 +42,16 @@ export function deleteMain(id) {
   })
 }
 //核算/完工/结算
-export function updateItemStatus(id,status) {
+export function updateItemStatus(id,status,accountName,accountBank,accountNo) {
   return request({
     url: '/api/trade-project/project/updateItemStatus',
     method: 'POST',
     params:{
       id : id,
       status:status,
+      accountName:accountName,
+      accountBank:accountBank,
+      accountNo:accountNo,
     }
   })
 }

+ 1 - 1
src/views/exportTrade/purchaseContract/config/uploadList.json

@@ -45,7 +45,7 @@
       "label": "备注",
       "prop": "remarks",
       "index": 5,
-      "width":440,
+      "width":600,
       "rules": [
         {
           "required": false,

+ 5 - 1
src/views/workManagement/main-items/configuration/detailsPage.json

@@ -16,6 +16,10 @@
   "menuWidth": 220,
   "column": [
     {
+      "label": "状态",
+      "prop": "strStatus"
+    },
+    {
       "label": "服务项目",
       "prop": "pname",
       "width": 120
@@ -107,7 +111,7 @@
     },
     {
       "label": "需求完成日期",
-      "prop": "endTime",
+      "prop": "actualDate",
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "type": "date",

+ 3 - 15
src/views/workManagement/main-items/configuration/mainList.json

@@ -8,7 +8,7 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 24,
+  "searchMenuSpan": 6,
   "tree": true,
   "selection": true,
   "editBtn": false,
@@ -38,8 +38,8 @@
     },
     {
       "label": "客户名称",
-      "prop": "corpAttn",
-      "search": true,
+      "prop": "corpId",
+      "hide": true,
       "index": 4,
       "width": 120
     },
@@ -69,18 +69,6 @@
       "width": 150
     },
     {
-      "label": "状态",
-      "prop": "status",
-      "type": "select",
-      "dicUrl": "/api/blade-system/dict-biz/dictionary?code=affair_status",
-      "props": {
-        "label": "dictValue",
-        "value": "dictKey"
-      },
-      "index": 9,
-      "width": 120
-    },
-    {
       "label": "备注",
       "prop": "remark",
       "index": 10,

+ 108 - 62
src/views/workManagement/main-items/detailsPage.vue

@@ -17,7 +17,6 @@
       </div>
     </div>
     <div style="margin-top: 60px">
-      {{paymentTerm}}
       <containerTitle title="基础信息"></containerTitle>
       <basic-container>
         <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
@@ -26,12 +25,16 @@
               <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="form[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="form[item.prop]" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"/>
-                <el-select v-else-if="item.prop === 'paymentType'" style="width: 100%" size="small" placeholder="请选择" clearable filterable @change="selectBD">
+                <el-select v-else-if="item.prop === 'paymentType'" style="width: 100%" v-model="form[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>
                 <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
-                <el-input type="age" v-else v-model="form[item.prop]"  :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
-                  <template v-if="item.prop === 'debitAmount'|| item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'" slot="append">元</template>
+                <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
+                <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="form[item.prop]"  @change="debitChange"  :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
+                  <template   slot="append">元</template>
+                </el-input>
+                <el-input type="age" v-else v-model="form[item.prop]"  :disabled="item.disabled?true:false" size="small" value="0" autocomplete="off" placeholder="请输入">
+                  <template v-if="item.prop === 'debitAmount'|| item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'"  slot="append">元</template>
                 </el-input>
               </el-form-item>
             </el-col>
@@ -200,8 +203,9 @@
   import userOption from "./configuration/userList.json";
   import { getList } from "@/api/system/user";
   import { getDeptLazyTree} from "@/api/system/dept";
-  import type from "../service-items/type";
-  import data from "../../util/data";
+
+  //上传附件删除
+  import { corpsbank } from "@/api/basicData/configuration"
 
   export default {
     data() {
@@ -218,9 +222,10 @@
         //客户组件配置控制
         configuration:{
           multipleChoices:false,
-          multiple:true,
-          searchShow:true,
-          collapseTags:true,
+          multiple:false,
+          disabled:false,
+          searchShow:false,
+          collapseTags:false,
           placeholder:'请点击右边按钮选择',
           dicData:[]
         },
@@ -267,13 +272,18 @@
               ]
             }, {
               label: '客户名称',
-              prop: 'corpId'
+              prop: 'corpId',
             },{
               label: '合同金额',
               prop: 'debitAmount',
               rules: [
                 {
-                  pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
+                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                  message: ' ',
+                  trigger: 'blur'
+                },
+                {
+                  required: true,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -284,7 +294,7 @@
               prop: 'advanceAmount',
               rules: [
                 {
-                  pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
+                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -296,7 +306,7 @@
               disabled: true,
               rules: [
                 {
-                  pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
+                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -308,7 +318,7 @@
               disabled: true,
               rules: [
                 {
-                  pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
+                  pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -329,6 +339,8 @@
               label: '制单日期',
               prop: 'createTime',
               type: 'datetime',
+              valueFormat:"yyyy-MM-dd HH:mm:ss",
+              format:"yyyy-MM-dd",
               disabled: true
             },
             {
@@ -350,11 +362,15 @@
             {
               label: '开始日期',
               prop: 'beginTime',
+              valueFormat:"yyyy-MM-dd HH:mm:ss",
+              format:"yyyy-MM-dd",
               type:'datetime',
             },
             {
               label: '结束日期',
               prop: 'endTime',
+              valueFormat:"yyyy-MM-dd HH:mm:ss",
+              format:"yyyy-MM-dd",
               type:'datetime',
             },
             {
@@ -449,13 +465,17 @@
     created() {
       // 表格行编辑 输入框change事件
       //单价
-      this.optionTable.column[4].change = function (val) {
+      this.optionTable.column[5].change = function (val) {
         val.row.amount = val.row.quantity*val.value;
       }
       //数量
-      this.optionTable.column[6].change = function (val) {
+      this.optionTable.column[7].change = function (val) {
         val.row.amount = val.row.price*val.value;
       }
+      this.$set(this.form,"debitAmount",0)
+      this.$set(this.form,"advanceAmount",0)
+      this.$set(this.form,"settlmentAmount",0)
+      this.$set(this.form,"balanceAmount",0)
       this.id = BigInt(this.$route.query.id);//字符串转数字  超长用BigInt
       this.getProjectDetail();
       const params = {
@@ -474,8 +494,22 @@
         if(this.id){
           projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
             this.form = res.data.data;
+            this.upLoadData =res.data.data.filesList
             if(res.data.data.itemList){
               this.data = res.data.data.itemList;
+              let status = [];
+              this.data.forEach(item =>{
+                item.status == 0 ? status.push(true) : status.push(false)
+              })
+              //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
+              if(status.findIndex(item => item == false) == 0){
+                this.basicData.column.forEach(item =>{
+                  if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
+                    item.disabled = true
+                    this.configuration.disabled = true
+                  }
+                })
+              }
               if(pleaseCheck === 10086){
                 this.pleaseCheck();
               }
@@ -486,7 +520,9 @@
         }else{
           getSysNo().then(res =>{
             this.$set(this.form,"sysNo", res.data.data)
-            this.$set(this.form,"createTime", new Date())
+            let date = new Date();
+            let strDate = date.getFullYear() + "-" + date.getMonth() + 1 + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
+            this.$set(this.form,"createTime",strDate)
           });
           getUserInfo().then(res =>{
             this.$set(this.form,"createUserName", res.data.data.name)
@@ -501,17 +537,17 @@
           type: "warning"
         }).then(() => {
           this.data.splice(index,0)
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
           // 数据回调进行刷新
           done(row);
         });
       },
-      //slelect 强制赋值
-      selectBD(){
-        this.$forceUpdate();
+      // 合同金额
+      debitChange(val){
+        if(val){
+          if(!this.form.settlmentAmount){
+            this.$set(this.form,"balanceAmount",val)
+          }
+        }
       },
       //点击修改或保存时触发
       rowCellTwo(row,index){
@@ -550,17 +586,7 @@
           cancelButtonText: "取消",
           type: "warning"
         }).then(()=>{
-          this.$refs["form"].validate((valid) => {
-              if(valid){
-                this.$router.push({
-                  path: "/mainItems_detailsPage",
-                  query: {id: ''},
-                });
-                this.form = {}
-                this.data = []
-                this.id = ''
-              }
-            });
+          this.editMainProject(10010);
         })
       },
       //请核
@@ -568,14 +594,19 @@
         if(this.crudSelection.length!=0){
           let result = [];
           this.crudSelection.forEach(item=>{
-            //新录入状态下  才可提交审核
-            // if(item.status === 0){
-            //   result.push("true")
-            // }else{
-            //   result.push("false")
-            // }
-            this.editMainProject(10086);
+            // 新录入状态下  才可提交审核
+            item.status == 0 ? result.push(true) : result.push(false)
           })
+          //如果数组内有一个 为false  则为false
+          if(result.findIndex(item => item != true) == -1){
+            this.editMainProject(10086);
+          }else{
+            this.$message({
+              type: "error",
+              message: "请核数据中存在已请核数据!"
+            });
+            return;
+          }
         }else{
           this.$message({
             type: "error",
@@ -593,7 +624,7 @@
               });
               //刷新列表
               this.loading = true;
-              projectDetail(this.id,0).then(res =>{
+              projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
                 if(res.data.data.itemList){
                   this.data = res.data.data.itemList;
                 }else{
@@ -609,27 +640,40 @@
       editMainProject(pleaseCheck){
         this.$refs["form"].validate((valid) => {
           //校验明细列表
-          let user = true;
-          this.data.forEach((item,index) =>{
-            if(!item.userid && !item.deptid && user){
-              this.$message({
-                type: "warning",
-                message: "请检查明细列表第"+(index+1)+"行必填数据数据"
-              });
-              user = false;
-            }
-          })
-          if(valid && user){
+          let valids = true;
+          if(this.crudSelection.length != 0 ){
+            this.crudSelection.forEach((item) =>{
+              if((item.userid ==""  || !item.deptid) && valids){
+                this.$message({
+                  type: "warning",
+                  message: "请检查明细列表第 "+(item.$index +1 )+" 行必填项"
+                });
+                valids = false;
+              }
+            })
+          }
+          if(valid && valids){
             const params = {
               ...this.form,
               itemList:this.data,
+              filesList:this.upLoadData
             }
             editMianProject(params).then(res =>{
-              if(pleaseCheck !== 10086){
+              if(pleaseCheck !== 10086 && pleaseCheck !== 10010){
                 this.$message({
                   type: "success",
                   message: "操作成功!"
                 });
+                this.getProjectDetail()
+              }else if(pleaseCheck === 10010){  //新单
+                this.$router.push({
+                  path: "/mainItems_detailsPage",
+                  query: {id: ''},
+                });
+                this.form = {}
+                this.data = []
+                this.upLoadData = []
+                this.id = ''
               }else{
                 this.getProjectDetail(pleaseCheck);
               }
@@ -663,11 +707,13 @@
         }).then(() => {
           if (row.id){
             corpsbank(row.id).then(res=>{
-              this.$message({
-                type: "success",
-                message: "操作成功!"
-              });
-              this.bankOfDepositData.splice(index, 1);
+              if(res.data.success){
+                this.$message({
+                  type: "success",
+                  message: "操作成功!"
+                });
+                this.bankOfDepositData.splice(index, 1);
+              }
             })
           }else {
             this.$message({
@@ -705,6 +751,7 @@
         if(this.serviceSelectList.length != 0){
           this.serviceSelectList.forEach((item)=>{
             const params = {
+              strStatus:"录入",
               pname:item.cname,
               remarks:item.remarks,
               price:item.price,
@@ -756,8 +803,7 @@
       userConfirm(){
          if(this.userSelection){
            this.data[this.detailsSelect].userid = this.userSelection[0].id;
-           this.data[this.detailsSelect].userName = this.userSelection[0].realName;
-           // this.$set(this.data[this.detailsSelect],'userName',this.userSelection[0].realName)
+           this.$set(this.data[this.detailsSelect],'userName',this.userSelection[0].realName)
            this.userDialog = !this.userDialog
          }
       }

+ 5 - 3
src/views/workManagement/main-items/list.vue

@@ -41,6 +41,7 @@
           type="text"
           icon="el-icon-delete"
           size="small"
+          :disabled="!scope.row.allowDelete"
           @click.stop="rowDel(scope.row, scope.index)"
         >删除
         </el-button>
@@ -91,7 +92,8 @@ export default {
       this.switchDialog = val;
     },
     //flag:0 判断是主营项目还是结算
-    getList(page,params = { flag : 0 }) {
+    getList(page,params = {}) {
+      params.flag = 0;
       this.loading = true;
       getList(page.currentPage, page.pageSize,params).then(res =>{
         this.data = res.data.data.records
@@ -115,11 +117,10 @@ export default {
       });
     },
     searchChange(params, done) {
-      this.getList(this.page, params = { flag : 0 });
+      this.getList(this.page, params);
       done();
     },
     refreshChange(page,params) {
-      console.log(page,params)
       this.getList(page,params);
     },
     //删除列表后面的删除按钮触发触发(row, index, done)
@@ -137,6 +138,7 @@ export default {
             });
           })
           // 数据回调进行刷新
+          this.getList(this.page);
           done(row);
         });
       }else{

+ 4 - 11
src/views/workManagement/receipt/configuration/settleAccounts.json

@@ -8,7 +8,7 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 18,
+  "searchMenuSpan": 6,
   "tree": true,
   "selection": true,
   "editBtn": false,
@@ -39,7 +39,7 @@
     {
       "label": "客户名称",
       "prop": "corpId",
-      "search": true,
+      "hide": true,
       "index": 4,
       "width": 120
     },
@@ -69,21 +69,14 @@
       "width": 150
     },
     {
-      "label": "状态",
-      "prop": "status",
-      "index": 9,
-      "width": 120
-    },
-    {
       "label": "备注",
       "prop": "remark",
-      "search": true,
       "index": 10,
       "width": 150
     },
     {
       "label": "制单人",
-      "prop": "createUser",
+      "prop": "createUserName",
       "index": 11,
       "width": 120
     },
@@ -95,7 +88,7 @@
     },
     {
       "label": "最新修改人",
-      "prop": "updateUser",
+      "prop": "updateUserName",
       "index": 13,
       "width": 120
     },

+ 49 - 63
src/views/workManagement/receipt/configuration/settleAccountsDetailsPage.json

@@ -16,142 +16,128 @@
   "menuWidth": 220,
   "column": [
     {
+      "label": "状态",
+      "prop": "strStatus"
+    },
+    {
       "label": "服务项目",
-      "prop": "pName",
-      "index": 1,
+      "prop": "pname",
       "width": 120
     },
     {
       "label": "收费建议",
       "prop": "remarks",
-      "index": 2,
       "width": 150
     },
     {
+      "label": "承做人",
+      "prop": "userName",
+      "slot": true,
+      "width": 180
+    },
+    {
+      "label": "任务部门",
+      "prop": "deptid",
+      "type":"tree",
+      "dicUrl": "/api/blade-system/dept/tree?tenantId=",
+      "props": {
+        "label": "title",
+        "value": "value"
+      },
+      "cell": true,
+      "slot": true,
+      "width": 150,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
       "label": "单价",
       "prop": "price",
-      "index": 3,
-      "width": 120
+      "width": 120,
+      "cell": true
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "index": 4,
-      "width": 120
+      "width": 120,
+      "cell": true
     },
     {
       "label": "数量",
       "prop": "quantity",
-      "index": 5,
       "width": 120,
       "cell": true
     },
     {
       "label": "合计金额",
       "prop": "amount",
-      "index": 6,
       "width": 120,
       "cell": true
     },
     {
-      "label": "确认收费",
-      "prop": "receipt",
-      "index": 7,
-      "width": 100,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入确认收费",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
       "label": "频率",
       "prop": "frequency",
-      "index": 7,
+      "type": "select",
+      "dicUrl": "/api/blade-system/dict-biz/dictionary?code=frequency",
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      },
       "width": 120,
       "cell": true
     },
     {
       "label": "提醒日",
       "prop": "reminderDay",
-      "valueFormat": "timestamp",
+      "valueFormat": "yyyy-MM-dd HH:mm:ss",
+      "format": "yyyy-MM-dd",
       "type": "date",
-      "index": 9,
       "width": 150,
       "cell": true
     },
     {
-      "label": "任务部门",
-      "prop": "deptId",
-      "type":"tree",
-      "dicUrl": "/api/blade-system/dept/tree?tenantId=",
-      "props": {
-        "label": "title",
-        "value": "value"
-      },
-      "cell": true,
-      "slot": true,
-      "index": 11,
-      "width": 150
-    },
-    {
-      "label": "承做人",
-      "prop": "userId",
-      "slot": true,
-      "index": 12,
-      "width": 180
-    },
-    {
       "label": "需求开始日期",
       "prop": "beginTime",
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
+      "format": "yyyy-MM-dd",
       "type": "date",
-      "index": 13,
       "width": 150,
       "cell": true
     },
     {
       "label": "需求完成日期",
-      "prop": "endTime",
+      "prop": "actualDate",
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
+      "format": "yyyy-MM-dd",
       "type": "date",
-      "index": 14,
-      "width": 150,
-      "cell": true
-    },
-    {
-      "label": "备注",
-      "prop": "feeRemarks",
-      "index": 10,
       "width": 150,
       "cell": true
     },
     {
       "label": "制单人",
-      "prop": "createUser",
+      "prop": "createUserName",
       "disabled": true,
-      "index": 14,
       "width": 120
     },
     {
       "label": "制单日期",
-      "prop": "createUser",
+      "prop": "createTime",
       "disabled": true,
-      "index": 14,
       "width": 150
     },
     {
       "label": "最新修改人",
-      "prop": "updateUser",
-      "index": 14,
+      "prop": "updateUserName",
       "width": 120
     },
     {
       "label": "最新修改时间",
       "prop": "updateTime",
-      "index": 14,
       "width": 150
     }
   ]

+ 3 - 2
src/views/workManagement/receipt/settleAccounts.vue

@@ -26,12 +26,13 @@
         </el-button>
       </template>
       <template slot-scope="scope" slot="menu">
+
         <el-button
           type="text"
-          icon="el-icon-check"
+          icon="el-icon-edit"
           size="small"
           @click.stop="settleAccounts(scope.row, scope.index)"
-        >结 算
+        >编 辑
         </el-button>
       </template>
     </avue-crud>

+ 128 - 13
src/views/workManagement/receipt/settleAccountsDetailsPage.vue

@@ -14,9 +14,13 @@
           <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="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
-                <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择" clearable filterable></el-select>
-                <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
+                <el-date-picker v-if="item.type === 'datetime'" :disabled="item.disabled?true:false" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
+                <el-select v-else-if="item.prop === 'paymentType'" :disabled="item.disabled?true:false" style="width: 100%" v-model="form[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>
+                <selectComponent v-else-if="item.prop === 'corpId'" :disabled="item.disabled?true:false"  v-model="form[item.prop]" :configuration="configuration"/>
+                <el-input type="textarea" v-else-if="(item.prop === 'remark'||item.prop === 'settlementRemark')"v-model="form[item.prop]" :disabled="item.disabled && item.prop === 'remark'?true:false"  size="small" autocomplete="off" placeholder="请输入"></el-input>
+                <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -44,8 +48,22 @@
             >报表
             </el-button>
           </template>
-          <template slot-scope="scope" slot="receipt">
-            <el-button type="primary"  size="small" @click="closeAccount(scope.row,scope.index)">结 算</el-button>
+          <template slot-scope="scope" slot="menu">
+            <el-button
+              type="text"
+              icon="el-icon-check"
+              size="small"
+              @click.stop="beforeCloseAccount(scope.row,scope.index)"
+            >结 算
+            </el-button>
+            <el-button
+              type="text"
+              icon="el-icon-close"
+              size="small"
+              v-if="scope.row.status == 5"
+              @click.stop="callAccount(scope.row,scope.index)"
+            >取消结算
+            </el-button>
           </template>
         </avue-crud>
       </basic-container>
@@ -61,6 +79,31 @@
         ></avue-crud>
       </basic-container>
     </div>
+    <el-dialog
+      title="结算"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="accountDialog"
+      width="25%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false">
+      <el-form v-model="accountFormData">
+        <el-form-item label="账户名称:"  class="landConFrom-input" prop="accountName">
+          <el-input v-model="accountFormData.accountName" style="width: 200px;"></el-input>
+        </el-form-item>
+        <el-form-item label="开户银行:"  class="landConFrom-input" prop="accountBank">
+          <el-input v-model="accountFormData.accountBank"  style="width: 200px;"></el-input>
+        </el-form-item>
+        <el-form-item label="银行账号:"  class="landConFrom-input" prop="accountNo">
+          <el-input v-model="accountFormData.accountNo"  style="width: 200px;"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" style="display: flex; justify-content: center">
+          <el-button @click.stop="accountDialog = false , accountFormData = {}" size="small">取 消</el-button>
+          <el-button type="primary"  size="small" @click="closeAccount">结算</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -68,20 +111,40 @@
   import option from "./configuration/settleAccountsDetailsPage.json";
   import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json";
   import { projectDetail,updateItemStatus } from "@/api/workManagement/mainProject";
+  //业务字典
+  import { getDictionary } from "@/api/system/dictbiz";
 
   export default {
     name: "customerInformation",
     data() {
       return {
         loading:false,
+        accountDialog:false,
+        aaccount:{},
         form: {},
+        accountFormData:{
+          accountName:'',
+          accountBank:'',
+          accountNo:'',
+        },
         option: option,
         parentId:0,
+        account:{},
+        paymentTerm:[],
         page: {
           pageSize: 10,
           pagerCount: 5,
           total: 0,
         },
+        configuration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:true,
+          searchShow:false,
+          collapseTags:false,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
         query:{},
         //顶部from数据
         basicData: {
@@ -89,6 +152,7 @@
             {
               label: '系统编号',
               prop: 'sysNo',
+              disabled: true,
               rules: [
                 {
                   required: true,
@@ -99,6 +163,7 @@
             }, {
               label: '项目编码',
               prop: 'code',
+              disabled: true,
               rules: [
                 {
                   required: true,
@@ -109,6 +174,7 @@
             }, {
               label: '项目名称',
               prop: 'cname',
+              disabled: true,
               rules: [
                 {
                   required: true,
@@ -118,10 +184,12 @@
               ]
             }, {
               label: '客户名称',
-              prop: 'corpId'
+              prop: 'corpId',
+              disabled: true,
             },{
               label: '合同金额',
               prop: 'debitAmount',
+              disabled: true,
               rules: [
                 {
                   pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
@@ -133,6 +201,7 @@
             {
               label: '首付金额',
               prop: 'advanceAmount',
+              disabled: true,
               rules: [
                 {
                   pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
@@ -144,6 +213,7 @@
             {
               label: '未收金额',
               prop: 'balanceAmount',
+              disabled: true,
               rules: [
                 {
                   pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
@@ -155,6 +225,7 @@
             {
               label: '已收金额',
               prop: 'settlmentAmount',
+              disabled: true,
               rules: [
                 {
                   pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
@@ -166,9 +237,11 @@
             {
               label: '责任人',
               prop: 'corpAttn',
+              disabled: true
             }, {
               label: '承揽人',
               prop: 'salesName',
+              disabled: true
             },
             {
               label: '制单人',
@@ -183,6 +256,7 @@
             {
               label: '电话',
               prop: 'corpTel',
+              disabled: true,
             },
             {
               label: '收款方式',
@@ -190,6 +264,7 @@
               type:'select',
               dataType: "number",
               width: 120,
+              disabled: true,
               dicUrl: "/api/blade-system/dict-biz/dictionary?code=affair_payment_term",
               props: {
                 label: "dictValue",
@@ -198,19 +273,28 @@
             },
             {
               label: '开始日期',
+              disabled: true,
               prop: 'beginTime',
               type:'datetime',
             },
             {
               label: '结束日期',
+              disabled: true,
               prop: 'endTime',
               type:'datetime',
             },
             {
               label: '备注',
               span: 24,
-              prop: 'remark'
-            }
+              prop: 'remark',
+              disabled: true,
+            },
+            {
+              label: '结算备注',
+              span: 24,
+              prop: 'settlementRemark',
+              disabled: true,
+            },
           ],
         },
         //列表假数据
@@ -228,7 +312,7 @@
         code : "affair_payment_term"
       }
       getDictionary(params).then(res =>{
-        // this.paymentTerm = res.data.data;
+        this.paymentTerm = res.data.data;
       })
     },
     mounted() {
@@ -237,7 +321,7 @@
     methods: {
       getProjectDetail(){
         if(this.id){
-          projectDetail(this.id,2).then(res =>{
+          projectDetail(this.id,"4,5").then(res =>{
             this.form = res.data.data;
             if(res.data.data.itemList){
               this.loading = true;
@@ -248,13 +332,40 @@
         }
       },
       //结算
-      closeAccount(row,index){
-        this.$confirm("确认结算次明细?", {
+      beforeCloseAccount(row){
+        this.aaccount = row;
+        this.accountDialog = true;
+      },
+      closeAccount(){
+        this.$confirm("确认结算此明细?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          updateItemStatus(this.aaccount.id,5,
+            this.accountFormData.accountName,
+            this.accountFormData.accountBank,
+            this.accountFormData.accountNo,).then(res =>{
+            if(res.data.success){
+              this.$message({
+                type: "success",
+                message: "操作成功!"
+              });
+              this.accountFormData = {},
+              this.accountDialog = false;
+              this.getProjectDetail();
+            }
+          })
+        });
+      },
+      //结算
+      callAccount(row,index){
+        this.$confirm("确认取消结算此明细?", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
-          updateItemStatus(row.id,3).then(res =>{
+          updateItemStatus(row.id,6).then(res =>{
             if(res.data.success){
               this.$message({
                 type: "success",
@@ -346,4 +457,8 @@
   ::v-deep .el-form-item {
     margin-bottom: 0;
   }
+  .landConFrom-input{
+    display:flex;
+    justify-content:center;
+  }
 </style>

+ 31 - 31
src/views/workManagement/task/configuration/mainList.json

@@ -7,7 +7,7 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 12,
+  "searchMenuSpan": 24,
   "tree": true,
   "selection": true,
   "addBtn": false,
@@ -15,66 +15,72 @@
   "editBtn": false,
   "delBtn": false,
   "menuWidth": 150,
+  "searchLabelWidth": 130,
   "column": [
     {
+      "label": "状态",
+      "hide": true,
+      "prop": "status",
+      "width": 120,
+      "type": "select",
+      "dicUrl": "/api/blade-system/dict-biz/dictionary?code=affair_status",
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      }
+    },
+    {
+      "label": "状态",
+      "prop": "strStatus",
+      "width": 120
+    },
+    {
       "label": "服务项目",
       "prop": "pname",
       "search": true,
-      "index": 1,
       "width": 120
     },
     {
       "label": "收费建议",
       "prop": "remarks",
-      "index": 2,
       "width": 150
     },
     {
       "label": "单价",
       "prop": "price",
-      "index": 3,
       "width": 120
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "index": 4,
       "width": 120
     },
     {
       "label": "数量",
       "prop": "quantity",
-      "index": 5,
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "合计金额",
       "prop": "amount",
-      "index": 6,
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "频率",
       "prop": "frequency",
-      "index": 7,
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "提醒日",
       "prop": "reminderDay",
-      "search": true,
       "valueFormat": "timestamp",
       "type": "date",
-      "index": 9,
-      "width": 150,
-      "cell": true
+      "width": 150
     },
     {
       "label": "任务部门",
       "prop": "deptid",
+      "search": true,
       "type":"tree",
       "dicUrl": "/api/blade-system/dept/tree?tenantId=",
       "props": {
@@ -83,14 +89,12 @@
       },
       "cell": true,
       "slot": true,
-      "index": 11,
       "width": 150
     },
     {
       "label": "承做人",
-      "prop": "userid",
+      "prop": "userName",
       "slot": true,
-      "index": 12,
       "width": 180
     },
     {
@@ -98,43 +102,39 @@
       "prop": "beginTime",
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "type": "date",
-      "index": 13,
+      "search": true,
       "width": 150,
       "cell": true
     },
     {
       "label": "需求完成日期",
-      "prop": "endTime",
+      "prop": "actualDate",
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "type": "date",
-      "index": 14,
+      "search": true,
       "width": 150,
       "cell": true
     },
     {
       "label": "制单人",
-      "prop": "createUser",
+      "prop": "createUserName",
       "disabled": true,
-      "index": 14,
       "width": 120
     },
     {
       "label": "制单日期",
-      "prop": "createUser",
+      "prop": "createTime",
       "disabled": true,
-      "index": 14,
       "width": 150
     },
     {
       "label": "最新修改人",
-      "prop": "updateUser",
-      "index": 14,
+      "prop": "updateUserName",
       "width": 120
     },
     {
       "label": "最新修改时间",
       "prop": "updateTime",
-      "index": 14,
       "width": 150
     }
   ]

+ 6 - 3
src/views/workManagement/task/index.vue

@@ -33,6 +33,7 @@
         <el-button
           type="text"
           icon="el-icon-edit"
+          :disabled="scope.row.status != 1"
           size="small"
           @click.stop="completion(scope.row)"
         >完工
@@ -77,7 +78,7 @@
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
-          updateItemStatus(row.id,2).then(res =>{
+          updateItemStatus(row.id,4).then(res =>{
             if(res.data.success){
               this.$message({
                 type: "success",
@@ -92,7 +93,6 @@
       searchChange(params, done) {
         this.query = params;
         this.page.currentPage = 1;
-        params.status = 1
         this.onLoad(this.page, params);
         done()
       },
@@ -111,7 +111,10 @@
       refreshChange() {
         console.log('1')
       },
-      onLoad(page, params = {status:1}) {
+      onLoad(page, params = {}) {
+        if(!params.status){
+          params.status = "1,4,5";
+        }
         this.loading = true
         getFlowList(page.currentPage, page.pageSize,params).then(res =>{
           this.dataList = res.data.data.records