tong 4 سال پیش
والد
کامیت
278ba0c2a3
3فایلهای تغییر یافته به همراه161 افزوده شده و 90 حذف شده
  1. 1 0
      src/views/basicdata/corps/index.vue
  2. 143 83
      src/views/warehouseBusiness/inStock/index.vue
  3. 17 7
      src/views/warehouseBusiness/outStock/index.vue

+ 1 - 0
src/views/basicdata/corps/index.vue

@@ -649,6 +649,7 @@
       getList() {
         this.loading = true;
         listCorps(this.queryParams).then(response => {
+          console.log(response)
           this.corpsList = response.rows;
           this.total = response.total;
           this.loading = false;

+ 143 - 83
src/views/warehouseBusiness/inStock/index.vue

@@ -167,10 +167,10 @@
       <el-table-column
         label="入库日期"
         align="center"
-        prop="fcreatetime"
+        prop="fBsdate"
         width="180"
         ><template slot-scope="scope">
-          <span>{{ parseTime(scope.row.fcreatetime, "{y}-{m}-{d}") }}</span>
+          <span>{{ parseTime(scope.row.fBsdate, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -184,7 +184,7 @@
       <el-table-column label="入库件数" align="center" prop="fQty" />
       <!--      <el-table-column label="入库毛重" align="center" prop="fGrossweight"/>-->
       <!-- <el-table-column label="货转客户名称" align="center" prop="fTocorpid" /> -->
-      <el-table-column label="入库毛重" align="center" prop="fgrossweight" />
+      <el-table-column label="入库毛重" align="center" prop="fGrossweight" />
 
       <el-table-column label="净重" align="center" prop="fNetweight" />
 
@@ -207,6 +207,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
+            v-if="scope.row.fBillstatus !== '6'"
             @click="handleDelete(scope.row)"
             v-hasPermi="['warehouseBusiness:warehousebills:remove']"
             >删除
@@ -342,6 +343,7 @@
           <el-col :span="8">
             <el-form-item label="存货编号" prop="fBscorpno">
               <el-input
+                disabled
                 v-model="form.fBscorpno"
                 style="width: 250px"
                 laceholder="存货编号"
@@ -605,6 +607,7 @@
         tooltip-effect="dark"
         border
         stripe
+        :summary-method="getSummaries"
         show-summary
       >
         <el-table-column label="序号" type="index" width="80">
@@ -1063,8 +1066,8 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fFeeunitid"
-              placeholder="请选择计单位"
+              v-model="scope.row.fFeeUnitid"
+              placeholder="请选择计单位"
               clearable
             >
               <el-option
@@ -1272,7 +1275,7 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="fFeeunitid"
+          prop="fFeeUnitid"
           header-align="center"
           align="center"
           width="180px"
@@ -1280,16 +1283,18 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fFeeunitid"
-              placeholder="请选择计费单位"
-              clearable
+              v-model="scope.row.fFeeUnitid"
+              filterable
+              remote
+              :remote-method="corpsRemoteMethod"
+              placeholder="计价单位"
             >
               <el-option
-                v-for="(dict,index) in jFeetunitOptions"
+                v-for="(dict, index) in jFeetunitOptions"
                 :key="index.dictValue"
                 :label="dict.dictLabel"
                 :value="dict.dictValue"
-              />
+              ></el-option>
             </el-select>
           </template>
         </el-table-column>
@@ -1439,7 +1444,8 @@
           @click="showEditDialog_s"
           >入库单
         </el-button>
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm(2)">暂 存</el-button>
+        <el-button type="primary" @click="submitForm(6)">提 交</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
       <el-dialog
@@ -1740,6 +1746,7 @@ export default {
   },
   data() {
     return {
+      fPlangrossweight: 0,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -1887,9 +1894,6 @@ export default {
         fWarehouseid: [
           { required: true, message: "请选择仓库", trigger: "blur" },
         ],
-        fBscorpno: [
-          { required: true, message: "请输入存货编号", trigger: "blur" },
-        ],
         fbillingway: [
           {
             required: true,
@@ -1915,7 +1919,7 @@ export default {
     });
     this.getDicts("data_unitfees").then((response) => {
       this.fFeetunitOptions = response.data;
-      this.jFeetunitOptions = response.data;
+      this.jFeetunitOptions = JSON.parse(JSON.stringify(response.data))
     });
     this.getDicts("data_stltype_type").then((response) => {
       this.fStltypeOptions = response.data;
@@ -1964,23 +1968,27 @@ export default {
     },
     // 添加list
     addRelevant() {
+      let time = null
+      if (this.form.fBsdate) {
+        time = this.form.fBsdate
+      }
       this.dataList.push({
-        fbsdate: null,
-        fgoodsid: null,
-        fcntrtype: null,
+        fBsdate: time,
+        fGoodsid: null,
+        fCntrtype: null,
         fCntqty: null,
-        fplangrossweight: null,
-        fplanvolumn: null,
-        fplanqty: null,
-        fgrossweight: null,
-        fqty: null,
+        fPlangrossweight: null,
+        fPlanvolumn: null,
+        fPlanqty: null,
+        fGrossweight: null,
+        fQty: null,
         fPackagespecs: null,
-        fwarehouselocid: null,
+        fWarehouselocid: null,
         fBoxno: null,
         fGoodsval: null,
-        ftruckno: null,
+        fTruckno: null,
         remark: null,
-      });
+      })
     },
     // 收货单打印界面
     showEditDialog_s() {
@@ -1992,11 +2000,11 @@ export default {
     // 收款信息
     addCollection() {
       this.warehouseDrList.push({
-        fcorpid: null,
-        ffeeid: null,
-        ffeeUnitid: null,
+        fCorpid: null,
+        fFeeid: null,
+        fFeeUnitid: null,
         fQty: null,
-        funitprice: null,
+        fUnitprice: null,
         fAmount: null,
         fCurrency: null,
         fCxrate: null,
@@ -2006,17 +2014,17 @@ export default {
     },
     addpayment() {
       this.warehouseCrList.push({
-        fcorpid: null,
-        ffeeid: null,
-        ffeeUnitid: null,
+        fCorpid: null,
+        fFeeid: null,
+        fFeeUnitid: null,
         fQty: null,
-        funitprice: null,
+        fUnitprice: null,
         fAmount: null,
         fCurrency: null,
         fCxrate: null,
         fRate: null,
         remarks: null,
-      });
+      })
     },
     queryUser() {
       queryUserVal().then((response) => {
@@ -2037,6 +2045,7 @@ export default {
     getList() {
       this.loading = true;
       listWarehousebills(this.queryParams).then((response) => {
+        console.log(response)
         this.warehousebillsList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -2164,30 +2173,84 @@ export default {
       this.reset();
       const fId = row.fId || this.ids;
       getWarehousebills(fId).then((response) => {
-        console.log(response)
-        this.form = response.data.warehousebills;
-        this.fMblnoOptions = response.data.corps;
-        this.KHblnoOptions = response.data.corps;
-        this.fSbuOptions = response.data.corps;
+        this.form = response.data.warehousebills
+        this.fMblnoOptions = response.data.corps
+        this.KHblnoOptions = response.data.corps
+        this.fSbuOptions = response.data.corps
         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 + '')
         this.dataList = response.data.warehouseBillsItem;
         for (let list in this.dataList) {
-          this.$set(this.dataList[list], 'fBsdate', this.dataList[list].fBsdate)
+          this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
         }
         this.goodsOptions = response.data.goodsList
         this.kqhouseOptions = response.data.warehouseAreas
         this.relevantAttachments = response.data.enclosures
         this.warehouseDrList = response.data.warehousebillsfeesDr
+        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.$set(this.form, "fBsdate", Date.parse(response.data.warehousebills.fBsdate))
+        this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate))
         this.open = true;
         this.title = "修改仓库主(出入库)";
       });
     },
+    // 合计
+    getSummaries (param) {
+      console.log(param)
+        const {columns, data} = param
+         const sums = []
+         var values = []
+      columns.forEach((column, index) => {
+        if (column.property === 'fPlangrossweight') {
+            values = data.map(item => Number(item['fPlangrossweight']))
+          }
+          if (column.property === 'fPlannetweight') {
+            values = data.map(item => Number(item['fPlannetweight']))
+          }
+          if (column.property === 'fPlanvolumn') {
+            values = data.map(item => Number(item['fPlanvolumn']))
+          }
+          if (column.property === 'fPlanqty') {
+            values = data.map(item => Number(item['fPlanqty']))
+          }
+          if (column.property === 'fGrossweight') {
+            values = data.map(item => Number(item['fGrossweight']))
+          }
+          if (column.property === 'fNetweight') {
+            values = data.map(item => Number(item['fNetweight']))
+          }
+          if (column.property === 'fQty') {
+            values = data.map(item => Number(item['fQty']))
+          }
+        
+        // const values = data.map(item => Number(item[column.property]))
+        if (column.property === 'fPlangrossweight' || column.property === 'fPlannetweight' || column.property === 'fPlanvolumn'|| column.property === 'fPlanqty'|| column.property === 'fGrossweight'|| column.property === 'fNetweight'|| column.property === 'fQty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+            // if (column.property === 'fPlangrossweight') {
+            //       this.fPlangrossweight = prev + curr
+            //     }
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          // sums[index]
+        }
+      })
+    this.sums = sums
+   return sums
+
+    },
     // 数量计算
     changeContractAmt(row) {
       if (row.fUnitprice !== "") {
@@ -2223,14 +2286,8 @@ export default {
       }
     },
     /** 提交按钮 */
-    submitForm() {
-      if (
-        typeof this.form.fBillstatus === "undefined" ||
-        this.form.fBillstatus == null || this.dataList
-      ) {
-        this.form.fBillstatus = 6;
-      }
-
+    submitForm(status) {
+      console.log(this.dataList)
       this.$refs["form"].validate((valid) => {
         if (this.dataList.length ===  0) {
           this.$message.error('请添加库存明细!')
@@ -2253,63 +2310,66 @@ export default {
             this.$message.error('请输入品名!')
             return false
           }
-        }
-        for (let list in this.dataList) {
           if (!this.dataList[list].fWarehouselocid) {
             this.$message.error('请输入库区!')
             return false
           }
         }
-        for (let list in this.relevantAttachments) {
-          if (this.relevantAttachments[list].fName === null) {
+        for (let relevant in this.relevantAttachments) {
+          if (!this.relevantAttachments[relevant].fName) {
             this.$message.error('请输入附件名称!')
             return false
           }
         }
-        for (let list in this.warehouseDrList) {
-          if (!this.warehouseDrList[list].fCorpid) {
+        for (let warehouseDr in this.warehouseDrList) {
+          if (!this.warehouseDrList[warehouseDr].fCorpid) {
             this.$message.error('请选择客户名称')
             return false
           }
-
+          if (!this.warehouseDrList[warehouseDr].fFeeid) {
+            this.$message.error('请选择费用名称')
+            return false
+          }
+          if (!this.warehouseDrList[warehouseDr]) {
+            this.$message.error('请选择收款计费单位')
+            return false
+          }
         }
-        for (let list in this.warehouseCrList) {
-          if (!this.warehouseDrList[list].fCorpid) {
+        for (let warehouseCr in this.warehouseCrList) {
+          if (!this.warehouseCrList[warehouseCr].fCorpid) {
             this.$message.error('请选择客户名称')
             return false
           }
+          if (!this.warehouseCrList[warehouseCr].fFeeid) {
+            this.$message.error('请选择费用名称')
+            return false
+          }
+          if (!this.warehouseCrList[warehouseCr].fFeeUnitid) {
+            this.$message.error('请选择付款计费单位')
+            return false
+          }
         }
         if (valid) {
+          this.form.fBillstatus = status;
+          this.form.fNetweight = "333";
           let formData = new window.FormData();
           // 附件数据
-          formData.append("tWarehouseBills", JSON.stringify(this.form));
+          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)
-          );
-          // // 库存明细
-          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.msgSuccess("提交成功");
             this.open = false;
             this.getList();
-          });
+          })
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {

+ 17 - 7
src/views/warehouseBusiness/outStock/index.vue

@@ -342,6 +342,7 @@
           <el-col :span="8">
             <el-form-item label="存货编号" prop="fBscorpno">
               <el-input
+                disabled
                 v-model="form.fBscorpno"
                 style="width: 250px"
                 laceholder="存货编号"
@@ -612,6 +613,15 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item label="唛头" prop="fbarks">
+              <el-input
+                v-model="form.fMarks"
+                style="width: 250px"
+                placeholder="唛头"
+              />
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
       <div class="dialogTableTitle flex a-center jlr">
@@ -1436,7 +1446,8 @@
           @click="showEditDialog_s"
         >出库单
         </el-button>
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm(2)">暂 存</el-button>
+        <el-button type="primary" @click="submitForm(6)">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
       <!-- 选择库存总账数据 -->
@@ -2105,7 +2116,7 @@
         this.warehouseDrList.push({
           fcorpid: null,
           ffeeid: null,
-          ffeeUnitid: null,
+          fFeeUnitid: null,
           fQty: null,
           funitprice: null,
           fAmount: null,
@@ -2119,7 +2130,7 @@
         this.warehouseCrList.push({
           fcorpid: null,
           ffeeid: null,
-          ffeeUnitid: null,
+          fFeeUnitid: null,
           fQty: null,
           funitprice: null,
           fAmount: null,
@@ -2348,10 +2359,9 @@
       },
       /** 提交按钮 */
       submitForm() {
-        console.log(this.dataList)
-        if(typeof this.form.fBillstatus === 'undefined' || this.form.fBillstatus==null) {
-          this.form.fBillstatus = 6;
-        }
+        // if(typeof this.form.fBillstatus === 'undefined' || this.form.fBillstatus==null) {
+        //   this.form.fBillstatus = 6;
+        // }
         
         this.$refs["form"].validate((valid) => {
           if (this.dataList.length ===  0) {