Browse Source

调整协议管理bug

阿伏兔 4 years ago
parent
commit
cb5e1aaa00

+ 0 - 8
src/api/warehouseBusiness/agreement.js

@@ -52,14 +52,6 @@ export function addAgreement(data) {
 }
 
 // 修改仓储费
-export function updateAgreement(data) {
-  return request({
-    url: '/warehouseBusiness/agreementStorage',
-    method: 'put',
-    data: data
-  })
-}
-// 修改仓储费
 export function updateAgreement_s(fId, fStatus) {
   return request({
     url: '/warehouseBusiness/agreementStorage',

+ 143 - 261
src/views/agreement/agreementTask/index.vue

@@ -135,7 +135,6 @@
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-
     <el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="客户名称" align="center" prop="fCorpid" show-overflow-tooltip/>
@@ -205,7 +204,7 @@
             type="text"
             icon="el-icon-delete"
             @click="speed(scope.row,1)"
-            v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
+            v-if="scope.row.fBillstatus === '4' || scope.row.fBillstatus === '5'"
             v-hasPermi="['agreement:agreementTask:remove']"
           >审批进度
           </el-button>
@@ -220,7 +219,6 @@
       <!--      <el-table-column label="免堆天数" align="center" prop="fFreedays" />-->
       <!--      <el-table-column label="备注" align="center" prop="remark" />-->
     </el-table>
-
     <pagination
       v-show="total>0"
       :total="total"
@@ -228,19 +226,17 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-
     <!-- 添加或修改作业费对话框 -->
     <el-dialog :title="title" :visible.sync="open" :show-close="Xbutton" width="65%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px"
-               style="display: flex;flex-wrap: wrap;"
-      >
+               style="display: flex;flex-wrap: wrap;">
         <el-form-item label="客户名称" prop="fCorpid">
           <el-select
             v-model="form.fCorpid"
             filterable
             remote
             clearable
-            :disabled="prohibit"
+            :disabled="browseStatus"
             style="width: 200px"
             @keyup.enter.native="handleQuery"
             :remote-method="corpsRemoteMethod"
@@ -254,7 +250,6 @@
             ></el-option>
           </el-select>
         </el-form-item>
-
         <el-form-item label="制单部门">
           <el-input v-model="deptName" :disabled="true" placeholder="请输入制单部门" style="width: 200px"/>
         </el-form-item>
@@ -262,8 +257,8 @@
           <el-date-picker clearable size="small" style="width: 200px"
                           v-model="form.fBegindate"
                           type="date"
-                          :disabled="prohibit"
-                          value-format="yyyy-MM-dd"
+                          :disabled="browseStatus"
+                          value-format="timestamp"
                           placeholder="选择有效期起"
           >
           </el-date-picker>
@@ -272,18 +267,17 @@
           <el-date-picker clearable size="small" style="width: 200px"
                           v-model="form.fEnddate"
                           type="date"
-                          :disabled="prohibit"
-                          value-format="yyyy-MM-dd"
+                          :disabled="browseStatus"
+                          value-format="timestamp"
                           placeholder="选择有效期至"
           >
           </el-date-picker>
         </el-form-item>
         <el-form-item label="协议编号" prop="fContractno">
-          <el-input v-model="form.fContractno" placeholder="请输入协议编号" :disabled="prohibit" style="width: 200px"/>
+          <el-input v-model="form.fContractno" placeholder="请输入协议编号" :disabled="browseStatus" style="width: 200px"/>
         </el-form-item>
-
         <el-form-item label="商品类别" prop="tPackages">
-          <el-select v-model="form.tPackages" placeholder="请选择商品类别" :disabled="prohibit">
+          <el-select v-model="form.tPackages" placeholder="请选择商品类别" :disabled="browseStatus">
             <el-option
               v-for="dict in fTypeidOptions"
               :key="dict.dictValue"
@@ -295,16 +289,14 @@
         </el-form-item>
       </el-form>
       <el-button @click="confirmCharge" :disabled="stop" v-if="form.fBillstatus < 4" type="primary">请 核</el-button>
-      <el-button @click="revokeCharge" v-if="form.fBillstatus == 6" type="danger">撤销请核</el-button>
-      <el-button @click="revocationApproval" :disabled="tablefilter" v-if="form.fBillstatus == 4 && Operator == Lander" type="danger">撤销审批</el-button>
+      <el-button @click="revokeCharge" v-if="form.fBillstatus === '6'" type="danger">撤销请核</el-button>
+      <el-button @click="revocationApproval" :disabled="tablefilter" v-if="form.fBillstatus === '4' && operator === lander" type="danger">撤销审批</el-button>
       <div class="dialogTableTitle flex a-center jlr">
         <h2>作业费明细</h2>
-        <el-button @click="getList_s" :disabled="prohibit">新增</el-button>
+        <el-button @click="getList_s" :disabled="browseStatus">新增</el-button>
       </div>
-      <el-table v-loading="loading_s" :data="agreementitemsList" @selection-change="handleSelectionChange">
-        <!--        <el-table-column type="selection" width="55" align="center"/>-->
+      <el-table v-loading="loading_s" :data="agreementitemsList">
         <el-table-column label="行号" align="center" type="index"/>
-
         <el-table-column
           prop="fFeeid"
           header-align="center"
@@ -361,7 +353,7 @@
             v-model="scope.row.fPrice"
             placeholder="请输入单价"
             oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-            :disabled="prohibit"
+            :disabled="browseStatus"
             clearable
             size="small"
           />
@@ -386,15 +378,13 @@
             size="small"
           />
         </el-table-column>
-
-
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button
               size="mini"
               type="text"
               icon="el-icon-delete"
-              :disabled="prohibit"
+              :disabled="browseStatus"
               @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
             >删除
             </el-button>
@@ -404,7 +394,7 @@
       <div slot="footer" class="dialog-footer">
         <el-button v-if="approvalProhibit" @click="immediateApproval">审批</el-button>
         <el-button v-if="form.fBillstatus > 2" @click="viewAudit">查看审批</el-button>
-        <el-button type="primary" @click="submitForm" :disabled="determine">保 存</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="determine || browseStatus">保 存</el-button>
         <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
         <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
         <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@@ -415,27 +405,26 @@
 </template>
 
 <script>
-import moment from 'moment'
-import {
-  listAgreement,
-  getAgreement,
-  delAgreement,
-  addAgreement,
-  updateAgreement,
-  exportAgreement,
-  listAgreementitems,
-  queryUserVal,
-  updateAgreements,
-  collecTask,
-  backCharge,
-  revocation
-} from '@/api/agreement/agreement'
-import { listCorps } from '@/api/basicdata/corps'
-import { listGoods } from '@/api/basicdata/goods'
-import { listFees } from '@/api/basicdata/fees'
-import AddOrUpdate from '@/views/viewApproval'
-import ApprovalComments from '@/views/startApproval'
-import Global from "@/layout/components/global.js";
+  import moment from 'moment'
+  import {
+    listAgreement,
+    getAgreement,
+    delAgreement,
+    addAgreement,
+    exportAgreement,
+    listAgreementitems,
+    queryUserVal,
+    updateAgreements,
+    collecTask,
+    backCharge,
+    revocation
+  } from '@/api/agreement/agreement'
+  import { listCorps } from '@/api/basicdata/corps'
+  import { listGoods } from '@/api/basicdata/goods'
+  import { listFees } from '@/api/basicdata/fees'
+  import AddOrUpdate from '@/views/viewApproval'
+  import ApprovalComments from '@/views/startApproval'
+  import Global from '@/layout/components/global.js'
 
 export default {
   name: 'Agreement',
@@ -446,8 +435,8 @@ export default {
   data() {
     return {
       stop:false,
-      Lander:'',
-      Operator:'',
+      lander:'',
+      operator:'',
       dataList: '',
       // 遮罩层
       loading: true,
@@ -455,9 +444,8 @@ export default {
       cancelButton:true,
       approvalProhibit:false,
       loading_s: false,
-      browseStatus: false,
       Xbutton:true,
-      prohibit:false,
+      browseStatus:false,
       addOrUpdateVisible:false,
       addOrUpdateVisib:false,
       tablefilter:false,
@@ -558,9 +546,6 @@ export default {
     this.getDicts("data_goods_category").then(response => {
       this.fTypeidOptions = response.data;
     });
-    // this.getDicts("data_unitfees").then(response => {
-    //   this.jFeetunitOptions = response.data;
-    // });
     this.register()
   },
   activated(){
@@ -570,12 +555,11 @@ export default {
     // 默认录入人
     register() {
       queryUserVal().then((response)=>{
-        this.Lander = response.user.userName
+        this.lander = response.user.userName
       })
     },
     immediateApproval(){
       this.addOrUpdateVisib = true
-      console.log(this.approval)
       this.$nextTick(() => {
         this.$refs.ApprovalComments.init(this.approval.billId,320)
       })
@@ -586,12 +570,11 @@ export default {
       if (this.approval){
         this.cancelButton = false
         this.determine = true
-        this.prohibit = true
-        this.browseStatus = true
         this.Xbutton = false
+        this.tablefilter = true
+        this.browseStatus = true
         this.approval = JSON.parse(this.approval)
         this.approvalProhibit = true
-        this.reset()
         this.pass = {
           fAmtdr: '',    //应收合计
           fAmtcr: '',    //应付合计
@@ -601,17 +584,16 @@ export default {
           fCorpid: ''     //结算单位ID
         }
         getAgreement(this.approval.billId).then(response => {
-          console.log(this.deptName)
-          console.log(response)
           this.deptName = response.data.dept.deptName
           this.form = response.data.tWarehouseAgreement
+          this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
+          this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
           this.fMblnoOptions = response.data.corps
           this.agreementitemsList = response.data.tWarehouseAgreementitems
           for (let item in this.agreementitemsList) {
             this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
           }
           this.fWbuOptions = response.data.feesList
-          console.log(JSON.stringify(this.agreementitemsList))
           this.open = true
           this.title = '修改作业费'
         })
@@ -620,8 +602,6 @@ export default {
     viewAudit(){
       this.addOrUpdateVisible = true
       this.addOrUpdateVisib = false
-
-      console.log(this.form)
       let id = '448'
       let actId = '110'
       this.$nextTick(() => {
@@ -648,156 +628,87 @@ export default {
         query: Object,
         title: "作业费协议",
       }
-      this.$router.push({ path: '/index'})
+      this.$router.push({ path: '/index' })
       this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
         if (this.isActive(view)) {
           this.toLastView(visitedViews, view)
         }
       })
-      Global.$emit("removeCache", "closeSelectedTag", view);
-    },
-    test_s(){
-      console.log(this.agreementitemsList)
+      Global.$emit('removeCache', 'closeSelectedTag', view)
     },
     /** 创建仓储费明细表列表 */
     getList_s() {
-      console.log(this.agreementitemsList)
       queryUserVal().then((response) => {
         this.agreementitemsList.push({
           //行号
-          fLineno:'',
+          fLineno: '',
           //计价单位
-          fFeeunitid:'',
+          fFeeunitid: '',
           //费用名称
-          fFeeid:'',
+          fFeeid: '',
           //开始天数
-          fFromdays:'',
+          fFromdays: '',
           //结束天数
-          fEndays:'',
+          fEndays: '',
           //单价
           fPrice: '',
           //录入人
-          createBy:response.user.userName,
+          createBy: response.user.userName,
           //创建时间
-          createTime:moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss")
+          createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
         })
-        // this.$set("deptName", response.dept.deptName);
         this.deptName = response.dept.deptName
         this.form.fDeptid = response.dept.deptId
         this.agreementitemsList.createBy = response.user.userName
-
-        // this.$set(this.agreementitemsList, "createBy", response.user.userName);
-        //格式化时间戳
-        // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
-      });
-      listAgreementitems(this.queryParams).then(response => {
-        console.log(response)
       })
     },
-      speed_s(row,res) {
-        this.stop = true
-        this.tablefilter = true
-        if (res == 1) {
-          this.determine = true
-          this.prohibit = true
-          this.browseStatus = true
-          this.approvalProhibit = false
-          this.reset()
-          const fId = row.fId || this.ids
-          getAgreement(fId).then(response => {
-            console.log(response.data.corps[0].createBy)
-            this.Operator = response.data.corps[0].createBy
-            console.log(this.deptName)
-            console.log(response)
-            this.deptName = response.data.dept.deptName
-            this.form = response.data.tWarehouseAgreement
-            this.fMblnoOptions = response.data.corps
-            this.agreementitemsList = response.data.tWarehouseAgreementitems
-            for (let item in this.agreementitemsList) {
-              this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
-            }
-            this.fWbuOptions = response.data.feesList
-            console.log(JSON.stringify(this.agreementitemsList))
-
-            this.open = true
-            this.title = '查看作业费'
-          })
-        } else {
-          this.prohibit = true
-          this.determine = true
-          this.browseStatus = true
-          this.approvalProhibit = false
-          this.reset()
-          const fId = row.fId || this.ids
-          getAgreement(fId).then(response => {
-            console.log(this.deptName)
-            console.log(response)
-            this.deptName = response.data.dept.deptName
-            this.form = response.data.tWarehouseAgreement
-            this.fMblnoOptions = response.data.corps
-            this.agreementitemsList = response.data.tWarehouseAgreementitems
-            for (let item in this.agreementitemsList) {
-              this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
-            }
-            this.fWbuOptions = response.data.feesList
-            console.log(JSON.stringify(this.agreementitemsList))
-
-            this.open = true
-            this.title = '查看作业费'
-          })
+    speed_s(row, res) {
+      this.stop = true
+      this.determine = true
+      this.tablefilter = true
+      this.browseStatus = true
+      this.approvalProhibit = false
+      const fId = row.fId || this.ids
+      getAgreement(fId).then(response => {
+        this.deptName = response.data.dept.deptName
+        this.form = response.data.tWarehouseAgreement
+        this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
+        this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
+        this.operator = this.form.createBy
+        this.fMblnoOptions = response.data.corps
+        this.agreementitemsList = response.data.tWarehouseAgreementitems
+        for (let item in this.agreementitemsList) {
+          this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
         }
-      },
-    speed(row,res){
-      if(res == 1){
+        this.fWbuOptions = response.data.feesList
+        this.open = true
+        this.title = '查看作业费'
+      })
+    },
+    speed(row, res) {
+      this.register()
+      if (res === 1) {
         this.tablefilter = false
-        this.determine = true
-        this.prohibit = true
-        this.browseStatus = true
-        this.approvalProhibit = false
-        this.reset()
-        const fId = row.fId || this.ids
-        getAgreement(fId).then(response => {
-          console.log(response.data.corps[0].createBy)
-          this.Operator = response.data.corps[0].createBy
-          console.log(this.deptName)
-          console.log(response)
-          this.deptName = response.data.dept.deptName
-          this.form = response.data.tWarehouseAgreement
-          this.fMblnoOptions = response.data.corps
-          this.agreementitemsList = response.data.tWarehouseAgreementitems
-          for (let item in this.agreementitemsList) {
-            this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
-          }
-          this.fWbuOptions = response.data.feesList
-          console.log(JSON.stringify(this.agreementitemsList))
-
-          this.open = true
-          this.title = '查看作业费'
-        })
-      }else {
-        this.prohibit = true
-        this.determine = true
-        this.browseStatus = true
-        this.approvalProhibit = false
-        this.reset()
-        const fId = row.fId || this.ids
-        getAgreement(fId).then(response => {
-          console.log(this.deptName)
-          console.log(response)
-          this.deptName = response.data.dept.deptName
-          this.form = response.data.tWarehouseAgreement
-          this.fMblnoOptions = response.data.corps
-          this.agreementitemsList = response.data.tWarehouseAgreementitems
-          for (let item in this.agreementitemsList) {
-            this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
-          }
-          this.fWbuOptions = response.data.feesList
-          console.log(JSON.stringify(this.agreementitemsList))
-
-          this.open = true
-          this.title = '查看作业费'
-        })
       }
+      this.determine = true
+      this.browseStatus = true
+      this.approvalProhibit = false
+      const fId = row.fId || this.ids
+      getAgreement(fId).then(response => {
+        this.fMblnoOptions = response.data.corps
+        this.deptName = response.data.dept.deptName
+        this.form = response.data.tWarehouseAgreement
+        this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
+        this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
+        this.operator = this.form.createBy
+        this.agreementitemsList = response.data.tWarehouseAgreementitems
+        for (let item in this.agreementitemsList) {
+          this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
+        }
+        this.fWbuOptions = response.data.feesList
+        this.open = true
+        this.title = '查看作业费'
+      })
     },
     revocationApproval(){
       let  data = {
@@ -805,9 +716,7 @@ export default {
         actId: 320,
         billId:this.form.fId
       }
-      console.log(this.form)
       revocation(data).then(data =>{
-        console.log(data)
         if (data.code === 200){
           this.$message.success('撤销成功');
           this.open = false
@@ -817,32 +726,37 @@ export default {
     },
     // 请核
     confirmCharge() {
-      console.log(this.agreementitemsList)
-      if(this.agreementitemsList.length !== 0){
-        this.$refs['form'].validate(valid => {
-          if (valid) {
-            let formData = new window.FormData();
-            // 附件数据
-            // this.form.fBillstatus = 4
-            formData.append("agreement",JSON.stringify(this.form))
-            formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
-
-            // updateAgreement(this.form).then(response => {
-              collecTask(formData).then(response => {
-                this.msgSuccess('请核成功')
-                this.open = false
-                this.getList()
-                this.agreementitemsList = []
-              })
-            // })
-            // if (this.form.fId != null) {
-            //
-            // }
-          }
-        })
-      }else {
-        this.$message.error('作业费明细为空无法操作');
+      if (this.agreementitemsList.length <= 0) {
+        this.$message.error('作业费明细为空无法操作')
+        return false
+      }
+      for (let agr = 0; agr < this.agreementitemsList.length; agr ++) {
+        if (!this.agreementitemsList[agr].fFeeid) {
+          this.$message.error('请维护费用名称')
+          return false
+        }
+        if (!this.agreementitemsList[agr].fFeeunitid) {
+          this.$message.error('请维计价单位')
+          return false
+        }
+        if (!this.agreementitemsList[agr].fPrice) {
+          this.$message.error('请维单价')
+          return false
+        }
       }
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          let formData = new window.FormData()
+          formData.append('agreement', JSON.stringify(this.form))
+          formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
+          collecTask(formData).then(response => {
+            this.msgSuccess('请核成功')
+            this.open = false
+            this.agreementitemsList = []
+            this.getList()
+          })
+        }
+      })
     },
     // 撤销作业费
     revokeCharge(){
@@ -851,7 +765,6 @@ export default {
       formDate.append('agreement', JSON.stringify(this.form))
       formDate.append('agreementitems', JSON.stringify(this.agreementitemsList))
       backCharge(formDate).then(response => {
-        console.log(response)
         this.open = false
         this.msgSuccess('操作成功')
         this.getList()
@@ -875,7 +788,6 @@ export default {
     getList() {
       this.loading = true
       listAgreement(this.queryParams).then(response => {
-        console.log(response)
         this.agreementList = response.rows
         this.total = response.total
         this.loading = false
@@ -897,10 +809,12 @@ export default {
     // 取消按钮
     cancel() {
       this.reset()
+      this.getList()
       this.open = false
     },
     handleClose(){
       this.reset()
+      this.getList()
       this.open = false
     },
     // 表单重置
@@ -939,8 +853,6 @@ export default {
     },
     // 变更计价单位
     changeFeeUnit(row) {
-      console.log(this.fCntqty);
-      console.log(row);
       if (!row.fFeeUnitid) {
         return false;
       }
@@ -950,11 +862,7 @@ export default {
         this.$set(row, "fQty", this.fGrossweight);
       }
       if (row.fUnitprice) {
-        this.$set(
-          row,
-          "fAmount",
-          parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
-        );
+        this.$set(row, "fAmount", parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2));
       }
     },
     /** 重置按钮操作 */
@@ -977,9 +885,6 @@ export default {
       let queryParams = { pageNum: 1, pageSize: 10, fName: name };
       listFees(queryParams).then((response) => {
         this.fWbuOptions = response.rows
-
-        // let fWbuOptions = this.fWbuOptions.concat(response.rows)
-        // this.fWbuOptions = Array.from(new Set(fWbuOptions))
       });
     },
     // 作业费状态修改
@@ -1006,46 +911,36 @@ export default {
     handleAdd() {
       this.stop = false
       this.determine = false
-      this.prohibit = false
       this.browseStatus = false
       this.reset()
       this.open = true
       this.title = '添加作业费'
       queryUserVal().then((response) => {
-        // this.$set("deptName", response.dept.deptName);
         this.deptName = response.dept.deptName
         this.form.fDeptid = response.dept.deptId
-        // this.agreementitemsList.createBy = response.user.userName
-
-        // this.$set(this.agreementitemsList, "createBy", response.user.userName);
-        //格式化时间戳
-        // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
       });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.stop = false
-      this.prohibit = false
       this.browseStatus = false
       this.determine = false
       this.reset()
       this.cancelButton = true
       const fId = row.fId || this.ids
       getAgreement(fId).then(response => {
-        console.log(response.data.corps[0].createBy)
-        this.Operator = response.data.corps[0].createBy
-        console.log(this.deptName)
-        console.log(response)
+        this.register()
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
+        this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
+        this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
+        this.operator = this.form.createBy
         this.fMblnoOptions = response.data.corps
         this.agreementitemsList = response.data.tWarehouseAgreementitems
         for (let item in this.agreementitemsList) {
           this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
         }
         this.fWbuOptions = response.data.feesList
-        console.log(JSON.stringify(this.agreementitemsList))
-
         this.open = true
         this.title = '修改作业费'
       })
@@ -1065,33 +960,20 @@ export default {
     submitForm() {
       this.$refs['form'].validate(valid => {
         if (valid) {
-          if (this.form.fId != null) {
-            updateAgreement(this.form).then(response => {
-              let formData = new window.FormData();
-              // 附件数据
-              formData.append("agreement",JSON.stringify(this.form))
-              formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
-              addAgreement(formData).then(response => {
-                this.msgSuccess('修改成功')
-                this.getList()
-              })
-            })
-          } else {
-            let formData = new window.FormData();
-            formData.append("agreement",JSON.stringify(this.form))
-            formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
-            addAgreement(formData).then(response => {
-              this.msgSuccess('保存成功')
-              this.form.fId  = response.data.tWarehouseAgreement.fId;
-              this.getList()
-            })
-          }
+          let formData = new window.FormData()
+          formData.append('agreement', JSON.stringify(this.form))
+          formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
+          addAgreement(formData).then(response => {
+            this.msgSuccess('操作成功')
+            this.form = response.data.tWarehouseAgreement
+            this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
+            this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
+          })
         }
       })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      console.log(row)
       const fIds = row.fId || this.ids;
       this.$confirm('是否确认删除作业费编号为"' + fIds + '"的数据项?', "警告", {
         confirmButtonText: "确定",

+ 0 - 3
src/views/index.vue

@@ -137,9 +137,6 @@
     <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
   </span>
     </el-dialog>
-    <!-- 弹窗, 新增 / 修改 -->
-    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
-    <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
   </div>
 </template>
 

+ 16 - 16
src/views/warehouseBusiness/goodsTransfer/index.vue

@@ -1934,34 +1934,34 @@
           for (let whgen in this.dialogWhgenlegList) {
             this.dataList.push({
               fId: null,
+              fQty: 0,
+              fCntqty: 1,
+              remark: null,
+              fGoodsval: 0,
+              fNetweight: 0,
+              fBillstatus: 1,
+              fGrossweight: 0,
               fMblno: this.dialogWhgenlegList[whgen].fMblno,
+              fMarks: this.dialogWhgenlegList[whgen].fMarks,
+              fPlanqty: this.dialogWhgenlegList[whgen].fQtyblc,
               fGoodsid: this.dialogWhgenlegList[whgen].fGoodsid,
+              fVolumn: this.dialogWhgenlegList[whgen].fVolumnblc,
               fGoodsids: this.dialogWhgenlegList[whgen].fGoodsids,
-              fMarks: this.dialogWhgenlegList[whgen].fMarks,
               fBillingway: this.dialogWhgenlegList[whgen].fBillingway,
               fWarehouseids: this.dialogWhgenlegList[whgen].fWarehouseids,
-              fOriginalbillno: this.dialogWhgenlegList[whgen].fOriginalbillno,
-              fOriginalbilldate: this.dialogWhgenlegList[whgen].fOriginalbilldate,
-              fWarehouselocid: this.dialogWhgenlegList[whgen].fWarehouseLocationid,
-              fWarehouselocids: this.dialogWhgenlegList[whgen].fWarehouseLocationids,
               fPackagespecs: this.dialogWhgenlegList[whgen].fPackagespecs,
-              fPlanqty: this.dialogWhgenlegList[whgen].fQtyblc,
-              fVolumn: this.dialogWhgenlegList[whgen].fVolumnblc,
               fPlannetweight: this.dialogWhgenlegList[whgen].fNetweightblc,
+              fOriginalbillno: this.dialogWhgenlegList[whgen].fOriginalbillno,
               fPlangrossweight: this.dialogWhgenlegList[whgen].fGrossweightblc,
-              fQty: 0,
-              fCntqty: 1,
-              remark: null,
-              fGoodsval: 0,
-              fNetweight: 0,
-              fBillstatus: 1,
-              fGrossweight: 0
+              fOriginalbilldate: this.dialogWhgenlegList[whgen].fOriginalbilldate,
+              fWarehouselocid: this.dialogWhgenlegList[whgen].fWarehouseLocationid,
+              fWarehouselocids: this.dialogWhgenlegList[whgen].fWarehouseLocationids
             })
           }
-        }, 100);
+        }, 100)
         setTimeout(() => {
           this.updateDeduplication()
-        }, 300);
+        }, 300)
         this.whgenlegVisible = false
       },
       // 更新主表品牌、品名并去重