Browse Source

修改 入库出库货转 弹窗页

阿伏兔 4 years ago
parent
commit
bc49655bab

+ 47 - 60
src/views/warehouseBusiness/inStock/index.vue

@@ -254,6 +254,7 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
+            v-if="scope.row.fBillstatus === '6'"
             @click="handleUpdate(scope.row, true)"
             v-hasPermi="['warehouseBusiness:warehousebills:edit']"
             >查看
@@ -262,6 +263,7 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
+            v-if="scope.row.fBillstatus !== '6'"
             @click="handleUpdate(scope.row, false)"
             v-hasPermi="['warehouseBusiness:warehousebills:edit']"
             >修改
@@ -270,8 +272,8 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            v-if="scope.row.fBillstatus !== '6'"
             @click="handleDelete(scope.row)"
+            v-if="scope.row.fBillstatus !== '6'"
             v-hasPermi="['warehouseBusiness:warehousebills:remove']"
             >删除
           </el-button>
@@ -838,7 +840,7 @@
         >
           <template slot-scope="scope">
             <el-input
-              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              oninput='this.value=this.value.replace(/[^\-?\d]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "")'
               v-model="scope.row.fPlanqty"
               placeholder="件数"
               :disabled="browseStatus"
@@ -872,7 +874,7 @@
         >
           <template slot-scope="scope">
             <el-input
-              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fNetweight"
               placeholder="入库净重"
               :disabled="browseStatus"
@@ -889,7 +891,7 @@
         >
           <template slot-scope="scope">
             <el-input
-              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              oninput='this.value=this.value.replace(/[^\-?\d]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "")'
               v-model="scope.row.fQty"
               placeholder="入库件数"
               :disabled="browseStatus"
@@ -898,6 +900,23 @@
           </template>
         </el-table-column>
         <el-table-column
+          prop="fVolumn"
+          header-align="center"
+          width="180px"
+          align="center"
+          label="入库尺码"
+        >
+          <template slot-scope="scope">
+            <el-input
+              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
+              v-model="scope.row.fVolumn"
+              placeholder="入库尺码"
+              :disabled="browseStatus"
+              show-word-limit
+            />
+          </template>
+        </el-table-column>
+        <el-table-column
           prop="fPackagespecs"
           header-align="center"
           width="180px"
@@ -906,7 +925,7 @@
         >
           <template slot-scope="scope">
             <el-input
-              oninput="value=value.replace(/[^\d.]/g,'')"
+              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fPackagespecs"
               placeholder="包装规格"
               :disabled="browseStatus"
@@ -964,7 +983,7 @@
         >
           <template slot-scope="scope">
             <el-input
-              oninput="value=value.replace(/[^\d.]/g,'')"
+              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fGoodsval"
               placeholder="货值"
               :disabled="browseStatus"
@@ -1013,6 +1032,7 @@
         >
           <template slot-scope="scope">
             <el-button
+              :disabled="browseStatus"
               @click.native.prevent="deleteRow(scope.$index, dataList)"
               size="small"
               >移除</el-button
@@ -1213,11 +1233,11 @@
         >
           <template slot-scope="scope">
             <el-input
-              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fQty"
               placeholder="数量"
               :disabled="browseStatus"
-              @change="changeEstmateAmt(scope.row)"
+              @change="changeContractAmt(scope.row)"
               show-word-limit
             />
           </template>
@@ -1247,15 +1267,6 @@
           width="150px"
           label="金额"
         >
-          <template slot-scope="scope">
-            <el-input
-              disabled
-              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-              v-model="scope.row.fAmount"
-              placeholder="金额"
-              show-word-limit
-            />
-          </template>
         </el-table-column>
         <el-table-column
           prop="fCurrency"
@@ -1282,6 +1293,7 @@
         >
           <template slot-scope="scope">
             <el-input
+              oninput="if(isNaN(value)) { value = null } if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.'))}"
               v-model="scope.row.fExrate"
               :disabled="browseStatus"
               placeholder="汇率"
@@ -1330,6 +1342,7 @@
           <template slot-scope="scope">
             <el-button size="small">审核费用</el-button>
             <el-button
+              :disabled="browseStatus"
               @click.native.prevent="deleteRow(scope.$index, warehouseDrList)"
               size="small"
               >移除</el-button
@@ -1473,15 +1486,6 @@
           width="150px"
           label="金额"
         >
-          <template slot-scope="scope">
-            <el-input
-              disabled
-              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-              v-model="scope.row.fAmount"
-              placeholder="金额"
-              show-word-limit
-            />
-          </template>
         </el-table-column>
         <el-table-column
           prop="fCurrency"
@@ -1508,6 +1512,7 @@
         >
           <template slot-scope="scope">
             <el-input
+              oninput="if(isNaN(value)) { value = null } if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.'))}"
               v-model="scope.row.fExrate"
               :disabled="browseStatus"
               placeholder="汇率"
@@ -1556,6 +1561,7 @@
           <template slot-scope="scope">
             <el-button size="small">审核费用</el-button>
             <el-button
+              :disabled="browseStatus"
               @click.native.prevent="deleteRow(scope.$index, warehouseCrList)"
               size="small"
               >移除</el-button
@@ -1578,8 +1584,8 @@
           @click="showEditDialog_s"
           >入库单
         </el-button>
-        <el-button type="primary" @click="submitForm(2)">暂 存</el-button>
-        <el-button type="primary" @click="submitForm(6)">提 交</el-button>
+        <el-button v-if="!browseStatus" type="primary" @click="submitForm(2)">暂 存</el-button>
+        <el-button v-if="!browseStatus" type="primary" @click="submitForm(6)">提 交</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
       <el-dialog
@@ -2153,12 +2159,12 @@ export default {
         fCorpid: null,
         fFeeid: null,
         fFeeUnitid: null,
-        fQty: null,
-        fUnitprice: null,
-        fAmount: null,
-        fCurrency: null,
-        fCxrate: null,
-        fRate: null,
+        fQty: 0,
+        fUnitprice: 0,
+        fAmount: 0,
+        fCurrency: 0,
+        fCxrate: 0,
+        fRate: 0,
         remarks: null,
       });
     },
@@ -2167,12 +2173,12 @@ export default {
         fCorpid: null,
         fFeeid: null,
         fFeeUnitid: null,
-        fQty: null,
-        fUnitprice: null,
-        fAmount: null,
-        fCurrency: null,
-        fCxrate: null,
-        fRate: null,
+        fQty: 0,
+        fUnitprice: 0,
+        fAmount: 0,
+        fCurrency: 0,
+        fCxrate: 0,
+        fRate: 0,
         remarks: null,
       });
     },
@@ -2196,7 +2202,6 @@ export default {
       this.loading = true;
       listWarehousebills(this.queryParams).then((response) => {
         this.warehousebillsList = response.rows;
-        console.log(response.rows);
         this.total = response.total;
         this.loading = false;
       });
@@ -2330,7 +2335,6 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row, status) {
-      console.log(status)
       this.browseStatus = status;
       this.reset();
       const fId = row.fId || this.ids;
@@ -2393,7 +2397,6 @@ export default {
     },
     // 合计
     getSummaries(param) {
-      console.log(param);
       const { columns, data } = param;
       const sums = [];
       var values = [];
@@ -2511,7 +2514,7 @@ export default {
       if (row.fQty) {
         fQty = row.fQty;
       }
-      this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
+      this.$set(row, "fAmount", parseFloat(Number(fUnitprice) * Number(fQty)).toFixed(2))
     },
     changefBsdate(row) {
       if (this.dataList.length > 0) {
@@ -2522,8 +2525,6 @@ export default {
     },
     // 变更计价单位
     changeFeeUnit(row) {
-      console.log(this.fCntqty);
-      console.log(row);
       if (!row.fFeeUnitid) {
         return false;
       }
@@ -2540,23 +2541,10 @@ export default {
         );
       }
     },
-
-    changefBsdate(row) {
-      if (this.dataList.length > 0) {
-        for (var i = 0; i < this.dataList.length; i++) {
-          this.$set(this.dataList[i], "fBsdate", row);
-        }
-      }
-    },
     /** 提交按钮 */
     submitForm(status) {
       this.$refs["form"].validate((valid) => {
         if(status === 2) {
-          console.log("@@")
-          console.log(this.form)
-          console.log(this.dataList)
-          console.log(this.warehouseCrList)
-          console.log(this.warehouseDrList)
           if (valid) {
           this.form.fBillstatus = status;
           this.form.fNetweight = this.fNetweight;
@@ -2666,7 +2654,6 @@ export default {
           this.form.fPlanqty = this.fPlanqty;
           this.form.fGrossweight = this.fGrossweight;
           this.form.fQty = this.fQty;
-          console.log(this.amt);
           let formData = new window.FormData();
           // 附件数据
           formData.append("tWarehouseBills", JSON.stringify(this.form));

+ 67 - 52
src/views/warehouseBusiness/outStock/index.vue

@@ -255,6 +255,7 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
+            v-if="scope.row.fBillstatus === '6'"
             @click="handleUpdate(scope.row, true)"
             v-hasPermi="['warehouseBusiness:warehousebills:edit']"
           >查看
@@ -263,6 +264,7 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
+            v-if="scope.row.fBillstatus !== '6'"
             @click="handleUpdate(scope.row, false)"
             v-hasPermi="['warehouseBusiness:warehousebills:edit']"
           >修改
@@ -271,8 +273,8 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            v-if="scope.row.fBillstatus !== '6'"
             @click="handleDelete(scope.row)"
+            v-if="scope.row.fBillstatus !== '6'"
             v-hasPermi="['warehouseBusiness:warehousebills:remove']"
           >删除
           </el-button>
@@ -607,7 +609,7 @@
               <el-input
                 v-model="form.fOriginalbillno"
                 style="width: 250px"
-                :disabled="browseStatus"
+                disabled
                 placeholder="单据编号"
               />
             </el-form-item>
@@ -839,6 +841,23 @@
           </template>
         </el-table-column>
         <el-table-column
+          prop="fVolumn"
+          header-align="center"
+          width="180px"
+          align="center"
+          label="出库尺码"
+        >
+          <template slot-scope="scope">
+            <el-input
+              oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              v-model="scope.row.fVolumn"
+              :disabled="browseStatus"
+              placeholder="出库尺码"
+              show-word-limit
+            />
+          </template>
+        </el-table-column>
+        <el-table-column
           prop="fPackagespecs"
           header-align="center"
           width="180px"
@@ -2398,56 +2417,56 @@
         this.reset();
         const fId = row.fId || this.ids;
         getWarehousebills(fId).then((response) => {
-          if(response.data.warehousebills){
-          this.form = response.data.warehousebills;
-        }
-         if(response.data.corps){
-          this.fMblnoOptions = response.data.corps;
-          this.KHblnoOptions = response.data.corps;
-          this.fSbuOptions = response.data.corps;
-         }
-         if(response.data.feesList){
-         this.fWbuOptions = response.data.feesList;
-         }
-         if(response.data.warehouse){
-         this.warehouseOptions = response.data.warehouse;
-         }
-         if(response.data.warehouseBillsItem) {
-           this.dataList = response.data.warehouseBillsItem;
-         }
-         if(response.data.enclosures) {
-           this.relevantAttachments = response.data.enclosures;
-         }
-          // this.fMblnoOptions = []
-
-          this.dataList = response.data.warehouseBillsItem;
-          this.warehouseDrList = response.data.warehousebillsfeesDr;
-          this.warehouseCrList = response.data.warehousebillsfeesCr;
+          if (response.data.warehousebills) {
+            this.form = response.data.warehousebills;
+            this.$set(this.form, 'fEta', Date.parse(this.form.fEta))
+            this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
+            this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
+          }
+          if (response.data.corps) {
+            this.fMblnoOptions = response.data.corps;
+            this.KHblnoOptions = response.data.corps;
+            this.fSbuOptions = response.data.corps;
+          }
+          if (response.data.feesList) {
+            this.fWbuOptions = response.data.feesList;
+          }
+          if (response.data.warehouse) {
+            this.warehouseOptions = response.data.warehouse;
+          }
+          if (response.data.warehouseBillsItem) {
+            this.dataList = response.data.warehouseBillsItem;
+            for (let list in this.dataList) {
+              if (!this.form.fMblno) {
+                this.$set(this.form, 'fMblno', this.dataList[list].fMblno)
+              }
+              this.$set(this.dataList[list], 'fGoodsids', this.dataList[list].fGoodsid)
+              this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
+            }
+          }
+          if (response.data.enclosures) {
+            this.relevantAttachments = response.data.enclosures;
+          }
+          if (response.data.warehouse) {
+            this.warehouseDrList = response.data.warehousebillsfeesDr;
+            for (let dr in this.warehouseDrList) {
+              this.$set(this.warehouseDrList[dr], 'fFeeUnitid', this.warehouseDrList[dr].fFeeUnitid + "")
+            }
+          }
+          if (response.data.warehousebillsfeesCr) {
+            this.warehouseCrList = response.data.warehousebillsfeesCr;
+            this.warehouseCrList = response.data.warehousebillsfeesCr
+            for (let cr in this.warehouseCrList) {
+              this.$set(this.warehouseCrList[cr], 'fFeeUnitid', this.warehouseCrList[cr].fFeeUnitid + "")
+            }
+          }
           this.fWbuOptions = response.data.feesList;
-          this.warehouseOptions = response.data.warehouse;
-          this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
-          this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
-          for (let list in this.dataList) {
-          this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
-          this.$set(this.dataList[list], 'fGoodsids', this.dataList[list].fGoodsid)
-        }
-        for (let dr in this.warehouseDrList) {
-          this.$set(this.warehouseDrList[dr], 'fFeeUnitid', this.warehouseDrList[dr].fFeeUnitid + "")
-        }
-        this.warehouseCrList = response.data.warehousebillsfeesCr
-        for (let cr in this.warehouseCrList) {
-          this.$set(this.warehouseCrList[cr], 'fFeeUnitid', this.warehouseCrList[cr].fFeeUnitid + "")
-        }
           this.userOptions = response.data.sysUser;
           this.goodsOptions = response.data.goodsList;
           this.goodsOptions = response.data.goodsList
-         this.kqhouseOptions = response.data.warehouseAreas
-          this.$set(
-          this.form,
-          "fBsdate",
-          Date.parse(response.data.warehousebills.fBsdate)
-        );
-
+          this.warehouseOptions = response.data.warehouse;
+          this.kqhouseOptions = response.data.warehouseAreas
+          this.$set(this.form, "fBsdate", Date.parse(response.data.warehousebills.fBsdate));
           this.open = true;
           this.title = "修改出库";
         });
@@ -2640,7 +2659,6 @@
           this.form.fPlanqty = this.fPlanqty;
           this.form.fGrossweight = this.fGrossweight;
           this.form.fQty = this.fQty;
-          console.log(this.amt);
           let formData = new window.FormData();
           // 附件数据
           formData.append("tWarehouseBills", JSON.stringify(this.form));
@@ -2670,7 +2688,6 @@
             this.getList();
           });
         }
-
       }else {
           if (this.dataList.length ===  0) {
           this.$message.error('请添加库存明细!')
@@ -2711,14 +2728,12 @@
           this.$message.error('请选择客户名称')
           return false
         }
-
          }
           for (let list in this.warehouseCrList) {
             if (!this.warehouseCrList[list].fCorpid) {
           this.$message.error('请选择客户名称')
           return false
         }
-
          }
           if (valid) {
             this.form.fBillstatus = status;