tong 4 роки тому
батько
коміт
eac75d497f

+ 67 - 9
src/views/warehouseBusiness/inStock/index.vue

@@ -198,7 +198,15 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            @click="handleUpdate(scope.row, true)"
+            v-hasPermi="['warehouseBusiness:warehousebills:edit']"
+            >查看
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row, false)"
             v-hasPermi="['warehouseBusiness:warehousebills:edit']"
             >修改
           </el-button>
@@ -304,6 +312,7 @@
                 v-model="form.fStorekeeper"
                 filterable
                 remote
+                :disabled="browseStatus"
                 style="width: 250px"
                 :remote-method="userRemoteMethod"
                 placeholder="请选择仓管员"
@@ -322,6 +331,7 @@
               <el-select
                 v-model="form.fWarehouseid"
                 filterable
+                :disabled="browseStatus"
                 remote
                 style="width: 250px"
                 :remote-method="warehouseRemoteMethod"
@@ -517,6 +527,7 @@
             <el-form-item label="单据编号" prop="fBillno">
               <el-input
                 v-model="form.fBillno"
+                disabled
                 style="width: 250px"
                 placeholder="单据编号"
               />
@@ -1745,6 +1756,15 @@ export default {
   },
   data() {
     return {
+      // 修改查看状态
+      browseStatus: false,
+      fPlangrossweight:"",
+      fPlannetweight:"",
+      fPlanvolumn: "",
+      fPlanqty: "",
+      fGrossweight:"",
+      fNetweight:"",
+      fQty:"",
       fPlangrossweight: 0,
       // 遮罩层
       loading: true,
@@ -1885,6 +1905,9 @@ export default {
         fTrademodeid: [
           { required: true, message: "请选择贸易方式", trigger: "blur" },
         ],
+        fSbu: [
+          { required: true, message: "请选择经营单位", trigger: "blur" },
+        ],
         fStorekeeper: {
           required: true,
           message: "请输入仓管员",
@@ -2045,11 +2068,12 @@ 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
       });
     },
-    // 贸易方式(数据字典),对t_trademodels 字典翻译
+    // 贸易方式(数据字典),对���t_trademodels 字典翻译
     fTrademodeidFormat(row, column) {
       return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
     },
@@ -2167,7 +2191,10 @@ export default {
       this.title = "入库单";
     },
     /** 修改按钮操作 */
-    handleUpdate(row) {
+    handleUpdate(row, status) {
+      console.log(status)
+      console.log(this.form)
+      this.browseStatus = status
       this.reset();
       const fId = row.fId || this.ids;
       getWarehousebills(fId).then((response) => {
@@ -2178,6 +2205,8 @@ export default {
         this.fWbuOptions = response.data.feesList
         this.warehouseOptions = response.data.warehouse;
         this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
+        this.$set(this.form,'fEta', Date.parse(this.form.fEta))
+        this.$set(this.form,'createTime', Date.parse(this.form.createTime))
         this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
         this.dataList = response.data.warehouseBillsItem;
         for (let list in this.dataList) {
@@ -2197,7 +2226,7 @@ export default {
         this.userOptions = response.data.sysUser;
         this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate))
         this.open = true;
-        this.title = "修改仓库主(出入库)";
+        this.title = "修改仓入库)";
       });
     },
     // 合计
@@ -2207,6 +2236,10 @@ export default {
          const sums = []
          var values = []
       columns.forEach((column, index) => {
+        if (index === 0) {
+              sums[index] = '总价'
+                return
+              }
         if (column.property === 'fPlangrossweight') {
             values = data.map(item => Number(item['fPlangrossweight']))
           }
@@ -2234,9 +2267,27 @@ export default {
           sums[index] = values.reduce((prev, curr) => {
             const value = Number(curr)
             if (!isNaN(value)) {
-            // if (column.property === 'fPlangrossweight') {
-            //       this.fPlangrossweight = prev + curr
-            //     }
+            if (column.property === 'fPlangrossweight') {
+                  this.fPlangrossweight = prev + curr
+                }
+            if (column.property === 'fPlannetweight') {
+                this.fPlannetweight = prev + curr
+            }
+            if (column.property === 'fPlanvolumn') {
+                this.fPlanvolumn = prev + curr
+            }
+            if (column.property === 'fPlanqty') {
+                this.fPlanqty = prev + curr
+            }
+            if (column.property === 'fGrossweight') {
+                this.fGrossweight = prev + curr
+            }
+            if (column.property === 'fNetweight') {
+                this.fNetweight = prev + curr
+            }
+            if (column.property === 'fQty') {
+                this.fQty = prev + curr
+            }
               return prev + curr
             } else {
               return prev
@@ -2285,7 +2336,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm(status) {
-      console.log(this.dataList)
+      console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (this.dataList.length ===  0) {
           this.$message.error('请添加库存明细!')
@@ -2349,7 +2400,14 @@ export default {
         }
         if (valid) {
           this.form.fBillstatus = status;
-          this.form.fNetweight = "333";
+          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;
+          console.log(this.amt)
           let formData = new window.FormData();
           // 附件数据
           formData.append("tWarehouseBills", JSON.stringify(this.form))

+ 106 - 24
src/views/warehouseBusiness/outStock/index.vue

@@ -38,7 +38,7 @@
       </el-form-item>
       <el-form-item label="贸易方式" prop="ftrademodeid">
         <el-input
-          v-model="queryParams.ftrademodeid"
+          v-model="queryParams.frademodeid"
           placeholder="请输入贸易方式"
           clearable
           size="small"
@@ -74,7 +74,7 @@
       </el-form-item>
       <el-form-item label="货物名称" prop="fgoodsid">
         <el-select
-          v-model="queryParams.fgoodsid"
+          v-model="queryParams.fgoodsids"
           placeholder="请选择货物名称"
           clearable
           size="small"
@@ -165,12 +165,12 @@
       <el-table-column label="提单号" align="center" prop="fMblno" />
       <el-table-column label="经营单位" align="center" prop="fSbu" />
       <el-table-column
-        label="库日期"
+        label="库日期"
         align="center"
-        prop="fcreatetime"
+        prop="createTime"
         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
@@ -181,10 +181,10 @@
       />
       <el-table-column label="仓库" align="center" prop="fWarehouseid" />
 
-      <el-table-column label="库件数" align="center" prop="fQty" />
+      <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']"
           >删除
@@ -238,14 +239,14 @@
       >
         <el-row>
           <el-col :span="8">
-            <el-form-item label="货权方" prop="fCorpid">
+            <el-form-item label="货权方" prop="fCorpid">
               <el-select
                 v-model="form.fCorpid"
                 filterable
                 remote
                 style="width: 250px"
                 :remote-method="corpsRemoteMethod"
-                placeholder="请选择货权方"
+                placeholder="请选择货权方"
               >
                 <el-option
                   v-for="(dict,index) in fMblnoOptions"
@@ -328,8 +329,8 @@
                 placeholder="请选择仓库"
               >
                 <el-option
-                  v-for="dict in warehouseOptions"
-                  :key="dict.fId"
+                  v-for="(dict,index) in warehouseOptions"
+                  :key="index.fId"
                   :label="dict.fName"
                   :value="dict.fId"
                 ></el-option>
@@ -508,7 +509,7 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="经营单位" prop="fsbu">
+            <el-form-item label="经营单位" prop="fSbu">
               <el-select
                 v-model="form.fSbu"
                 filterable
@@ -518,8 +519,8 @@
                 placeholder="请选择经营单位"
               >
                 <el-option
-                  v-for="dict in fSbuOptions"
-                  :key="dict.fId"
+                  v-for="(dict,index) in fSbuOptions"
+                  :key="index.fId"
                   :label="dict.fName"
                   :value="dict.fId"
                 ></el-option>
@@ -636,6 +637,7 @@
         tooltip-effect="dark"
         border
         stripe
+        :summary-method="getSummaries"
         show-summary
       >
         <el-table-column label="序号" type="index" width="80">
@@ -657,7 +659,7 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="fgoodsid"
+          prop="fGoodsid"
           header-align="center"
           align="center"
           width="140px"
@@ -665,8 +667,9 @@
         >
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.fGoodsid"
+              v-model="scope.row.fGoodsids"
               filterable
+              disabled
               remote
               :remote-method="goodsRemoteMethod"
               placeholder="请选择品名"
@@ -788,6 +791,7 @@
               v-model="scope.row.fWarehouselocid"
               filterable
               remote
+              disabled
               :remote-method="kqhouseRemoteMethod"
               placeholder="请选择库区"
             >
@@ -987,7 +991,7 @@
         <el-table-column label="序号" type="index" width="80">
         </el-table-column>
         <el-table-column
-          prop="fcorpid"
+          prop="fCorpid"
           header-align="center"
           align="center"
           width="180px"
@@ -1215,7 +1219,7 @@
         <el-table-column label="序号" type="index" width="80">
         </el-table-column>
         <el-table-column
-          prop="fcorpid"
+          prop="fCorpid"
           header-align="center"
           align="center"
           width="180px"
@@ -1825,6 +1829,9 @@
     },
     data() {
       return {
+        fGrossweight: '',
+        fNetweight: '',
+        fQty: '',
         // 遮罩层
         loading: true,
         // 选中数组
@@ -1959,6 +1966,7 @@
         form: {
           fMblno: null,
           fCorpid: null,
+          fTrademodeid: null,
           fWarehouseid: null
         },
         // 表单校验
@@ -1983,6 +1991,9 @@
           fTrademodeid: [
           { required: true, message: "请选择贸易方式", trigger: "blur" },
         ],
+        fSbu: [
+          { required: true, message: "请选择经营方式", trigger: "blur" },
+        ],
           fStorekeeper: {
             required: true,
             message: "请输入仓管员",
@@ -2069,9 +2080,10 @@
       // 添加list
       addRelevant() {
         let corpidStatus = typeof this.form.fCorpid === 'undefined' || this.form.fCorpid == null || this.form.fCorpid === ''
+        let ftrademodeids = typeof this.form.fTrademodeid === 'undefined' || this.form.fTrademodeid == null || this.form.fTrademodeid === ''
         let warehouseidStatus = typeof this.form.fWarehouseid === 'undefined' || this.form.fWarehouseid == null || this.form.fWarehouseid === ''
-        if (corpidStatus || warehouseidStatus) {
-          this.$message({ message: '请维护货权方和仓库', type: 'warning' })
+        if (corpidStatus || warehouseidStatus || ftrademodeids) {
+          this.$message({ message: '请维护货权方、仓库、贸易方式', type: 'warning' })
           return false
         }
         this.whgenlegList = []
@@ -2095,7 +2107,7 @@
             fNetweight: null,
             fQty: null,
             fPackagespecs: null,
-            fWarehouselocid: this.dialogWhgenlegList[whgen].fWarehouseLocationid,
+            fWarehouselocid: this.dialogWhgenlegList[whgen].fWarehouseLocationids,
             fCntrno: this.dialogWhgenlegList[whgen].fCntrno,
             fGoodsval: null,
             fTruckno: null,
@@ -2159,6 +2171,7 @@
         this.loading = true;
         listWarehousebills(this.queryParams).then((response) => {
           this.warehousebillsList = response.rows;
+          console.log(response.rows)
           this.total = response.total;
           this.loading = false;
         });
@@ -2168,6 +2181,8 @@
         this.whgenlegParams.fMblno = this.form.fMblno
         this.whgenlegParams.fCorpid = this.form.fCorpid
         this.whgenlegParams.fWarehouseid = this.form.fWarehouseid
+        this.whgenlegParams.fTrademodeid = this.form.fTrademodeid
+        
         listWhgenleg(this.whgenlegParams).then(response => {
           this.whgenlegList = response.rows
           this.whgenlegTotal = response.total
@@ -2295,7 +2310,6 @@
         this.reset();
         const fId = row.fId || this.ids;
         getWarehousebills(fId).then((response) => {
-          console.log(response)
           this.form = response.data.warehousebills;
           // this.fMblnoOptions = []
           this.fMblnoOptions = response.data.corps;
@@ -2308,6 +2322,17 @@
           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
@@ -2320,7 +2345,7 @@
         );
         
           this.open = true;
-          this.title = "修改出库)";
+          this.title = "修改出库";
         });
       },
       // 数量计算
@@ -2357,8 +2382,58 @@
           }
         }
       },
+      // 合计
+      getSummaries (param) {
+      console.log(param)
+        const {columns, data} = param
+         const sums = []
+         var values = []
+      columns.forEach((column, index) => {
+      if (index === 0) {
+                  sums[index] = '总价'
+                    return
+                  }
+        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 === 'fgrossweight' || column.property === 'fnetweight' || column.property === 'fqty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+            if (column.property === 'fgrossweight') {
+                  this.form.fGrossweight = prev + curr
+                }
+            if (column.property === 'fnetweight') {
+                this.form.fNetweight = prev + curr
+            }
+            if (column.property === 'fqty') {
+                this.form.fQty = prev + curr
+            }
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          // sums[index]
+        }
+      })
+    this.sums = sums
+   return sums
+
+    },
       /** 提交按钮 */
-      submitForm() {
+      submitForm(status) {
+        console.log(this.form.fGrossweight)
+        console.log(this.dataList)
         // if(typeof this.form.fBillstatus === 'undefined' || this.form.fBillstatus==null) {
         //   this.form.fBillstatus = 6;
         // }
@@ -2386,6 +2461,12 @@
             return false
           }
         }
+        for (let list in this.dataList) {
+          if (this.dataList[list].fQty === '') {
+            this.$message.error('请输入出库件数!')
+            return false
+          }
+        }
         for (let list in this.relevantAttachments) {
             if (this.relevantAttachments[list].fName ===  null) {
           this.$message.error('请输入附件名称!')
@@ -2407,6 +2488,7 @@
         
          }
           if (valid) {
+            this.form.fBillstatus = status;
             let formData = new window.FormData();
             // 附件数据
             formData.append("tWarehouseBills", JSON.stringify(this.form));