Forráskód Böngészése

导入库存总账修改

lichao 3 éve
szülő
commit
916998701c
1 módosított fájl, 281 hozzáadás és 124 törlés
  1. 281 124
      src/views/Warehousing/outStock/AddOrUpdate.vue

+ 281 - 124
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -2287,7 +2287,7 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="9">
+          <el-col :span="7">
             <el-form-item
                 label="入库日期区间"
                 prop="orgStorageDate"
@@ -2305,84 +2305,178 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-
-        </el-row>
-        <el-row :gutter="10">
-          <div class="tabSetting">
-            <el-button
-              type="cyan"
-              icon="el-icon-search"
-              @click="getDetailsList()"
-              style="margin-right: 10px"
-            >搜索
-            </el-button
-            >
-            <el-button
-              icon="el-icon-setting"
-              circle
-              @click="showSetting2 = !showSetting2"
-            ></el-button>
-          </div>
+          <el-col span="2">
+            <div class="tabSetting">
+              <el-button
+                type="cyan"
+                icon="el-icon-search"
+                @click="getDetailsList()"
+                style="margin-right: 10px"
+              >搜索
+              </el-button
+              >
+              <el-button
+                icon="el-icon-setting"
+                circle
+                @click="showSetting2 = !showSetting2"
+              ></el-button>
+            </div>
+          </el-col>
         </el-row>
+<!--        <el-row :gutter="10">-->
+<!--          -->
+<!--        </el-row>-->
       </el-form>
 
-      <el-table
-          :data="whgenlegList"
-          ref="table"
-          tooltip-effect="dark"
-          width="100%"
-          stripe
-          @selection-change="whgenlegSelectionChange"
-      >
-        <el-table-column type="selection" width="50"></el-table-column>
-        <el-table-column
-            v-for="(item, index) in getRowList2"
-            :key="index"
-            :label="item.name"
-            :width="item.width"
-            :prop="item.label"
-            align="center"
-            :fixed="item.fixed"
-            sortable
-        >
-          <template slot-scope="scope">
+      <el-tabs v-model="activeName">
+        <el-tab-pane label="查询结果" name="searchList">
+          <el-table
+            :data="whgenlegList"
+            ref="table"
+            tooltip-effect="dark"
+            width="100%"
+            stripe
+            @selection-change="whgenlegSelectionChange"
+          >
+            <el-table-column type="selection" width="50"></el-table-column>
+            <el-table-column
+              v-for="(item, index) in getRowList2"
+              :key="index"
+              :label="item.name"
+              :width="item.width"
+              :prop="item.label"
+              align="center"
+              :fixed="item.fixed"
+              sortable
+            >
+              <template slot-scope="scope">
             <span v-if="item.label == 'fGoodsid'">
               {{ scope.row.fGoodsid | goodsFormat(goodsOptions) }}
             </span>
-            <span v-else-if="item.label == 'fQtyblc2'">
+                <span v-else-if="item.label == 'fQtyblc2'">
               <el-input
-                  @change="qtyChange(scope.row)"
-                  v-model="scope.row.fQtyblc2"
-                  placeholder="件数"
+                @change="qtyChange(scope.row)"
+                v-model="scope.row.fQtyblc2"
+                placeholder="件数"
               />
             </span>
-            <span v-else-if="item.label == 'fGrossweightblc2'">
+                <span v-else-if="item.label == 'fGrossweightblc2'">
               <el-input
-                  v-model="scope.row.fGrossweightblc2"
-                  @change="changeOutStock(scope.row)"
-                  placeholder="毛重"
+                v-model="scope.row.fGrossweightblc2"
+                @change="changeOutStock(scope.row)"
+                placeholder="毛重"
               />
             </span>
-            <span v-else-if="item.label == 'fNetweightblc2'">
+                <span v-else-if="item.label == 'fNetweightblc2'">
               <el-input
-                  v-model="scope.row.fNetweightblc2"
-                  @change="changeOutStock(scope.row)"
-                  placeholder="净重"
+                v-model="scope.row.fNetweightblc2"
+                @change="changeOutStock(scope.row)"
+                placeholder="净重"
               />
             </span>
-            <span v-else>{{ scope.row[item.label] }}</span>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination
-          v-show="whgenlegTotal > 0"
-          :total="whgenlegTotal"
-          :page.sync="whgenlegParams.pageNum"
-          :limit.sync="whgenlegParams.pageSize"
-          @pagination="getDetailsList"
-      />
+                <span v-else>{{ scope.row[item.label] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="操作"
+              align="center"
+              class-name="small-padding fixed-width"
+              min-width="70"
+              fixed="right">
+              <template slot-scope="scope">
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="importStagList(scope.row)"
+                  :disabled="stagingList.findIndex(item => item.fId == scope.row.fId) !== -1"
+                >选择
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <pagination
+            v-show="whgenlegTotal > 0"
+            :total="whgenlegTotal"
+            :page.sync="whgenlegParams.pageNum"
+            :limit.sync="whgenlegParams.pageSize"
+            @pagination="getDetailsList"
+          />
+        </el-tab-pane>
+        <el-tab-pane label="已选定数据" name="importStaging">
+          <el-table
+            :data="stagingList"
+            ref="table"
+            tooltip-effect="dark"
+            width="100%"
+            stripe
+          >
+            <el-table-column type="index" width="50" label="#"></el-table-column>
+            <el-table-column
+              v-for="(item, index) in getRowList2"
+              :key="index"
+              :label="item.name"
+              :width="item.width"
+              :prop="item.label"
+              align="center"
+              :fixed="item.fixed"
+              sortable
+            >
+              <template slot-scope="scope">
+            <span v-if="item.label == 'fGoodsid'">
+              {{ scope.row.fGoodsid | goodsFormat(goodsOptions) }}
+            </span>
+                <span v-else-if="item.label == 'fQtyblc2'">
+              <el-input
+                @change="qtyChange(scope.row)"
+                v-model="scope.row.fQtyblc2"
+                placeholder="件数"
+              />
+            </span>
+                <span v-else-if="item.label == 'fGrossweightblc2'">
+              <el-input
+                v-model="scope.row.fGrossweightblc2"
+                @change="changeOutStock(scope.row)"
+                placeholder="毛重"
+              />
+            </span>
+                <span v-else-if="item.label == 'fNetweightblc2'">
+              <el-input
+                v-model="scope.row.fNetweightblc2"
+                @change="changeOutStock(scope.row)"
+                placeholder="净重"
+              />
+            </span>
+                <span v-else>{{ scope.row[item.label] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="操作"
+              align="center"
+              class-name="small-padding fixed-width"
+              min-width="70"
+              fixed="right">
+              <template slot-scope="{row, $index}">
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-delete"
+                  @click="removeStagList($index)"
+                >移除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+<!--          <pagination-->
+<!--            v-show="stagingTotal > 0"-->
+<!--            :total="stagingTotal"-->
+<!--            :page.sync="stagingParams.pageNum"-->
+<!--            :limit.sync="stagingParams.pageSize"-->
+<!--          />-->
+        </el-tab-pane>
+      </el-tabs>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="whgenlegData()"
+        <el-button type="primary" @click="whgenlegData()" :disabled="stagingList.length === 0 && dialogWhgenlegList.length === 0"
         >导入库存总账
         </el-button
         >
@@ -4140,6 +4234,12 @@ export default {
         orgStorageDate: null,
         fMarks: null
       },
+      stagingList: [],
+      stagingParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      stagingTotal: 0,
       stockoi: null,
       fSalesmanId: [],
       drag: false,
@@ -4408,24 +4508,24 @@ export default {
         },
         {
           surface: "5",
-          label: "fQtyblc",
-          name: "结余数量",
+          label: "fQtyblc2",
+          name: "数量",
           checked: 0,
-          width: 150,
+          width: 100,
         },
         {
           surface: "6",
-          label: "fGrossweightblc",
-          name: "结余毛重(kg)",
+          label: "fGrossweightblc2",
+          name: "毛重(kg)",
           checked: 0,
-          width: 150,
+          width: 100,
         },
         {
           surface: "7",
-          label: "fNetweightblc",
-          name: "结余净重(kg)",
+          label: "fNetweightblc2",
+          name: "净重(kg)",
           checked: 0,
-          width: 150,
+          width: 100,
         },
         {
           surface: "8",
@@ -4443,24 +4543,24 @@ export default {
         },
         {
           surface: "10",
-          label: "fQtyblc2",
-          name: "数量",
+          label: "fQtyblc",
+          name: "结余数量",
           checked: 0,
-          width: 100,
+          width: 150,
         },
         {
           surface: "11",
-          label: "fGrossweightblc2",
-          name: "毛重(kg)",
+          label: "fGrossweightblc",
+          name: "结余毛重(kg)",
           checked: 0,
-          width: 100,
+          width: 150,
         },
         {
           surface: "12",
-          label: "fNetweightblc2",
-          name: "净重(kg)",
+          label: "fNetweightblc",
+          name: "结余净重(kg)",
           checked: 0,
-          width: 100,
+          width: 150,
         },
         {
           surface: "13",
@@ -4499,6 +4599,7 @@ export default {
       // 收款金额合计
       allDrAmount: 0,
       print_fyqr: false,
+      activeName: 'searchList',
     };
   },
   computed: {
@@ -4971,52 +5072,102 @@ export default {
           ).toFixed(2)
       );
     },
+    removeStagList(index) {
+      this.stagingList.splice(index, 1)
+      this.stagingTotal--
+    },
+    importStagList(row) {
+      this.stagingList.push(row);
+      this.stagingTotal++
+    },
     whgenlegData() {
-      if (this.dialogWhgenlegList.length === 0) {
-        this.$message({message: "未勾选信息", type: "warning"});
-        return false;
-      }
-      this.dialogWhgenlegList.map((e) => {
-        this.detailList.push({
-          fBsdate: this.form.fBsdate,
-          fId: null,
-          fMblno: e.fMblno,
-          fGoodsid: e.fGoodsid,
-          fCntrtype: null,
-          fPlanqty: e.fQtyblc,
-          fPlannetweight: e.fNetweightblc,
-          fPlangrossweight: e.fGrossweightblc,
-          fWarehouseLocationids: e.fWarehouseLocationids,
-          fGoodsids: e.fGoodsids,
-          fBillingway: e.fBillingway,
-          fChargedate: e.fChargedate,
-          fMarks: e.fMarks,
-          fOriginalbilldate: e.fOriginalbilldate,
-          fOriginalbillno: e.fOriginalbillno,
-          fPackagespecs: e.fPackagespecs,
-          fGrossweight: e.fGrossweightblc2,
-          fNetweight: e.fNetweightblc2,
-          fQty: e.fQtyblc2,
-          fCntqty: 1,
-          fBillstatus: 10,
-          fWarehouselocid: e.fWarehouseLocationid,
-          fWarehouselocids: e.fWarehouseLocationids,
-          fCntrno: e.fCntrno,
-          fGoodsval: null,
-          fTruckno: this.whgenlegList.fTruckno,
-          remark: null,
-          fIsPass: "F",
-          fDriverName: this.whgenlegList.fDriverName,
-          fDriverTel: this.whgenlegList.fDriverTel,
-          fDriverIdCar: this.whgenlegList.fDriverIdCar,
-          fBusinessType: e.fBusinessType ? e.fBusinessType.toString() : null,
-          fWarehouseInformation: e.fWarehouseids,
-          fSrcid: e.fId,
-          fSrcBsdate: e.fBsdate,
+      // if (this.dialogWhgenlegList.length === 0) {
+      //   this.$message({message: "未勾选信息", type: "warning"});
+      //   return false;
+      // }
+      if (this.stagingList.length > 0) {
+        this.stagingList.map((e) => {
+          this.detailList.push({
+            fBsdate: this.form.fBsdate,
+            fId: null,
+            fMblno: e.fMblno,
+            fGoodsid: e.fGoodsid,
+            fCntrtype: null,
+            fPlanqty: e.fQtyblc,
+            fPlannetweight: e.fNetweightblc,
+            fPlangrossweight: e.fGrossweightblc,
+            fWarehouseLocationids: e.fWarehouseLocationids,
+            fGoodsids: e.fGoodsids,
+            fBillingway: e.fBillingway,
+            fChargedate: e.fChargedate,
+            fMarks: e.fMarks,
+            fOriginalbilldate: e.fOriginalbilldate,
+            fOriginalbillno: e.fOriginalbillno,
+            fPackagespecs: e.fPackagespecs,
+            fGrossweight: e.fGrossweightblc2,
+            fNetweight: e.fNetweightblc2,
+            fQty: e.fQtyblc2,
+            fCntqty: 1,
+            fBillstatus: 10,
+            fWarehouselocid: e.fWarehouseLocationid,
+            fWarehouselocids: e.fWarehouseLocationids,
+            fCntrno: e.fCntrno,
+            fGoodsval: null,
+            fTruckno: this.whgenlegList.fTruckno,
+            remark: null,
+            fIsPass: "F",
+            fDriverName: this.whgenlegList.fDriverName,
+            fDriverTel: this.whgenlegList.fDriverTel,
+            fDriverIdCar: this.whgenlegList.fDriverIdCar,
+            fBusinessType: e.fBusinessType ? e.fBusinessType.toString() : null,
+            fWarehouseInformation: e.fWarehouseids,
+            fSrcid: e.fId,
+            fSrcBsdate: e.fBsdate,
+          });
         });
-        console.log(this.detailList)
-      });
+      } else {
+        this.dialogWhgenlegList.map((e) => {
+          this.detailList.push({
+            fBsdate: this.form.fBsdate,
+            fId: null,
+            fMblno: e.fMblno,
+            fGoodsid: e.fGoodsid,
+            fCntrtype: null,
+            fPlanqty: e.fQtyblc,
+            fPlannetweight: e.fNetweightblc,
+            fPlangrossweight: e.fGrossweightblc,
+            fWarehouseLocationids: e.fWarehouseLocationids,
+            fGoodsids: e.fGoodsids,
+            fBillingway: e.fBillingway,
+            fChargedate: e.fChargedate,
+            fMarks: e.fMarks,
+            fOriginalbilldate: e.fOriginalbilldate,
+            fOriginalbillno: e.fOriginalbillno,
+            fPackagespecs: e.fPackagespecs,
+            fGrossweight: e.fGrossweightblc2,
+            fNetweight: e.fNetweightblc2,
+            fQty: e.fQtyblc2,
+            fCntqty: 1,
+            fBillstatus: 10,
+            fWarehouselocid: e.fWarehouseLocationid,
+            fWarehouselocids: e.fWarehouseLocationids,
+            fCntrno: e.fCntrno,
+            fGoodsval: null,
+            fTruckno: this.whgenlegList.fTruckno,
+            remark: null,
+            fIsPass: "F",
+            fDriverName: this.whgenlegList.fDriverName,
+            fDriverTel: this.whgenlegList.fDriverTel,
+            fDriverIdCar: this.whgenlegList.fDriverIdCar,
+            fBusinessType: e.fBusinessType ? e.fBusinessType.toString() : null,
+            fWarehouseInformation: e.fWarehouseids,
+            fSrcid: e.fId,
+            fSrcBsdate: e.fBsdate,
+          });
+        });
+      }
       this.whgenlegVisible = false;
+      this.stagingList = []
     },
     //撤销请核
     revoke() {
@@ -6579,7 +6730,10 @@ export default {
         if (valid) {
           this.whgenlegList = [];
           this.dialogWhgenlegList = [];
+          this.stagingList = []
           this.whgenlegTotal = 0;
+          this.stagingTotal = 0;
+          this.activeName = 'searchList'
           this.whgenlegVisible = true;
           this.$set(this.whgenlegParams, 'fMblno', this.form.fMblno)
           this.getDetailsList();
@@ -7606,6 +7760,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+/deep/ .el-tabs .el-tabs__content {
+  overflow-x: visible !important;
+}
 .tag-hover:hover {
   background-color: #d9ebfb;
 }