فهرست منبع

出入库状态打印

tong 4 سال پیش
والد
کامیت
7fe7bfdf35
2فایلهای تغییر یافته به همراه602 افزوده شده و 390 حذف شده
  1. 331 260
      src/views/warehouseBusiness/inStock/index.vue
  2. 271 130
      src/views/warehouseBusiness/outStock/index.vue

+ 331 - 260
src/views/warehouseBusiness/inStock/index.vue

@@ -267,7 +267,7 @@
         :formatter="fTrademodeidFormat"
       /> -->
       <el-table-column label="仓库" align="center" prop="fWarehouseid" />
-      <el-table-column label="计划件数" align="center" prop="fPlannetweight" />
+      <el-table-column label="计划件数" align="center" prop="fPlanqty" />
       <el-table-column label="入库件数" align="center" prop="fQty" />
       <!--      <el-table-column label="入库毛重" align="center" prop="fGrossweight"/>-->
       <!-- <el-table-column label="货转客户名称" align="center" prop="fTocorpid" /> -->
@@ -332,9 +332,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            v-if="
-              scope.row.fBillstatus !== '6' && scope.row.fItemsStatus === '1'
-            "
+            v-if="scope.row.fBillstatus !== 6 && scope.row.fItemsStatus === 1"
             @click="handleDelete(scope.row)"
             v-hasPermi="['warehouseBusiness:warehousebills:remove']"
             >删除
@@ -385,7 +383,7 @@
                 v-model="form.fStltypeid"
                 placeholder="请选择结算方式"
                 clearable
-                :disabled="browseStatus"
+                :disabled="browseStatus || formBrowseStatus"
                 style="width: 80%"
               >
                 <el-option
@@ -469,10 +467,11 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="计划件数" prop="fPlanqty">
-             <el-input
+              <el-input
                 v-model="form.fPlanqty"
                 style="width: 80%"
                 laceholder="计划件数"
+                :disabled="browseStatus || formBrowseStatus"
               />
             </el-form-item>
           </el-col>
@@ -482,6 +481,7 @@
                 v-model="form.fPlannetweight"
                 style="width: 80%"
                 laceholder="计划毛重"
+                :disabled="browseStatus || formBrowseStatus"
               />
             </el-form-item>
           </el-col>
@@ -491,6 +491,7 @@
                 v-model="form.fPlangrossweight"
                 style="width: 80%"
                 laceholder="计划毛重"
+                :disabled="browseStatus || formBrowseStatus"
               />
             </el-form-item>
           </el-col>
@@ -515,7 +516,7 @@
                 remote
                 clearable
                 style="width: 80%"
-                :disabled="browseStatus"
+                :disabled="browseStatus || formBrowseStatus"
                 @keyup.enter.native="handleQuery"
                 :remote-method="corpsRemoteMethodd"
                 placeholder="请输入模糊查找"
@@ -723,67 +724,45 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-             <el-col :span="8">
-            <el-form-item label="质押" prop="fIfpledge">
-              <el-select
-                v-model="form.fIfpledge"
-                placeholder="请选择是否过磅"
-                clearable
-                :disabled="browseStatus"
-                style="width: 80%"
-              >
-                <el-option
-                  v-for="(dict, index) in fIfpledgeOptions"
-                  :key="index.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
+            <el-col :span="8">
+              <el-form-item label="质押" prop="fIfpledge">
+                <el-select
+                  v-model="form.fIfpledge"
+                  placeholder="请选择是否过磅"
+                  clearable
+                  :disabled="browseStatus"
+                  style="width: 80%"
+                >
+                  <el-option
+                    v-for="(dict, index) in fIfpledgeOptions"
+                    :key="index.dictValue"
+                    :label="dict.dictLabel"
+                    :value="dict.dictValue"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-col>
           </el-row>
           <el-row>
-             <el-col :span="8">
-            <el-form-item label="质押银行" prop="fBankcorpid">
-              <el-select
-                v-model="queryParams.fBankcorpid"
-                filterable
-                remote
-                clearable
-                style="width: 80%"
-                :disabled="browseStatus"
-                @keyup.enter.native="handleQuery"
-                :remote-method="corpsRemoteMethodd"
-                placeholder="请输入模糊查找"
-              >
-                <el-option
-                  v-for="(dict, index) in Pledgebank"
-                  :key="index.fId"
-                  :label="dict.fName"
-                  :value="dict.fId"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
             <el-col :span="8">
-            <el-form-item label="过磅" prop="fIfweigh">
-              <el-select
-                v-model="form.fIfweigh"
-                placeholder="请选择是否过磅"
-                clearable
-                :disabled="browseStatus"
-                style="width: 80%"
-              >
-                <el-option
-                  v-for="(dict, index) in fIfweighOptions"
-                  :key="index.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-            </el-row>
+              <el-form-item label="过磅" prop="fIfweigh">
+                <el-select
+                  v-model="form.fIfweigh"
+                  placeholder="请选择是否过磅"
+                  clearable
+                  :disabled="browseStatus"
+                  style="width: 80%"
+                >
+                  <el-option
+                    v-for="(dict, index) in fIfweighOptions"
+                    :key="index.dictValue"
+                    :label="dict.dictLabel"
+                    :value="dict.dictValue"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
         </div>
       </el-form>
 
@@ -827,16 +806,17 @@
             "
             >{{ detailsHidden ? "隐藏" : "展开" }}</el-button
           >
+          <el-button type="info" prop="打印" @click="showEditDialog_sss"
+            >作业单
+          </el-button>
+          <el-button @click="discharge">卸货 </el-button>
           <el-button type="success" prop="打印" @click="showEditDialog_ss"
             >收货单
           </el-button>
           <el-button type="warning" prop="打印" @click="showEditDialog_s"
             >入库单
           </el-button>
-          <el-button @click="discharge">卸货 </el-button>
-          <el-button type="info" prop="打印" @click="showEditDialog_sss"
-            >作业单
-          </el-button>
+
           <el-button
             :disabled="browseStatus"
             type="primary"
@@ -1172,7 +1152,7 @@
         <el-table-column
           prop="fDriverIdCa"
           header-align="center"
-          width="130px"
+          width="200px"
           align="center"
           label="*司机身份证"
         >
@@ -1959,45 +1939,50 @@
       <el-dialog
         title="计划费用导入"
         :modal="false"
-        style="height:500px;"
+        style="height: 500px"
         height="50%"
         :visible.sync="weightList"
         @close="closeDialog"
         width="70%"
       >
-       <el-form ref="planningList" :model="form" :rules="rules" label-width="120px">
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="计划件数" prop="fPlanqty">
-             <el-input
-                v-model="planningList.fPlanqty"
-                style="width: 80%"
-                laceholder="计划件数"
-                @input="changeList(form)"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="计划净重" prop="fPlannetweight">
-             <el-input
-                v-model="planningList.fPlannetweight"
-                style="width: 80%"
-                disabled
-                laceholder="计划毛重"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="计划毛重" prop="fPlangrossweight">
-             <el-input
-                v-model="planningList.fPlangrossweight"
-                style="width: 80%"
-                disabled
-                laceholder="计划毛重"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
+        <el-form
+          ref="planningList"
+          :model="form"
+          :rules="rules"
+          label-width="120px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="计划件数" prop="fPlanqty">
+                <el-input
+                  v-model="planningList.fPlanqty"
+                  style="width: 80%"
+                  laceholder="计划件数"
+                  @input="changeList(form)"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计划净重" prop="fPlannetweight">
+                <el-input
+                  v-model="planningList.fPlannetweight"
+                  style="width: 80%"
+                  disabled
+                  laceholder="计划毛重"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计划毛重" prop="fPlangrossweight">
+                <el-input
+                  v-model="planningList.fPlangrossweight"
+                  style="width: 80%"
+                  disabled
+                  laceholder="计划毛重"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="costList">导入</el-button>
@@ -2434,7 +2419,22 @@
             <td width="200">车号</td>
             <td width="200">{{ item.fTruckno }}</td>
             <td width="200">货物品名</td>
-            <td width="200" colspan="4" class="zzss">{{ item.fGoodsids }}</td>
+            <td width="200" colspan="4" class="zzss">
+              <el-select
+              v-model="item.fGoodsid"
+              filterable
+              remote
+              :remote-method="goodsRemoteMethod"
+              placeholder="请选择品名"
+            >
+              <el-option
+                v-for="(dict, index) in goodsOptions"
+                :key="index.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
+            </td>
           </tr>
           <tr>
             <td width="1400" colspan="6">&nbsp;</td>
@@ -2526,15 +2526,15 @@ export default {
       fBsdates: "",
       fCntrtype: "",
       fGoodsids: "",
-      fPlaNnumber: '',
-      fPlangNumber: '',
+      fPlaNnumber: "",
+      fPlangNumber: "",
       // fPlannetweight: "",
       fPlanvolumn: "",
       fPlanqty: "",
       fFeeUnitid: "",
       fFeeUnitids: "",
       fGrossweight: "",
-      fid: null,
+      fid: "",
       fCntqty: "",
       fNetweight: "",
       fQty: "",
@@ -2603,11 +2603,11 @@ export default {
       fTrademodeidOptions: [],
       // 计费单位(数据字典),下拉选择毛重或净重字典
       fFeetunitOptions: [
-        {dictLabel: "件数",dictValue: "1"},
-        {dictLabel: "毛重",dictValue: "2"},
-        {dictLabel: "净重",dictValue: "3"},
-        {dictLabel: "尺码",dictValue: "4"},
-        {dictLabel: "固定",dictValue: "5"},
+        { dictLabel: "件数", dictValue: "1" },
+        { dictLabel: "毛重", dictValue: "2" },
+        { dictLabel: "净重", dictValue: "3" },
+        { dictLabel: "尺码", dictValue: "4" },
+        { dictLabel: "固定", dictValue: "5" },
       ],
       // 结算方式(数据字典),下拉选择字典
       fStltypeOptions: [],
@@ -2625,11 +2625,11 @@ export default {
       fWbuOptions: [],
       // 计价单位
       jFeetunitOptions: [
-        {dictLabel: "件数",dictValue: "1"},
-        {dictLabel: "毛重",dictValue: "2"},
-        {dictLabel: "净重",dictValue: "3"},
-        {dictLabel: "尺码",dictValue: "4"},
-        {dictLabel: "固定",dictValue: "5"},
+        { dictLabel: "件数", dictValue: "1" },
+        { dictLabel: "毛重", dictValue: "2" },
+        { dictLabel: "净重", dictValue: "3" },
+        { dictLabel: "尺码", dictValue: "4" },
+        { dictLabel: "固定", dictValue: "5" },
       ],
       // 查询参数
       queryParams: {
@@ -2689,7 +2689,7 @@ export default {
       planningList: {
         fPlanqty: null,
         fPlannetweight: null,
-        fPlangrossweight: null
+        fPlangrossweight: null,
       },
       // 表单参数
       form: {
@@ -2754,8 +2754,8 @@ export default {
       this.fStltypeOptions = response.data;
     });
     this.getDicts("tax_rate").then((response) => {
-      this.fTaxrate = response.data[0].dictValue
-      console.log(this.fTaxrate)
+      this.fTaxrate = response.data[0].dictValue;
+      console.log(this.fTaxrate);
     });
     this.getDicts("data_ifweigh_status").then((response) => {
       this.fIfweighOptions = response.data;
@@ -2777,7 +2777,7 @@ export default {
   methods: {
     // 上传成功返回数据
     showFile(row) {
-      for(let list in this.relevantAttachments) {
+      for (let list in this.relevantAttachments) {
         this.$set(this.relevantAttachments[list], "fUrl", row.url);
         this.$set(this.relevantAttachments[list], "fName", row.fileName);
       }
@@ -2874,18 +2874,21 @@ export default {
         typeof this.form.fPlanqty === "undefined" ||
         this.form.fPlanqty == null ||
         this.form.fPlanqty === "";
-        if (corpidStatus || warehouseidStatus || ftrademodeids) {
+      if (corpidStatus || warehouseidStatus || ftrademodeids) {
         this.$message({
           message: "请维护计划净重,计划毛重,计划件数",
           type: "warning",
         });
         return false;
       }
-      this.planningList.fPlanqty =  Number(this.form.fPlanqty) - Number(this.fQty),
-      this.planningList.fPlannetweight = Number(this.form.fPlannetweight) - Number(this.fNetweight),
-      this.planningList.fPlangrossweight = Number(this.form.fPlangrossweight) - Number(this.fGrossweight),
-      this.fPlaNnumber = this.form.fPlannetweight/this.form.fPlanqty;
-      this.fPlangNumber = this.form.fPlangrossweight/this.form.fPlanqty;
+      (this.planningList.fPlanqty =
+        Number(this.form.fPlanqty) - Number(this.fQty)),
+        (this.planningList.fPlannetweight =
+          Number(this.form.fPlannetweight) - Number(this.fNetweight)),
+        (this.planningList.fPlangrossweight =
+          Number(this.form.fPlangrossweight) - Number(this.fGrossweight)),
+        (this.fPlaNnumber = this.form.fPlannetweight / this.form.fPlanqty);
+      this.fPlangNumber = this.form.fPlangrossweight / this.form.fPlanqty;
       this.weightList = true;
       let time = null;
     },
@@ -2945,6 +2948,13 @@ export default {
       }
     },
     showEditDialog_sss() {
+      console.log(this.Printinglist)
+      for (let li in this.Printinglist) {
+        if(!this.Printinglist[li].fId) {
+          this.$message.error("请先保存!");
+          return false;
+        }
+      }
       if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
           if (
@@ -2985,10 +2995,14 @@ export default {
             this.$message.error("请输入司机姓名");
             return false;
           }
-          if (!this.Printinglist[warehouseCr].fPackagespecs) {
+          if (!this.Printinglist[warehouseCr].fDriverTel) {
             this.$message.error("请输入司机电话");
             return false;
           }
+          if (!this.Printinglist[warehouseCr].fTruckno) {
+            this.$message.error("请输入车号");
+            return false;
+          }
         }
         this.editDialogVisible_sss = true;
         // this.addList()
@@ -3050,7 +3064,7 @@ export default {
     getList() {
       this.loading = true;
       listWarehousebills(this.queryParams).then((response) => {
-        console.log(response)
+        console.log(response);
         this.warehousebillsList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -3075,18 +3089,18 @@ export default {
     },
     // 导入计划重量
     costList() {
-      console.log(this.planningList.fPlanqty)
-      console.log(this.form.fPlanqty)
-      if( Number(this.planningList.fPlanqty) > Number(this.form.fPlanqty)) {
-        console.log(this.planningList.fPlanqty)
-      console.log(this.form.fPlanqty)
+      console.log(this.planningList.fPlanqty);
+      console.log(this.form.fPlanqty);
+      if (Number(this.planningList.fPlanqty) > Number(this.form.fPlanqty)) {
+        console.log(this.planningList.fPlanqty);
+        console.log(this.form.fPlanqty);
         this.$message({
           message: "计划费件数不能大于主表计划费件数!",
           type: "warning",
         });
         return false;
       }
-       this.dataList.push({
+      this.dataList.push({
         fBsdate: this.form.fBsdate,
         fGoodsid: null,
         fCntrtype: null,
@@ -3107,7 +3121,6 @@ export default {
         fBillstatus: 10,
       });
       this.weightList = false;
-      
     },
 
     // 导入付款信息
@@ -3132,8 +3145,7 @@ export default {
             fUnitprice: this.dialogWhgenlegList[whgen].fPrice,
             fCurrency: "RMB",
             fExrate: "1",
-            fTaxrate: this.fTaxrate
-
+            fTaxrate: this.fTaxrate,
           });
           console.log(JSON.stringify(this.warehouseDrList));
         }
@@ -3159,7 +3171,7 @@ export default {
             fUnitprice: this.dialogWhgenlegList[zhgen].fPrice,
             fCurrency: "RMB",
             fExrate: "1",
-            fTaxrate: this.fTaxrate
+            fTaxrate: this.fTaxrate,
           });
         }
         this.warehousingagreements = false;
@@ -3286,15 +3298,13 @@ export default {
       console.log(selection);
       console.log(this.form);
       this.Printinglist = selection;
+      console.log(this.Printinglist);
       this.dataListSelection = [];
       if (!selection || selection.length === 0) {
         return false;
       } else {
         for (let se in selection) {
-          if (
-            !selection[se].fBillstatus ||
-            selection[se].fBillstatus !== 40
-          ) {
+          if (!selection[se].fBillstatus || selection[se].fBillstatus !== 40) {
             this.dataListSelection.push(selection[se]);
           } else if (
             selection[se].fBillstatus &&
@@ -3304,7 +3314,7 @@ export default {
           }
         }
         if (this.dataListSelection.length > 0) {
-          console.log(selection)
+          console.log(selection);
           this.fTruckno = selection[0].fTruckno;
           this.fCntrtype = selection[0].fCntrtype;
           this.fGoodsids = selection[0].fGoodsids;
@@ -3357,20 +3367,20 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row, status) {
-      console.log(row)
+      console.log(row);
       this.browseStatus = status;
       this.reset();
       this.detailsHidden = false;
       const fId = row.fId || this.ids;
-      console.log(fId)
-      console.log(this.ids)
+      console.log(fId);
+      console.log(this.ids);
       getWarehousebills(fId).then((response) => {
         console.log(response);
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
           if (this.form.fItemsStatus !== 1) {
             this.formBrowseStatus = true;
-          }else {
+          } else {
             this.formBrowseStatus = false;
           }
         }
@@ -3455,7 +3465,7 @@ export default {
         }
         if (column.property === "fCntqty") {
           values = data.map((item) => Number(item["fCntqty"]));
-        } 
+        }
         if (
           column.property === "fPlanvolumn" ||
           column.property === "fGrossweight" ||
@@ -3521,11 +3531,13 @@ export default {
     },
     // 计划废用导入计算
     changeList(row) {
-      console.log(row)
-      console.log(this.fPlaNnumber)
-      
-     this.planningList.fPlannetweight = Number(this.planningList.fPlanqty)*Number(this.fPlaNnumber);
-     this.planningList.fPlangrossweight = Number(this.planningList.fPlanqty)*Number(this.fPlangNumber);
+      console.log(row);
+      console.log(this.fPlaNnumber);
+
+      this.planningList.fPlannetweight =
+        Number(this.planningList.fPlanqty) * Number(this.fPlaNnumber);
+      this.planningList.fPlangrossweight =
+        Number(this.planningList.fPlanqty) * Number(this.fPlangNumber);
     },
     // 数量计算
     changeContractAmt(row) {
@@ -3577,13 +3589,11 @@ export default {
       }
       if (row.fFeeUnitid === "2") {
         this.$set(row, "fQty", this.fGrossweight);
-      }else if(row.fFeeUnitid === "1") {
+      } else if (row.fFeeUnitid === "1") {
         this.$set(row, "fQty", this.fQty);
-      }
-      else if(row.fFeeUnitid === "3") {
+      } else if (row.fFeeUnitid === "3") {
         this.$set(row, "fQty", this.fNetweight);
-      }
-      else {
+      } else {
         this.$set(row, "fQty", 0);
       }
       if (row.fUnitprice) {
@@ -3608,7 +3618,7 @@ export default {
         console.log(this.dataListSelection);
         for (let warehouseCr in this.dataListSelection) {
           if (this.dataListSelection[warehouseCr].fBillstatus != 30) {
-            this.$message.error("请先卸货");
+            this.$message.error("请先打印");
             return false;
           }
           if (!this.dataListSelection[warehouseCr].fWarehouselocid) {
@@ -3631,22 +3641,22 @@ export default {
             this.$message.error("请选择入库件数");
             return false;
           }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请选择入库规格");
-            return false;
-          }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请选择入库规格");
+          //   return false;
+          // }
           if (!this.dataListSelection[warehouseCr].fDriverName) {
             this.$message.error("请输入司机姓名");
             return false;
           }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请输入司机电话");
-            return false;
-          }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请输入司机身份证");
-            return false;
-          }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请输入司机电话");
+          //   return false;
+          // }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请输入司机身份证");
+          //   return false;
+          // }
         }
         if (valid) {
           let formData = new window.FormData();
@@ -3658,13 +3668,12 @@ export default {
           );
           formData.append("whgenleg", JSON.stringify(this.relevantAttachments));
           addWhgenleg(formData).then((response) => {
-
             this.fid = response.data;
             this.formBrowseStatus = true;
             this.msgSuccess("入账成功");
             for (let li in this.dataListSelection) {
               for (let i in this.dataList) {
-                 let fQty =
+                let fQty =
                   this.dataList[i].fQty === this.dataListSelection[li].fQty;
                 let fMblno =
                   this.dataList[i].fMblno === this.dataListSelection[li].fMblno;
@@ -3707,7 +3716,6 @@ export default {
     },
     // 打印作业单
     addList() {
-      console.log("打印作业单");
       this.$refs["form"].validate((valid) => {
         if (valid) {
           let formData = new window.FormData();
@@ -3717,16 +3725,16 @@ export default {
             "warehousebillsitems",
             JSON.stringify(this.dataListSelection)
           );
-          console.log(this.dataListSelection)
+          console.log(this.dataListSelection);
           formData.append("whgenleg", JSON.stringify(this.relevantAttachments));
-          
+
           for (let li in this.dataListSelection) {
             this.dataListSelection[li].fBillstatus = 20;
             // this.dataListSelection[li].fId = 20;
           }
           console.log(this.dataListSelection);
-          console.log(this.form.fId)
-         
+          console.log(this.form.fId);
+
           addJoblist(formData).then((response) => {
             console.log(response);
             console.log(response.data.warehousebillsitems);
@@ -3758,6 +3766,7 @@ export default {
                   fNetweight &&
                   fQty
                 ) {
+                  console.log("5655665")
                   this.$set(this.dataList[i], "fBillstatus", 20);
                 }
               }
@@ -3780,7 +3789,7 @@ export default {
       );
       console.log(this.dataWithdrawList);
       updateCredit(formData).then((response) => {
-        console.log(response.data)
+        console.log(response.data);
         this.fid = response.data;
         this.formBrowseStatus = false;
         this.msgSuccess("撤销入账成功");
@@ -3820,74 +3829,143 @@ export default {
       if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
         }
-          this.$refs["form"].validate((valid) => {
-            if (valid) {
-              let formData = new window.FormData();
-              console.log(this.form);
-              formData.append("warehouseBills", JSON.stringify(this.form));
-              formData.append(
-                "warehousebillsitems",
-                JSON.stringify(this.dataListSelection)
-              );
-              formData.append(
-                "whgenleg",
-                JSON.stringify(this.relevantAttachments)
-              );
+        this.$refs["form"].validate((valid) => {
+          if (valid) {
+            let formData = new window.FormData();
+            console.log(this.form);
+            formData.append("warehouseBills", JSON.stringify(this.form));
+            formData.append(
+              "warehousebillsitems",
+              JSON.stringify(this.dataListSelection)
+            );
+            formData.append(
+              "whgenleg",
+              JSON.stringify(this.relevantAttachments)
+            );
+            for (let li in this.dataListSelection) {
+              this.dataListSelection[li].fBillstatus = 30;
+            }
+            console.log(this.dataListSelection);
+            if (!this.form.fId) {
+              this.form.fId = this.fid;
+            }
+            disChargelist(formData).then((response) => {
+              console.log(response);
+              console.log(response.data.warehousebillsitems);
               for (let li in this.dataListSelection) {
-                this.dataListSelection[li].fBillstatus = 30;
-              }
-              console.log(this.dataListSelection);
-              if (!this.form.fId) {
-            this.form.fId = this.fid;
-          }
-              disChargelist(formData).then((response) => {
-                console.log(response);
-                console.log(response.data.warehousebillsitems);
-                for (let li in this.dataListSelection) {
-                  for (let i in this.dataList) {
-                    let fQty =
-                      this.dataList[i].fQty === this.dataListSelection[li].fQty;
-                    let fBsdate =
-                      this.dataList[i].fBsdate ===
-                      this.dataListSelection[li].fBsdate;
-                    let fGoodsid =
-                      this.dataList[i].fGoodsid ===
-                      this.dataListSelection[li].fGoodsid;
-                    let fcntrtype =
-                      this.dataList[i].fcntrtype ===
-                      this.dataListSelection[li].fcntrtype;
-                    let fNetweight =
-                      this.dataList[i].fNetweight ===
-                      this.dataListSelection[li].fNetweight;
-                    let fGrossweight =
-                      this.dataList[i].fGrossweight ===
-                      this.dataListSelection[li].fGrossweight;
-                    if (
-                      fBsdate &&
-                      fGoodsid &&
-                      fcntrtype &&
-                      fGrossweight &&
-                      fNetweight &&
-                      fQty
-                    ) {
-                      this.$set(this.dataList[i], "fBillstatus", 30);
-                    }
+                for (let i in this.dataList) {
+                  let fQty =
+                    this.dataList[i].fQty === this.dataListSelection[li].fQty;
+                  let fBsdate =
+                    this.dataList[i].fBsdate ===
+                    this.dataListSelection[li].fBsdate;
+                  let fGoodsid =
+                    this.dataList[i].fGoodsid ===
+                    this.dataListSelection[li].fGoodsid;
+                  let fcntrtype =
+                    this.dataList[i].fcntrtype ===
+                    this.dataListSelection[li].fcntrtype;
+                  let fNetweight =
+                    this.dataList[i].fNetweight ===
+                    this.dataListSelection[li].fNetweight;
+                  let fGrossweight =
+                    this.dataList[i].fGrossweight ===
+                    this.dataListSelection[li].fGrossweight;
+                  if (
+                    fBsdate &&
+                    fGoodsid &&
+                    fcntrtype &&
+                    fGrossweight &&
+                    fNetweight &&
+                    fQty
+                  ) {
+                    this.$set(this.dataList[i], "fBillstatus", 30);
                   }
                 }
-                this.msgSuccess("卸货成功");
-                this.$refs.tableList.clearSelection();
-              });
-            }
-          });
-        
+              }
+              this.msgSuccess("卸货成功");
+              this.$refs.tableList.clearSelection();
+            });
+          }
+        });
       } else {
         this.$message.error("请选择需要卸货的明细!");
       }
     },
     /** 提交按钮 */
     submitForm(status) {
+          if(status === 2) {
+             this.preservation()
+          }else {
+            this.pleaseCheck()
+        }
+    },
+    // 提交保存保存成功
+    preservation() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = this.fNetweight;
+          // this.form.fPlangrossweight = this.fPlangrossweight;
+          // this.form.fPlannetweight = this.fPlannetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          // this.form.fPlanqty = this.fPlanqty;
+          this.form.fGrossweight = this.fGrossweight;
+          this.form.fQty = this.fQty;
+          if (!this.form.fId) {
+            this.form.fId = this.fid;
+          }
+        }
+      });
+       let formDatae = new window.FormData();
+          // 附件数据
+          formDatae.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(this.form);
+          // 库存明细
+          formDatae.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          console.log(this.dataList);
+          // 附件数据
+          formDatae.append(
+            "tWhgenleg",
+            JSON.stringify(this.relevantAttachments)
+          );
+          console.log(this.relevantAttachments);
+          // 费用明细付款
+          formDatae.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+           console.log(this.warehouseCrList);
+          // 收款
+          formDatae.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+          console.log(formDatae)
+      addWarehousebills(formDatae).then((response) => {
+            this.msgSuccess("保存成功");
+            console.log(response.data.warehousebillsitems)
+            this.dataList = response.data.warehousebillsitems;
+            for (let list in this.dataList) {
+              this.$set(
+                this.dataList[list],
+                "fBsdate",
+                Date.parse(this.dataList[list].fBsdate)
+              );
+            }
+            this.fid = response.data.warehouseBills.fId;
+              // this.open = true;
+            this.getList();
+            return true
+          });
+          return false
+    },
+    // 请核成功
+    pleaseCheck () {
       this.$refs["form"].validate((valid) => {
-        if (status !== 2) {
           if (this.dataList.length === 0) {
             this.$message.error("请新增库存明细!");
             return false;
@@ -3943,7 +4021,6 @@ export default {
               return false;
             }
           }
-        }
         if (valid) {
           this.form.fBillstatus = status;
           this.form.fNetweight = this.fNetweight;
@@ -3956,10 +4033,12 @@ export default {
           if (!this.form.fId) {
             this.form.fId = this.fid;
           }
-          let formData = new window.FormData();
+        }
+      
+       let formData = new window.FormData();
           // 附件数据
           formData.append("tWarehouseBills", JSON.stringify(this.form));
-          console.log(this.form)
+          console.log(this.form);
           // 库存明细
           formData.append(
             "tWarehousebillsitems",
@@ -3980,31 +4059,23 @@ export default {
             "tWarehousebillsfeesDr",
             JSON.stringify(this.warehouseDrList)
           );
-          addWarehousebills(formData).then((response) => {
+      addWarehousebills(formData).then((response) => {
             this.msgSuccess("提交成功");
-            console.log(response);
-            console.log(this.dataList);
-            if (status === 2) {
-              this.open = true;
-              // this.form = response.data.warehouseBills;
-              this.$set(this.form, "fStltypeid", this.form.fStltypeid + "");
-              this.$set(this.form, "fEta", Date.parse(this.form.fEta));
-              this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
+            this.dataList = response.data.warehousebillsitems;
+            for (let list in this.dataList) {
               this.$set(
-                this.form,
-                "createTime",
-                Date.parse(this.form.createTime)
+                this.dataList[list],
+                "fBsdate",
+                Date.parse(this.dataList[list].fBsdate)
               );
-              this.$set(this.form, "fTrademodeid", this.form.fTrademodeid + "");
-            } else {
-              this.open = false;
             }
-
+            this.fid = response.data.warehouseBills.fId;
+              this.open = false;
             this.getList();
           });
-        }
-      });
+          });
     },
+
     /** 删除按钮操作 */
     handleDelete(row) {
       const fIds = row.fId || this.ids;

+ 271 - 130
src/views/warehouseBusiness/outStock/index.vue

@@ -822,17 +822,18 @@
             "
             >{{ detailsHidden ? "隐藏" : "展开" }}</el-button
           >
-          <el-button type="primary" @click="submitForm(2)">保 存</el-button>
+          
           <!-- <el-button type="success" prop="打印" @click="showEditDialog_ss"
           >收货单
         </el-button> -->
-          <el-button type="warning" prop="打印" @click="showEditDialog_s"
-            >出库单
-          </el-button>
-          <el-button @click="discharge">卸货 </el-button>
           <el-button type="info" prop="打印" @click="showEditDialog_sss"
             >作业单
           </el-button>
+          <el-button @click="discharge">装货</el-button>
+          <el-button type="warning" prop="打印" @click="showEditDialog_s"
+            >出库单
+          </el-button>
+          <el-button type="primary" @click="submitForm(2)">保 存</el-button>
           <el-button
             style="background-color: #008000; color: #fff"
             @click="submitForm(6)"
@@ -880,7 +881,7 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fGoodsids"
+              v-model="scope.row.fGoodsid"
               filterable
               disabled
               remote
@@ -905,7 +906,7 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fWarehouselocids"
+              v-model="scope.row.fWarehouselocid"
               filterable
               remote
               disabled
@@ -935,9 +936,9 @@
               placeholder="唛头"
               :disabled="
                 browseStatus ||
-                scope.row.fBillstatus === '20' ||
-                scope.row.fBillstatus === '30' ||
-                scope.row.fBillstatus === '40'
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
               "
               show-word-limit
             />
@@ -954,7 +955,12 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fCntrtype"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="箱型"
               show-word-limit
             />
@@ -972,7 +978,12 @@
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fCntqty"
               placeholder="箱量"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -994,7 +1005,12 @@
         >
           <template slot-scope="scope">
             <el-input
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fGrossweight"
               placeholder="出库毛重"
@@ -1013,7 +1029,12 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fNetweight"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="出库净重"
               show-word-limit
             />
@@ -1031,7 +1052,12 @@
               oninput='this.value=this.value.replace(/[^\-?\d]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "")'
               @change="qtyChange(scope.row)"
               v-model="scope.row.fQty"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="出库件数"
               show-word-limit
             />
@@ -1048,7 +1074,12 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fVolumn"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="出库尺码"
               show-word-limit
             />
@@ -1065,14 +1096,19 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fPackagespecs"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               placeholder="包装规格"
               show-word-limit
             />
           </template>
         </el-table-column>
 
-      <el-table-column
+      <!-- <el-table-column
           prop="fChargedate"
           header-align="center"
           align="center"
@@ -1120,7 +1156,7 @@
             >
             </el-date-picker>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column
           prop="fCntrno"
           header-align="center"
@@ -1132,7 +1168,12 @@
             <el-input
               v-model="scope.row.fCntrno"
               placeholder="箱号"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1149,7 +1190,12 @@
               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 || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1166,7 +1212,12 @@
               oninput="value=value.replace(/[^\d.]/g,'')"
               v-model="scope.row.fTruckno"
               placeholder="车号"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1183,7 +1234,12 @@
             <el-input
               v-model="scope.row.fDriverName"
               placeholder="司机名"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1200,7 +1256,12 @@
             <el-input
               v-model="scope.row.fDriverTel"
               placeholder="司机电话"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1217,7 +1278,12 @@
             <el-input
               v-model="scope.row.fDriverIdCa"
               placeholder="司机身份证"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1235,7 +1301,12 @@
                 v-model="scope.row.fIsPass"
                 placeholder="是否放行"
                 clearable
-                :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+                :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
                 style="width: 80%"
               >
                 <el-option
@@ -1259,7 +1330,12 @@
             <el-input
               v-model="scope.row.fSerialNumber"
               placeholder="流水号"
-              :disabled="browseStatus || scope.row.fBillstatus === '20' || scope.row.fBillstatus === '30' || scope.row.fBillstatus === '40'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1275,7 +1351,12 @@
             <el-input
               v-model="scope.row.remark"
               placeholder="备注"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               show-word-limit
             />
           </template>
@@ -1292,7 +1373,7 @@
             <span v-if="scope.row.fBillstatus !== '6'">未出库</span> -->
             <span v-if="scope.row.fBillstatus === 40">已入库</span>
             <span v-if="scope.row.fBillstatus === 20">待入库</span>
-            <span v-if="scope.row.fBillstatus === 30">货中</span>
+            <span v-if="scope.row.fBillstatus === 30">货中</span>
             <span v-if="scope.row.fBillstatus === 10">计划</span>
           </template>
         </el-table-column>
@@ -1306,7 +1387,12 @@
             <el-button
               @click.native.prevent="deleteRow(scope.$index, dataList)"
               size="small"
-              :disabled="browseStatus || scope.row.fBillstatus === '6'"
+              :disabled="
+                browseStatus ||
+                scope.row.fBillstatus === 20 ||
+                scope.row.fBillstatus === 30 ||
+                scope.row.fBillstatus === 40
+              "
               >移除</el-button
             >
           </template>
@@ -1911,7 +1997,7 @@
         <el-button type="warning" prop="打印" @click="showEditDialog_s"
           >出库单
         </el-button>
-        <el-button @click="discharge">货 </el-button>
+        <el-button @click="discharge">货 </el-button>
         <el-button type="info" prop="打印" @click="showEditDialog_sss"
           >作业单
         </el-button>
@@ -2569,7 +2655,22 @@
             <td width="200">车号</td>
             <td width="200">{{ item.fTruckno }}</td>
             <td width="200">货物品名</td>
-            <td width="200" colspan="4" class="zzss">{{ item.fGoodsids }}</td>
+            <td width="200" colspan="4" class="zzss">
+               <el-select
+              v-model="item.fGoodsid"
+              filterable
+              remote
+              :remote-method="goodsRemoteMethod"
+              placeholder="请选择品名"
+            >
+              <el-option
+                v-for="(dict, index) in goodsOptions"
+                :key="index.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
+            </td>
           </tr>
           <tr>
             <td width="1400" colspan="6">&nbsp;</td>
@@ -3224,6 +3325,12 @@ export default {
     },
     // 作业单打印
     showEditDialog_sss() {
+      for (let li in this.Printinglist) {
+        if(!this.Printinglist[li].fId) {
+          this.$message.error("请先保存!");
+          return false;
+        }
+      }
       if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
           if (
@@ -3526,6 +3633,7 @@ export default {
       this.detailsHidden = false;
       let data = row || this.ids;
       getWarehousebills(data.fId).then((response) => {
+        console.log(response)
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
           this.$set(this.form, "fEta", Date.parse(this.form.fEta));
@@ -3793,7 +3901,7 @@ export default {
       this.$refs["form"].validate((valid) => {
         for (let warehouseCr in this.dataListSelection) {
           if (this.dataListSelection[warehouseCr].fBillstatus != 30) {
-            this.$message.error("请先卸货");
+            this.$message.error("请先打印");
             return false;
           }
           if (!this.dataListSelection[warehouseCr].fGrossweight) {
@@ -3808,10 +3916,10 @@ export default {
             this.$message.error("请维护出库件数");
             return false;
           }
-          if (!this.dataListSelection[warehouseCr].fPackagespecs) {
-            this.$message.error("请维护包装规格");
-            return false;
-          }
+          // if (!this.dataListSelection[warehouseCr].fPackagespecs) {
+          //   this.$message.error("请维护包装规格");
+          //   return false;
+          // }
         }
         if (valid) {
           let formData = new window.FormData();
@@ -3991,7 +4099,7 @@ export default {
         }
       });
     },
-     // 货按钮
+     // 货按钮
     discharge() {
      if (this.Printinglist.length > 0) {
         for (let warehouseCr in this.Printinglist) {
@@ -4058,13 +4166,13 @@ export default {
               }
               // }
             }
-                this.msgSuccess("货成功");
+                this.msgSuccess("货成功");
                 this.$refs.tableList.clearSelection();
               });
             }
           });
       } else {
-        this.$message.error("请选择需要货的明细!");
+        this.$message.error("请选择需要货的明细!");
       }
     },
     // 付款信息计价单位合计
@@ -4150,57 +4258,80 @@ export default {
     },
     /** 提交按钮 */
     submitForm(status) {
+      if(status === 2) {
+             this.preservation()
+          }else {
+            this.pleaseCheck()
+        }
+    },
+     // 提交保存保存成功
+    preservation() {
       this.$refs["form"].validate((valid) => {
-        console.log(this.dataList);
-        if (status === 2) {
-          if (valid) {
-            this.form.fBillstatus = status;
-            this.form.fNetweight = this.fNetweight;
-            this.form.fPlangrossweight = this.fPlangrossweight;
-            this.form.fPlannetweight = this.fPlannetweight;
-            this.form.fPlanvolumn = this.fPlanvolumn;
-            this.form.fPlanqty = this.fPlanqty;
-            this.form.fGrossweight = this.fGrossweight;
-            this.form.fQty = this.fQty;
-            if (!this.form.fId) {
-              this.form.fId = this.fid;
-            }
-            let formData = new window.FormData();
-            // 附件数据
-            formData.append("tWarehouseBills", JSON.stringify(this.form));
-            // 库存明细
-            formData.append(
-              "tWarehousebillsitems",
-              JSON.stringify(this.dataList)
-            );
-            // 附件数据
-            formData.append(
-              "tWhgenleg",
-              JSON.stringify(this.relevantAttachments)
-            );
-            // 费用明细付款
-            formData.append(
-              "tWarehousebillsfeesCr",
-              JSON.stringify(this.warehouseCrList)
-            );
-            // 收款
-            formData.append(
-              "tWarehousebillsfeesDr",
-              JSON.stringify(this.warehouseDrList)
-            );
-            addWarehousebills(formData).then((response) => {
-              console.log(response)
-              this.msgSuccess("提交成功");
-              if (status === 2) {
-                this.open = true;
-              } else {
-                this.open = false;
-              }
-              this.getList();
-            });
+        if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = this.fNetweight;
+          this.form.fPlangrossweight = this.fPlangrossweight;
+          this.form.fPlannetweight = this.fPlannetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          this.form.fPlanqty = this.fPlanqty;
+          this.form.fGrossweight = this.fGrossweight;
+          this.form.fQty = this.fQty;
+          if (!this.form.fId) {
+            this.form.fId = this.fid;
           }
-        } else {
-          if (this.dataList.length === 0) {
+        }
+      });
+       let formDatae = new window.FormData();
+          // 附件数据
+          formDatae.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(this.form);
+          // 库存明细
+          formDatae.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          console.log(this.dataList);
+          // 附件数据
+          formDatae.append(
+            "tWhgenleg",
+            JSON.stringify(this.relevantAttachments)
+          );
+          console.log(this.relevantAttachments);
+          // 费用明细付款
+          formDatae.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+           console.log(this.warehouseCrList);
+          // 收款
+          formDatae.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+          console.log(formDatae)
+      addWarehousebills(formDatae).then((response) => {
+            this.msgSuccess("保存成功");
+            this.dataList = response.data.warehousebillsitems;
+            console.log(response.data.warehousebillsitems)
+            console.log(this.dataList)
+            // for (let list in this.dataList) {
+            //   this.$set(
+            //     this.dataList[list],
+            //     "fGoodsids",
+            //     Date.parse(this.dataList[list].fGoodsid + '')
+            //   );
+            // }
+            this.fid = response.data.warehouseBills.fId;
+              // this.open = true;
+            this.getList();
+            return true
+          });
+          return false
+    },
+    // 请核成功
+    pleaseCheck () {
+      this.$refs["form"].validate((valid) => {
+           if (this.dataList.length === 0) {
             this.$message.error("请新增库存明细!");
             return false;
           }
@@ -4259,49 +4390,59 @@ export default {
               return false;
             }
           }
-          if (valid) {
-            this.form.fBillstatus = status;
-            this.form.fNetweight = this.fNetweight;
-            this.form.fPlangrossweight = this.fPlangrossweight;
-            this.form.fPlannetweight = this.fPlannetweight;
-            this.form.fPlanvolumn = this.fPlanvolumn;
-            this.form.fPlanqty = this.fPlanqty;
-            this.form.fGrossweight = this.fGrossweight;
-            this.form.fQty = this.fQty;
-            if (!this.form.fId) {
-              this.form.fId = this.fid;
-            }
-            let formData = new window.FormData();
-            // 附件数据
-            formData.append("tWarehouseBills", JSON.stringify(this.form));
-            // 附件数据
-            formData.append(
-              "tWhgenleg",
-              JSON.stringify(this.relevantAttachments)
-            );
-            // // 费用明细付款
-            formData.append(
-              "tWarehousebillsfeesCr",
-              JSON.stringify(this.warehouseCrList)
-            );
-            // // 收款
-            formData.append(
-              "tWarehousebillsfeesDr",
-              JSON.stringify(this.warehouseDrList)
-            );
-            // // 库存明细
-            formData.append(
-              "tWarehousebillsitems",
-              JSON.stringify(this.dataList)
-            );
-            addWarehousebills(formData).then((response) => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+        if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = this.fNetweight;
+          this.form.fPlangrossweight = this.fPlangrossweight;
+          this.form.fPlannetweight = this.fPlannetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          this.form.fPlanqty = this.fPlanqty;
+          this.form.fGrossweight = this.fGrossweight;
+          this.form.fQty = this.fQty;
+          if (!this.form.fId) {
+            this.form.fId = this.fid;
           }
         }
-      });
+      
+       let formData = new window.FormData();
+          // 附件数据
+          formData.append("tWarehouseBills", JSON.stringify(this.form));
+          console.log(this.form);
+          // 库存明细
+          formData.append(
+            "tWarehousebillsitems",
+            JSON.stringify(this.dataList)
+          );
+          // 附件数据
+          formData.append(
+            "tWhgenleg",
+            JSON.stringify(this.relevantAttachments)
+          );
+          // 费用明细付款
+          formData.append(
+            "tWarehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+          // 收款
+          formData.append(
+            "tWarehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+      addWarehousebills(formData).then((response) => {
+            this.msgSuccess("提交成功");
+            this.dataList = response.data.warehousebillsitems;
+            for (let list in this.dataList) {
+              this.$set(
+                this.dataList[list],
+                "fBsdate",
+                Date.parse(this.dataList[list].fBsdate)
+              );
+            }
+            this.fid = response.data.warehouseBills.fId;
+              this.open = false;
+            this.getList();
+          });
+          });
     },
     /** 删除按钮操作 */
     handleDelete(row) {