Browse Source

Merge branch 'live' into sit

戴艳蓉 3 years ago
parent
commit
007ba155f4
31 changed files with 1568 additions and 2183 deletions
  1. 8 0
      src/apis/service/stock/allot/detail.js
  2. 4 0
      src/assets/js/btnList.js
  3. 6 1
      src/components/search-stock-good-modal/main.vue
  4. 1 1
      src/components/search-stock/main.vue
  5. 6 4
      src/styles/index.scss
  6. 7 0
      src/utils/validate.js
  7. 8 3
      src/views/purchaseIn/storeManage/columns.js
  8. 21 1
      src/views/purchaseIn/storeManage/components/addEdit.vue
  9. 9 5
      src/views/purchaseIn/storeManage/index.vue
  10. 2 2
      src/views/stock/allot/addEdit.vue
  11. 31 7
      src/views/stock/allot/columns.js
  12. 438 0
      src/views/stock/allot/components/Inspection-table.vue
  13. 0 384
      src/views/stock/allot/components/addEdit-newApply.vue
  14. 351 296
      src/views/stock/allot/components/addForm.vue
  15. 0 574
      src/views/stock/allot/components/checkStock.vue
  16. 114 0
      src/views/stock/allot/components/columns.js
  17. 0 96
      src/views/stock/allot/components/companySearch.vue
  18. 89 109
      src/views/stock/allot/components/goStock-audit.vue
  19. 0 254
      src/views/stock/allot/components/inStock-check.vue
  20. 0 104
      src/views/stock/allot/components/stockSearch.vue
  21. 70 47
      src/views/stock/allot/detail.vue
  22. 136 55
      src/views/stock/allot/index.vue
  23. 3 9
      src/views/stock/check/detail.vue
  24. 9 65
      src/views/stock/check/index.vue
  25. 81 0
      src/views/stock/my-test/index.vue
  26. 55 0
      src/views/stock/stockCount/components/dataWeido/columns.js
  27. 9 52
      src/views/stock/stockCount/components/dataWeido/index.vue
  28. 57 0
      src/views/stock/stockCount/components/productWeido/columns.js
  29. 7 62
      src/views/stock/stockCount/components/productWeido/index.vue
  30. 44 0
      src/views/stock/stockCount/components/spaceCount/columns.js
  31. 2 52
      src/views/stock/stockCount/components/spaceCount/index.vue

+ 8 - 0
src/apis/service/stock/allot/detail.js

@@ -12,4 +12,12 @@ export default {
   update: (data, params) => http(api + "allotedit", data, "post", params),
   // 状态
   status: (data, params) => http(api + "allotstatus", data, "post", params),
+  // 出库方发货
+  allotgetont: (data, params) => http(api + "allotgetont", data, "post", params),
+  // 异常原因列表
+  resultlist: (data, params) => http(api + "resultlist", data, "post", params),
+  // 入库方验货
+  allotgetin: (data, params) => http(api + "allotgetin", data, "post", params),
+  // 入库方验货审核
+  allotvesio: (data, params) => http(api + "allotvesio", data, "post", params),
 };

+ 4 - 0
src/assets/js/btnList.js

@@ -18,5 +18,9 @@ const btnList = [
   { code: "017", name: "盘点结果上传" },
   { code: "018", name: "盘点结果审核" },
   { code: "019", name: "盘点商品导出" },
+  { code: "020", name: "入库方审核" },
+  { code: "021", name: "出库方发货" },
+  { code: "022", name: "入库方验货" },
+  { code: "023", name: "入库方验货审核" },
 ];
 export default btnList;

+ 6 - 1
src/components/search-stock-good-modal/main.vue

@@ -166,8 +166,13 @@ export default {
         this.$message.warning("只能选择一条商品信息!");
         return;
       }
+      let list=JSON.parse(JSON.stringify(selection))
+      list.map(v=>{
+        delete v['id']
+        return v
+      })
       this.showModelThis = false;
-      this.$emit("searchChange", selection);
+      this.$emit("searchChange", list);
     },
   },
 };

+ 1 - 1
src/components/search-stock/main.vue

@@ -46,7 +46,7 @@ export default {
    * @param {String}        size             : 组件大小            非必填
    * @param {Array}         value            : 选中值              必填
    * @param {String}        placeholder      : 提示信息            非必填
-   * @param {Boolean}       ssDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
    * @param {Boolean}       disabled         : 是否禁用            必填
    * @param {Boolean}       isRelation       : 是否关联公司        必填
    * @param {String}        companyCode      : 关联公司code        必填

+ 6 - 4
src/styles/index.scss

@@ -414,12 +414,14 @@ aside {
   .dropzone .dz-preview.dz-image-preview{
     background: transparent!important;
   }
-  .el-collapse-item__wrap{
-    overflow-y: scroll!important;
-    max-height: 500px!important;
+  // .el-collapse-item__wrap{
+  //   overflow-y: scroll!important;
+  //   max-height: 500px!important;
+  // }
+  .el-collapse-item__content{
+    padding:0!important;
   }
 
-
   .el-table__expanded-cell[class*=cell] {
     // padding: 20px 20px 20px 50px!important;
   }

+ 7 - 0
src/utils/validate.js

@@ -187,6 +187,13 @@ export function isChinese(s) {
 export function isnumber(s) {
   return /^[0-9]*$/.test(s)
 }
+/**
+ * 数字或者带小数点的数字
+ * @param {*} s
+ */
+ export function isnumber2(s) {
+  return /^(([^0][0-9]+|0)\.([0-9]{1,2}))$/.test(s)
+}
 /**
  * 数字字母
  * @param {*} s

+ 8 - 3
src/views/purchaseIn/storeManage/columns.js

@@ -1,7 +1,8 @@
 export default [
      {
           prop: "bk_code",
-          label: "申请编号",
+          label: "申请编码",
+          width:"160"
         },
         {
           prop: "apply_name",
@@ -11,19 +12,22 @@ export default [
         {
           prop: "good_name",
           label: "商品名称",
+          'min-width':"120",
         },
         {
           prop: "good_type_code",
-          label: "商品属性",
+          label: "商品属性编码",
+          width:"140",
         },
         {
           prop: "good_num",
           label: "数量",
-          width: "50",
+          'min-width':"50"
         },
         {
           prop: "lasttime",
           label: "最晚入库时间",
+          width:"150",
         },
         {
           prop: "status",
@@ -35,6 +39,7 @@ export default [
           prop: "addtime",
           label: "创建时间",
           sortable: true,
+          width:"150",
         },
         {
           prop: "",

+ 21 - 1
src/views/purchaseIn/storeManage/components/addEdit.vue

@@ -200,8 +200,27 @@ export default {
   mounted() {
     this.routerId = this.$route.query.id;
     this.searchList();
+    this.initForm();
   },
   methods: {
+    async initForm() {
+      this.loading = true;
+      // await this.getRole();
+      if (this.id === "add") {
+        this.rulesThis = this.rules;
+        await this.resetForm();
+      } else {
+        if (this.isDetail) {
+          this.rulesThis = {};
+        } else {
+          this.rulesThis = this.rules;
+        }
+        console.log(this.id);
+        await this.resetForm();
+        // await this.initData();
+      }
+      this.loading = false;
+    },
     // 获取备库详情
     async searchList() {
       this.loading = true;
@@ -280,6 +299,7 @@ export default {
       console.log("closeModel!!");
       this.$emit("closeModel");
     },
+    // 重置
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
@@ -334,7 +354,7 @@ export default {
               title,
               message: "",
             });
-
+            this.$emit("closeModel");
             this.routeGoto("storeManage", {});
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();

+ 9 - 5
src/views/purchaseIn/storeManage/index.vue

@@ -37,22 +37,24 @@
                     @timeReturned="handleTime"
                   />
                 </el-col>
-                <!-- 商品编码 -->
+                <!-- 商品名称 -->
                 <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
                     placeholder="商品名称"
                     v-model="parmValue.good_name"
                     clearable
+                    @blur="searchList"
                   />
                 </el-col>
                 <!-- 备货申请编码 -->
-                <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                <el-col :span="4" style="width: 195px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
                     v-model="parmValue.bk_code"
                     :maxlength="40"
                     placeholder="备货申请编码"
+                    @blur="searchList"
                   />
                 </el-col>
                 <el-col :span="4" style="width: 54px">
@@ -104,7 +106,6 @@
           </div>
         </template>
         <template #status="{ scope }">
-          <!--  :type="scope.row.status == '0' ? 'warning' : ''" -->
           <el-tag
             :size="tablebtnSize"
             :type="
@@ -218,7 +219,7 @@ export default {
   methods: {
     // 选择时间操作
     handleTime(e) {
-      console.log(e);
+      // console.log(e);
       if (e && e.startTime && e.endTime) {
         this.parmValue.start = e.startTime;
         this.parmValue.end = e.endTime;
@@ -228,6 +229,8 @@ export default {
       }
       if (this.parmValue.start != "" && this.parmValue.end != "") {
         this.searchList();
+      } else if (this.parmValue.start === "" && this.parmValue.end === "") {
+        this.searchList();
       }
     },
     // 点击详情操作
@@ -267,13 +270,14 @@ export default {
     // 列表搜索
     async searchList() {
       this.loading = true;
-      let { start, end, page, size, good_name } = this.parmValue;
+      let { start, end, page, size, good_name, bk_code } = this.parmValue;
       let model = {
         start,
         end,
         page,
         size,
         good_name,
+        bk_code,
       };
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {

+ 2 - 2
src/views/stock/allot/addEdit.vue

@@ -15,7 +15,7 @@
   >
     <el-row :gutter="10" style="margin-top: -20px">
       <el-col :span="24">
-        <add-form v-if="showModelThis" :id="id" @closeModel="closeModel"    @refresh="refresh" />
+        <add-form v-if="showModelThis" :id="id" @closeModel="closeModel"  :sitem="{}"   @refresh="refresh" />
       </el-col>
     </el-row>
   </el-dialog>
@@ -26,7 +26,7 @@ import resToken from "@/mixins/resToken";
 import AddForm from "./components/addForm"; //新建表单
 export default {
   name: "allot",
-  props: ["showModel", "id", "isDetail", "sitem"],
+  props: ["showModel", "id",  "sitem"],
   mixins: [resToken],
   components: {
     AddForm,

+ 31 - 7
src/views/stock/allot/columns.js

@@ -9,27 +9,51 @@ export default [
   },
 
   {
-    prop: "wsm_out_name",
+    prop: "name",
     label: "出库仓库名称",
-    width: "172"
+    width: "95"
   },
 
   {
-    prop: "wsm_out",
+    prop: "wsm_code",
     label: "出库仓库编号",
     width: "172"
   },
+  {
+    prop: "rname",
+    label: "出库仓库所在公司",
+    width: "172"
+  },
+
+  {
+    prop: "code",
+    label: "出库仓库所在公司编号",
+    width: "145"
+  },
+
   {
     prop: "wsm_in_name",
     label: "入库仓库名称",
-    width: "172"
+    width: "95"
 
   },
   {
-    prop: "wsm_in",
+    prop: "wsm_in_code",
     label: "入库仓库编号",
     width: "172"
 
+  },
+  {
+    prop: "tname",
+    label: "入库仓库所在公司名称",
+    width: "172"
+
+  },
+  {
+    prop: "rcode",
+    label: "入库仓库所在公司编号",
+    width: "145"
+
   },
   {
     prop: "apply_name",
@@ -40,11 +64,11 @@ export default [
     prop: "status",
     label: "调拨状态",
     _slot_: "status",
-    width: "120px",
+    width: "130px",
   },
   {
     prop: "addtime",
-    label: "申请时间",
+    label: "创建时间",
     width: "145px",
   },
   {

+ 438 - 0
src/views/stock/allot/components/Inspection-table.vue

@@ -0,0 +1,438 @@
+<template>
+  <el-row class="addForm">
+    <el-col :span="24">
+      <el-form
+        :model="tableForm"
+        :rules="tableFormThis"
+        ref="tableForm"
+        :size="'mini'"
+        class="demo-tableForm product_go"
+      >
+        <el-table
+          :data="tableForm.product_go"
+          border
+          :size="'mini'"
+          row-key="key"
+        >
+          <template v-for="(item, index) in columns">
+            <el-table-column
+              :prop="item.prop"
+              show-overflow-tooltip
+              :label="item.label"
+              v-if="
+                item.type === 'text' && item.show && item.prop !== 'error_code'
+              "
+              :width="item.width"
+              :min-width="item.minWidth"
+              :key="item.prop + index"
+            />
+            <el-table-column
+              :prop="item.prop"
+              :label="item.label"
+              v-else-if="
+                item.type === 'text' && item.show && item.prop === 'error_code'
+              "
+              :width="item.width"
+              :min-width="item.minWidth"
+              :key="item.prop + index"
+            >
+              <template slot-scope="scope">
+                <span class="spscope">{{ scope.row.error_code_name }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              :prop="item.prop"
+              :label="item.label"
+              v-else-if="item.type !== 'text' && item.show"
+              :width="item.width"
+              :min-width="item.minWidth"
+              :key="item.prop + index"
+            >
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'product_go.' + scope.$index + '.' + item.prop"
+                  :rules="scope.row.edit ? tableFormThis[item.prop] : {}"
+                  :size="'mini'"
+                >
+                  <el-input
+                    v-if="scope.row.edit === true && item.type === 'input'"
+                    :size="'mini'"
+                    maxlength="250"
+                    clearable
+                    v-model="scope.row[item.prop]"
+                  />
+                  <el-select
+                    v-model="scope.row[item.prop]"
+                    v-if="scope.row.edit === true && item.type === 'select'"
+                    style="width: 100%"
+                    clearable
+                    placeholder="异常原因"
+                    @change="elSelectChange($event, scope.$index)"
+                  >
+                    <el-option
+                      v-for="item in options"
+                      :key="item.result_code"
+                      :label="item.result"
+                      :value="item.result_code"
+                      :disabled="item.status === '0'"
+                    >
+                    </el-option>
+                  </el-select>
+                  <span v-if="!scope.row.edit" class="spscope">{{
+                    item.type === "select"
+                      ? scope.row.error_code_name
+                      : scope.row[item.prop]
+                  }}</span>
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </template>
+
+          <el-table-column
+            fixed="right"
+            v-if="
+              (status == '3' && powers.some((item) => item == '022')) ||
+              (status == '4' && powers.some((item) => item == '023'))
+            "
+            label="操作"
+            width="80"
+          >
+            <template slot-scope="scope">
+              <el-tooltip
+                effect="dark"
+                content="编辑"
+                v-if="!scope.row.edit"
+                placement="top"
+              >
+                <i
+                  class="el-icon-edit tb-icon"
+                  @click="editRow(scope.$index)"
+                ></i>
+              </el-tooltip>
+
+              <el-tooltip
+                effect="dark"
+                content="保存"
+                v-if="scope.row.edit"
+                placement="top"
+              >
+                <i
+                  class="el-icon-circle-check tb-icon"
+                  @click="checkRow(scope.$index)"
+                ></i>
+              </el-tooltip>
+
+              <el-tooltip effect="dark" content="重置" placement="top">
+                <i
+                  class="el-icon-refresh-left tb-icon"
+                  @click="resetRow(scope.$index)"
+                ></i>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+    </el-col>
+    <el-col :span="24" style="text-align: right; padding: 10px 0 0 0">
+      <el-button
+        type="primary"
+        :size="'mini'"
+        @click="submitForm"
+        v-if="
+          (status == '3' && powers.some((item) => item == '022')) ||
+          (status == '4' && powers.some((item) => item == '023'))
+        "
+        >保 存
+      </el-button>
+    </el-col>
+  </el-row>
+</template>
+   <script>
+import asyncRequest from "@/apis/service/stock/allot/detail";
+import resToken from "@/mixins/resToken";
+import { isnumber } from "@/utils/validate";
+import config from "./columns"; //表格列参数
+export default {
+  name: "allot",
+  props: ["id", "sitem", "newTime"],
+  mixins: [resToken],
+  computed: {
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "allotDetail"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      options: [],
+      status: "",
+      loading: false,
+      tableForm: {
+        product_go: [], //出库商品
+      },
+      tableFormThis: config.tableFormThis,
+      columns: [],
+    };
+  },
+  watch: {
+    newTime: function (val) {
+      if (val) {
+        this.initForm();
+      }
+    },
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      this.columns = [];
+      await this.getresultlist();
+      await this.resetForm();
+      this.loading = false;
+    },
+    async getresultlist() {
+      const res = await asyncRequest.resultlist({
+        page: 1,
+        size: 100,
+        status: "",
+      });
+      if (res && res.code === 0 && res.data) {
+        const { list } = res.data;
+        this.options = list;
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.tableForm) {
+          this.$refs.tableForm.resetFields();
+          this.$refs.tableForm.clearValidate();
+          const { item, status } = this.sitem;
+          this.status = status;
+          let columnsList = JSON.parse(JSON.stringify(config.columns));
+          columnsList.forEach((v1) => {
+            if (this.status == "5" || this.status == "4") {
+              v1.show = true;
+            }
+            if (this.status == "4" && v1.prop === "stock_num") {
+              v1.type = "input";
+              v1.width = "150px";
+            }
+            if (this.status == "3") {
+              if (v1.prop === "error_remark" || v1.prop === "error_num") {
+                v1.show = true;
+                v1.width = "150px";
+                v1.type = "input";
+              }
+              if (v1.prop === "error_code") {
+                v1.show = true;
+                v1.width = "150px";
+                v1.type = "select";
+              }
+            }
+            this.columns.push(v1);
+          });
+          this.tableForm.product_go = [];
+          let list = JSON.parse(JSON.stringify(item));
+          //  item || []; //出库商品
+          list.forEach((v) => {
+            v.usable_stock = v.usable_num;
+            v.type_code = v.good_type_code;
+            v.error_num = v.error_num || "0";
+            v.error_code = v.error_code || "";
+            v.error_code_name = v.error_code_name || "";
+            v.error_remark = v.error_remark || "";
+            v.stock_num = v.stock_num || "0";
+            v.edit = false;
+            this.tableForm.product_go.push(v);
+          });
+        }
+      });
+    },
+
+    async submitForm() {
+      let index = -1,
+        good = [];
+      this.tableForm.product_go.forEach((v, i) => {
+        if (v.edit && index === -1) {
+          index = i;
+        }
+      });
+      if (index !== -1) {
+        this.$message.warning("当前已有商品正在编辑!");
+        return;
+      }
+      this.loading = true;
+      good = this.getGoodList();
+      const model = {
+        allot_code: this.sitem.allot_code,
+        good: good,
+      };
+      let res = {};
+      if (this.status == "3") {
+        res = await asyncRequest.allotgetin(model);
+      } else {
+        res = await asyncRequest.allotvesio(model);
+      }
+
+      this.loading = false;
+      if (res && res.code === 0) {
+        this.$notify.success({
+          title:
+            this.status == "3"
+              ? "入库方验货结果提交成功!"
+              : "入库方验货审核结果提交成功",
+          message: "",
+        });
+
+        this.$emit("refresh");
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+    //提交表单前 商品信息list 汇总
+    getGoodList() {
+      let oldList = JSON.parse(JSON.stringify(this.tableForm.product_go)),
+        resList = [];
+      oldList.forEach((v1) => {
+        let goodModel = {
+          good_code: v1.type_code,
+          usable_num: v1.usable_stock,
+          error_num: v1.error_num,
+          error_remark: v1.error_remark,
+          error_code: v1.error_code,
+        };
+        if (this.status === "4") {
+          goodModel.stock_num = v1.stock_num;
+        }
+
+        resList.push(goodModel);
+      });
+      return resList;
+    },
+    // 重置行操作
+    resetRow(index) {
+      if (this.status === "3") {
+        this.tableForm.product_go[index].error_num = "0";
+        this.tableForm.product_go[index].error_code = "";
+        this.tableForm.product_go[index].error_code_name = "";
+        this.tableForm.product_go[index].error_remark = "";
+      } else {
+        this.tableForm.product_go[index].stock_num = "0";
+      }
+    },
+    //异常原因筛选
+    elSelectChange(e, index) {
+      let oindex = this.options.findIndex((v) => v.result_code === e);
+      this.tableForm.product_go[index].error_code_name =
+        oindex !== -1 ? this.options[oindex].result : "";
+    },
+    //保存某一行
+    checkRow(rowIndex) {
+      const { allot_num, error_num, error_code, error_remark, stock_num } =
+        this.tableForm.product_go[rowIndex];
+      if (this.status === "3") {
+        if (!isnumber(error_num + "") || error_num === "") {
+          this.$message.warning("异常数量必须为整数!");
+          return;
+        }
+        if (parseInt(error_num + "") > parseInt(allot_num + "")) {
+          this.$message.warning("异常数量不大于调拨总数量!");
+          return;
+        }
+        if (parseInt(error_num + "") > 0 && error_code === "") {
+          this.$message.warning("请选择异常原因!");
+          return;
+        }
+        if (parseInt(error_num + "") > 0 && error_remark === "") {
+          this.$message.warning("请输入异常备注!");
+          return;
+        }
+        if (parseInt(error_num + "") === 0 && error_code !== "") {
+          this.$message.warning("异常数量为零,不用选择异常原因!");
+          return;
+        }
+        if (parseInt(error_num + "") === 0 && error_remark !== "") {
+          this.$message.warning("异常数量为零,不用填写异常备注!");
+          return;
+        }
+      } else {
+        if (!isnumber(stock_num + "" || stock_num === "")) {
+          this.$message.warning("入库数量必须为整数!");
+          return;
+        }
+        if (parseInt(stock_num + "") > parseInt(allot_num + "")) {
+          this.$message.warning("入库数量不大于调拨总数量!");
+          return;
+        }
+      }
+      this.tableForm.product_go[rowIndex].edit = false;
+    },
+    //编辑某一行
+    editRow(rowIndex) {
+      let index = this.tableForm.product_go.findIndex((v) => v.edit);
+      if (index !== -1) {
+        this.$message.warning("请完成其他行的编辑!");
+        return;
+      } else {
+        this.tableForm.product_go[rowIndex].edit = true;
+      }
+    },
+  },
+};
+</script>
+
+
+<style lang="scss" scoped>
+.allot,
+.allotDetail {
+  .label-title-model {
+    line-height: 30px;
+    width: 100%;
+    color: #909399;
+    font-weight: bold;
+    font-size: 15px;
+    padding-bottom: 12px;
+    text-align: center;
+  }
+  .product_go {
+    .el-form-item--mini.el-form-item {
+      margin: 0 !important;
+      .spscope {
+        word-break: break-all !important;
+        line-height: 23px !important;
+        padding: 0 !important;
+        margin: 0 !important;
+        list-style: none !important;
+        font-style: normal !important;
+        text-decoration: none !important;
+        border: none !important;
+        display: inline-block !important;
+        font-weight: 500 !important;
+        font-family: "Microsoft Yahei", sans-serif !important;
+        -webkit-tap-highlight-color: transparent !important;
+        -webkit-font-smoothing: antialiased !important;
+        color: #606266 !important;
+        font-size: 12px !important;
+      }
+    }
+  }
+}
+</style>
+
+   

+ 0 - 384
src/views/stock/allot/components/addEdit-newApply.vue

@@ -1,384 +0,0 @@
-<template>
-  <el-dialog
-    :title="title"
-    :center="true"
-    align="left"
-    top="5vh"
-    width="1040px"
-    @close="closeModel"
-    :close-on-click-modal="false"
-    :visible.sync="showModelThis"
-    v-loading="loading"
-    element-loading-text="拼命加载中"
-    element-loading-spinner="el-icon-loading"
-    element-loading-background="rgba(0, 0, 0, 0.8)"
-  >
-    <el-card>
-      <el-row :gutter="10">
-        <el-col :span="24">
-          <ex-table
-            v-loading="false"
-            :table="table"
-            :data="tableData"
-            :columns="columns"
-            :page="pageInfo"
-            :size="size"
-            @page-curr-change="handlePageChange"
-            @page-size-change="handleSizeChange"
-            @screen-reset="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-            @screen-submit="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-          >
-            <template #table-header="{}">
-              <div style="width: 100%; height: 40px"></div>
-            </template>
-          </ex-table>
-        </el-col>
-        <el-col :span="24" style="text-align: right; margin-top: 10px">
-          <el-button type="primary" @click="save">保 存 </el-button>
-          <!-- <el-button type="warning" @click="submitForm"
-            >保 存 并 发 起 流 程
-          </el-button> -->
-        </el-col>
-      </el-row>
-    </el-card>
-  </el-dialog>
-</template>
-   <script>
-import asyncRequest from "@/apis/service/stock/newApply";
-import resToken from "@/mixins/resToken";
-
-import {
-  isnumber,
-  isMobile,
-  validEmail,
-  isAlphanumeric,
-  isChinese,
-  isEmoticon,
-  validAlphabets,
-} from "@/utils/validate";
-export default {
-  name: "newApply",
-  props: ["showModel", "id", "isDetail", "sitem"],
-  mixins: [resToken],
-  data() {
-    const validateusername = (rule, value, callback) => {
-      // if (value === "") {
-      //   callback(new Error("账号不能为空!"));
-      // } else {
-      //   if (value.length < 6 || value.length > 18) {
-      //     callback(new Error("账号规则为6~18位数字与字母组合!"));
-      //   } else {
-      //     if (isnumber(value)) {
-      //       callback(new Error("账号规则为6~18位数字与字母组合!"));
-      //     } else if (validAlphabets(value)) {
-      //       callback(new Error("账号规则为6~18位数字与字母组合!"));
-      //     } else if (!isAlphanumeric(value)) {
-      //       callback(new Error("账号规则为6~18位数字与字母组合!"));
-      //     } else {
-      //       callback();
-      //     }
-      //   }
-      // }
-    };
-    const validatename = (rule, value, callback) => {
-      // if (value === "") {
-      //   callback(new Error("真实姓名不能为空!"));
-      // } else {
-      //   if (value.length < 2 || value.length > 12) {
-      //     callback(new Error("真实姓名规则为2~12位汉字!"));
-      //   } else {
-      //     if (!isChinese(value)) {
-      //       console.log(9999);
-      //       callback(new Error("真实姓名规则为2~12位汉字!"));
-      //     } else if (isEmoticon(value)) {
-      //       console.log(2345);
-      //       callback(new Error("真实姓名规则为2~12位汉字!"));
-      //     } else {
-      //       callback();
-      //     }
-      //   }
-      // }
-    };
-    const validatemobile = (rule, value, callback) => {
-      // if (value === "") {
-      //   callback(new Error("手机号不能为空!"));
-      // } else {
-      //   if (!isMobile(value)) {
-      //     callback(new Error("手机号格式不正确!"));
-      //   } else {
-      //     callback();
-      //   }
-      // }
-    };
-
-    const validateEmail = (rule, value, callback) => {
-      // if (value === "") {
-      //   callback();
-      // } else {
-      //   if (!validEmail(value)) {
-      //     callback(new Error("邮箱格式不正确!"));
-      //   } else {
-      //     callback();
-      //   }
-      // }
-    };
-    return {
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      tableData: [],
-      // 表格 - 参数
-      table: {
-        stripe: true,
-        border: true,
-        // _defaultHeader_: ["setcol"],
-      },
-      // 表格 - 分页
-      pageInfo: {
-        size: 15,
-        curr: 1,
-        total: 0,
-      },
-      // 表格 - 列参数
-      columns: [
-        {
-          prop: "nickname",
-          label: "商品编号",
-        },
-        {
-          prop: "role_name",
-          label: "商品名称",
-        },
-        {
-          prop: "mobile",
-          label: "数量",
-        },
-      ],
-      loading: false,
-      title: "添加账号",
-      showModelThis: this.showModel,
-      ruleForm: {
-        username: "", // 账号
-        name: "", // 真实姓名
-        mobile: "",
-        email: "",
-        role_id: "",
-        status: "1",
-        item: [],
-      },
-      rulesThis: this.rules,
-      rules: {
-        name: [
-          {
-            required: true,
-            validator: validatename,
-            trigger: "blur",
-          },
-        ],
-        username: [
-          {
-            required: true,
-            validator: validateusername,
-            trigger: "blur",
-          },
-        ],
-        mobile: [
-          {
-            required: true,
-            validator: validatemobile,
-            trigger: "blur",
-          },
-        ],
-        email: [
-          {
-            required: false,
-            validator: validateEmail,
-            trigger: "blur",
-          },
-        ],
-        role_id: [
-          {
-            required: true,
-            message: "请选择角色",
-            trigger: "change",
-          },
-        ],
-        item: [
-          {
-            type: "array",
-            required: true,
-            message: "请选择所在部门",
-            trigger: "change",
-          },
-        ],
-        status: [
-          {
-            required: true,
-            message: "请选择状态",
-            trigger: "change",
-          },
-        ],
-      },
-    };
-  },
-  watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
-      if (val) {
-        this.initForm();
-      }
-    },
-    showModelThis(val) {
-      if (!val) {
-        this.$emit("cancel");
-      }
-    },
-  },
-  methods: {
-    closeModel() {
-      console.log("closeModel!!");
-    },
-    async initForm() {
-      this.loading = true;
-      this.title = "可调拨的商品";
-      {
-        //await this.getRole();
-        // if (this.id === "add") {
-        //   this.title = "添加账号";
-        //   this.rulesThis = this.rules;
-        //   await this.resetForm();
-        // } else {
-        //   if (this.isDetail) {
-        //     this.title = "账号详情";
-        //     this.rulesThis = {};
-        //   } else {
-        //     this.title = "修改账号";
-        //     this.rulesThis = this.rules;
-        //   }
-        //   await this.resetForm(this.sitem);
-        //   // await this.initData()
-        //}
-      }
-      this.loading = false;
-    },
-    // async getRole() {
-    //   const model = {
-    //     status: "", // 状态
-    //     level: "", // 姓名
-    //     role_name: "",
-    //   };
-    //   const res = await asyncRequest.getRole(model);
-    //   if (res && res.code === 0 && res.data) {
-    //     this.roleList = res.data;
-    //     this.roleList.map((v1) => {
-    //       v1.id += "";
-    //       v1.status += "";
-    //       return v1;
-    //     });
-    //   }
-    // },
-    async initData() {
-      // const res = await asyncRequest.detail({ id: this.id });
-      // if (res && res.code === 0 && res.data) {
-      //   this.ruleForm = res.data;
-      //   this.ruleForm.role_id = this.ruleForm.role;
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.$message.warning(res.message);
-      // }
-    },
-    async resetForm(sitem) {
-      // 重置
-      await this.$nextTick(() => {
-        // if (this.$refs.ruleForm) {
-        //   this.$refs.ruleForm.resetFields();
-        //   this.$refs.ruleForm.clearValidate();
-        //   const { username, nickname, mobile, email, roleid, status, item } =
-        //     sitem;
-        //   this.ruleForm = {
-        //     username: username || "", // 账号
-        //     name: nickname || "", // 真实姓名
-        //     mobile: mobile || "",
-        //     email: email || "",
-        //     role_id: roleid || "",
-        //     status: status || "",
-        //     item: item || [],
-        //   };
-        //   if (this.id === "add" || this.isDetail) {
-        //     this.rules.username[0].required = false;
-        //   }
-        // }
-      });
-    },
-    save() {
-      console.log("点击了保存");
-      this.showModel = false;//关闭弹窗,
-    },
-    async submitForm() {
-      console.log("点击了保存并发起流程");
-      // await this.$refs.ruleForm.validate(async (valid) => {
-      //   if (valid) {
-      //     this.loading = true;
-      //     const { username, name, mobile, email, role_id, status } = JSON.parse(
-      //       JSON.stringify(this.ruleForm)
-      //     );
-      //     const model = {
-      //       id: this.id,
-      //       username: username || "", // 账号
-      //       nickname: name || "", // 真实姓名
-      //       mobile: mobile || "",
-      //       email: email || "",
-      //       role: role_id || "",
-      //       status: status || "",
-      //     };
-      //     let res = {};
-      //     if (this.id === "add") {
-      //       delete model["id"];
-      //       res = await asyncRequest.add(model);
-      //     } else {
-      //       res = await asyncRequest.update(model);
-      //     }
-      //     this.loading = false;
-      //     if (res && res.code === 0) {
-      //       const title = this.id === "add" ? "添加成功" : "修改成功";
-      //       this.$notify.success({
-      //         title,
-      //         message: "",
-      //       });
-      //       this.showModelThis = false;
-      //       // 刷新
-      //       this.$emit("refresh");
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   } else {
-      //     console.log("error submit!!");
-      //     return false;
-      //   }
-      // });
-    },
-  },
-};
-</script>
-
-   <style lang="scss" scoped>
-.setcol-table-lie {
-  display: none !important;
-}
-</style>
-   

+ 351 - 296
src/views/stock/allot/components/addForm.vue

@@ -17,20 +17,22 @@
               <search-supplier
                 :value="ruleForm.supplier_code"
                 :placeholder="'请选择公司'"
+                :is-detail="id !== 'add'"
+                :disabled="!(id === 'add')"
                 :names="supplier_name"
-                @searchChange="selectSupplier"
+                @searchChange="selectSupplierOut"
               />
             </el-form-item>
             <el-form-item label="仓库" prop="stock_code">
               <search-stock
                 :value="ruleForm.stock_code"
-                :isDetail="true"
-                :disabled="isDisabled"
+                :isDetail="id !== 'add'"
+                :disabled="!(id === 'add')"
                 :placeholder="'请选择仓库'"
                 :isRelation="true"
                 :companyCode="supplier_code"
                 :names="''"
-                @searchChange="selectStock"
+                @searchChange="selectStockOut"
               />
             </el-form-item>
           </el-col>
@@ -40,6 +42,13 @@
               <search-supplier
                 :value="ruleForm.supplier_in_code"
                 :placeholder="'请选择公司'"
+                :is-detail="id !== 'add'"
+                :disabled="
+                  !(
+                    id === 'add' ||
+                    (status === '0' && powers.some((item) => item == '005'))
+                  )
+                "
                 :names="supplier_in_name"
                 @searchChange="selectSupplierIn"
               />
@@ -47,133 +56,189 @@
             <el-form-item label="仓库" prop="stock_in_code">
               <search-stock
                 :value="ruleForm.stock_in_code"
-                :isDetail="true"
-                :disabled="isDisabledIn"
+                :isDetail="id !== 'add'"
+                :disabled="
+                  !(
+                    id === 'add' ||
+                    (status === '0' && powers.some((item) => item == '005'))
+                  )
+                "
                 :placeholder="'请选择仓库'"
                 :isRelation="true"
-                :companyCode="stock_in_code"
+                :companyCode="supplier_in_code"
                 :names="''"
                 @searchChange="selectStockIn"
               />
             </el-form-item>
           </el-col>
         </el-row>
-
-        <el-form-item
-          label="商品"
-          prop="product_go"
+      </el-form>
+    </el-col>
+    <el-col :span="24">
+      <el-row v-if="status == '' || status == '0'">
+        <el-col :span="24" style="padding: 0 0 10px 0">
+          <span>调拨商品:</span>
+          <el-button
+            :size="'mini'"
+            type="primary"
+            class="fr"
+            @click="openGoodsModel"
+            >添加商品</el-button
+          ></el-col
+        >
+      </el-row>
+      <!-- v-if="status === '0'" -->
+      <el-form
+        :model="tableForm"
+        :rules="tableFormThis"
+        v-if="
+          !(
+            (status == '3' && powers.some((item) => item == '022')) ||
+            (status == '4' && powers.some((item) => item == '023'))
+          )
+        "
+        ref="tableForm"
+        :size="'mini'"
+        class="demo-tableForm product_go"
+      >
+        <el-table
+          :data="tableForm.product_go"
+          border
           :size="'mini'"
-          class="product_go"
+          row-key="key"
         >
-          <el-row>
-            <el-col :span="24" style="padding: 0 0 10px 0">
-              <el-button
-                :size="'mini'"
-                type="primary"
-                class="fr"
-                @click="openGoodsModel"
-                >添加商品</el-button
-              ></el-col
+          <template v-for="(item, index) in columns">
+            <el-table-column
+              :prop="item.prop"
+              show-overflow-tooltip
+              :label="item.label"
+              v-if="
+                item.type === 'text' && item.show && item.prop !== 'error_code'
+              "
+              :width="item.width"
+              :min-width="item.minWidth"
+              :key="item.prop + index"
+            />
+            <el-table-column
+              :prop="item.prop"
+              :label="item.label"
+              v-else-if="
+                item.type === 'text' && item.show && item.prop === 'error_code'
+              "
+              :width="item.width"
+              :min-width="item.minWidth"
+              :key="item.prop + index"
             >
-            <el-col :span="24">
-              <!-- row-key="key" -->
-              <el-table
-                :data="ruleForm.product_go"
-                border
-                :size="'mini'"
-                row-key="key"
-                max-height="400px"
-              >
-                <template v-for="(item, index) in columns">
-                  <el-table-column
-                    v-if="item.prop !== 'allot_num'"
-                    show-overflow-tooltip
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                    :min-width="item.minWidth"
-                    :key="item.prop + index"
-                  >
-                  </el-table-column>
-                  <el-table-column
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                    :min-width="item.minWidth"
-                    :key="item.prop + index"
-                    v-else
+              <template slot-scope="scope">
+                <span class="spscope">{{ scope.row.error_code_name }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              :prop="item.prop"
+              :label="item.label"
+              v-else-if="item.type !== 'text' && item.show"
+              :width="item.width"
+              :min-width="item.minWidth"
+              :key="item.prop + index"
+            >
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'product_go.' + scope.$index + '.' + item.prop"
+                  :rules="scope.row.edit ? tableFormThis[item.prop] : {}"
+                  :size="'mini'"
+                >
+                  <el-input
+                    v-if="scope.row.edit === true && item.type === 'input'"
+                    :size="'mini'"
+                    maxlength="250"
+                    clearable
+                    v-model="scope.row[item.prop]"
+                  />
+                  <el-select
+                    v-model="scope.row[item.prop]"
+                    v-if="scope.row.edit === true && item.type === 'select'"
+                    style="width: 100%"
+                    clearable
+                    placeholder="异常原因"
+                    @change="elSelectChange($event, scope.$index)"
                   >
-                    <template slot-scope="scope">
-                      <el-form-item
-                        :prop="'list.' + scope.$index + '.' + scope.row.id"
-                        :size="'mini'"
-                      >
-                        <el-input
-                          :size="'mini'"
-                          v-model="scope.row[item.prop]"
-                          v-if="scope.row.edit"
-                        ></el-input>
-                        <span v-else class="spscope">{{
-                          scope.row[item.prop]
-                        }}</span>
-                      </el-form-item>
-                    </template>
-                  </el-table-column>
-                </template>
-
-                <el-table-column fixed="right" label="操作" width="80">
-                  <template slot-scope="scope">
-                    <el-tooltip
-                      effect="dark"
-                      content="编辑"
-                      v-if="!scope.row.edit"
-                      placement="top"
+                    <el-option
+                      v-for="item in options"
+                      :key="item.result_code"
+                      :label="item.result"
+                      :value="item.result_code"
+                      :disabled="item.status === '0'"
                     >
-                      <i
-                        class="el-icon-edit tb-icon"
-                        @click="editRow(scope.$index)"
-                      ></i>
-                    </el-tooltip>
+                    </el-option>
+                  </el-select>
+                  <span v-if="!scope.row.edit" class="spscope">{{
+                    item.type === "select"
+                      ? scope.row.error_code_name
+                      : scope.row[item.prop]
+                  }}</span>
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </template>
 
-                    <el-tooltip
-                      effect="dark"
-                      content="保存"
-                      v-if="scope.row.edit"
-                      placement="top"
-                    >
-                      <i
-                        class="el-icon-circle-check tb-icon"
-                        @click="checkRow(scope.$index)"
-                      ></i>
-                    </el-tooltip>
+          <el-table-column
+            fixed="right"
+            label="操作"
+            v-if="status === '' || status == '0'"
+            width="80"
+          >
+            <template slot-scope="scope">
+              <el-tooltip
+                effect="dark"
+                content="编辑"
+                v-if="!scope.row.edit"
+                placement="top"
+              >
+                <i
+                  class="el-icon-edit tb-icon"
+                  @click="editRow(scope.$index)"
+                ></i>
+              </el-tooltip>
 
-                    <el-tooltip effect="dark" content="删除" placement="top">
-                      <i
-                        class="el-icon-delete tb-icon"
-                        @click="deleteRow(scope.$index, ruleForm.product_go)"
-                      ></i>
-                    </el-tooltip>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-col>
-          </el-row>
-        </el-form-item>
+              <el-tooltip
+                effect="dark"
+                content="保存"
+                v-if="scope.row.edit"
+                placement="top"
+              >
+                <i
+                  class="el-icon-circle-check tb-icon"
+                  @click="checkRow(scope.$index)"
+                ></i>
+              </el-tooltip>
+
+              <el-tooltip effect="dark" content="删除" placement="top">
+                <i
+                  class="el-icon-delete tb-icon"
+                  @click="deleteRow(scope.$index, tableForm.product_go)"
+                ></i>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
       </el-form>
     </el-col>
-    <el-col :span="24" style="text-align: right">
+    <el-col :span="24" style="text-align: right; padding: 10px 0 0 0">
       <el-button
         type="primary"
         :size="'mini'"
         @click="submitForm"
-        v-if="!isDetail"
+        v-if="
+          id === 'add' ||
+          (status === '0' && powers.some((item) => item == '005'))
+        "
         >保 存
       </el-button>
     </el-col>
     <el-col :span="24">
       <search-stock-good-modal
         :show-model="showGoodsModel"
-        :code="stockCode"
+        :code="stock_code"
         @cancel="showGoodsModel = false"
         @searchChange="addGoodsRes"
       />
@@ -183,32 +248,49 @@
    <script>
 import asyncRequest from "@/apis/service/stock/allot/detail";
 import resToken from "@/mixins/resToken";
+import { isnumber } from "@/utils/validate";
+import config from "./columns"; //表格列参数
 export default {
   name: "allot",
-  props: ["showModel", "id", "isDetail", "sitem"],
+  props: ["showModel", "id", "sitem", "newTime"],
   mixins: [resToken],
+  computed: {
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "allotDetail"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
   data() {
     return {
       showGoodsModel: false,
       status: "",
-      // id: "",
       supplier_code: "",
-      stock_in_code: "",
       supplier_name: "",
+      supplier_in_code: "",
       supplier_in_name: "",
-      isDisabled: true,
-      isDisabledIn: true,
+      stock_code: "",
+      stock_in_code: "",
       loading: false,
-      title: "新建调拨申请",
       showModelThis: this.showModel,
+      delList: [],
       ruleForm: {
         supplier_code: [], //出库供应商code
         stock_code: [], //出库仓库code
         supplier_in_code: [], //入库供应商code
         stock_in_code: [], //入库仓库code
+      },
+      tableForm: {
         product_go: [], //出库商品
       },
       rulesThis: this.rules,
+      tableFormThis: config.tableFormThis,
       rules: {
         supplier_code: [
           {
@@ -242,115 +324,8 @@ export default {
             trigger: "change",
           },
         ],
-        product_go: [
-          {
-            type: "array",
-            required: true,
-            message: "请选择商品",
-            trigger: "change",
-          },
-        ],
-        type_code: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-        good_name: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-        usable_stock: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-        allot_num: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-        unit: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-        color: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-
-        material: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
-        brand: [
-          {
-            required: false,
-            message: "",
-            trigger: "blur",
-          },
-        ],
       },
-      columns: [
-        {
-          prop: "type_code",
-          label: "商品编码",
-          width: "150",
-        },
-        {
-          prop: "good_name",
-          label: "商品名称",
-          minWidth: "180",
-        },
-        {
-          prop: "usable_stock",
-          label: "可用库存数",
-          width: "100",
-        },
-        {
-          prop: "allot_num",
-          label: "调拨数量",
-          width: "140",
-        },
-
-        // {
-        //   prop: "unit",
-        //   label: "单位",
-        //   width: "45",
-        // },
-        // {
-        //   prop: "color",
-        //   label: "商品颜色",
-        //   width: "70",
-        // },
-        // {
-        //   prop: "material",
-        //   label: "商品材质",
-        //   width: "70",
-        // },
-        // {
-        //   prop: "brand",
-        //   label: "品牌",
-        //   width: "70",
-        // },
-      ],
+      columns: [],
       tableData: [],
     };
   },
@@ -366,6 +341,11 @@ export default {
         this.$emit("cancel");
       }
     },
+    newTime: function (val) {
+      if (val) {
+        this.initForm();
+      }
+    },
   },
   mounted() {
     console.log("asd");
@@ -373,11 +353,6 @@ export default {
     this.initForm();
   },
   methods: {
-    // 删除行操作
-    deleteRow(index, rows) {
-      //   console.log(index, rows);
-      rows.splice(index, 1);
-    },
     closeModel() {
       this.$emit("closeModel");
     },
@@ -387,7 +362,7 @@ export default {
         return;
       }
 
-      let index = this.ruleForm.product_go.findIndex((v) => v.edit);
+      let index = this.tableForm.product_go.findIndex((v) => v.edit);
       if (index !== -1) {
         this.$message.warning("当前已有商品正在编辑!");
         return;
@@ -401,45 +376,87 @@ export default {
       if (this.id === "add") {
         this.status = "";
       }
+      this.columns = [];
       this.rulesThis = this.rules;
       await this.resetForm();
       this.loading = false;
     },
-
-    async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
-      }
-    },
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          const { item, wsm_in, wsm_out, wsm_in_name, wsm_out_name, status } =
-            this.sitem;
-          this.supplier_code = wsm_out || "";
-          this.stock_in_code = wsm_in || "";
+          const {
+            wsm_in,
+            wsm_out,
+            wsm_in_name,
+            wsm_out_name,
+            status,
+            out_code,
+            in_code,
+          } = this.sitem;
+          this.status = status || "";
+          this.supplier_code = out_code || "";
           this.supplier_name = wsm_out_name || "";
+          this.supplier_in_code = in_code || "";
           this.supplier_in_name = wsm_in_name || "";
-          this.status = status;
+          this.stock_code = wsm_out || "";
+          this.stock_in_code = wsm_in || "";
           this.ruleForm = {
-            supplier_code: [] || [], //出库供应商code
-            stock_code: [wsm_out] || [], //出库仓库code
-            supplier_in_code: [] || [], //入库供应商code
-            stock_in_code: [wsm_in] || [], //入库仓库code
-            product_go: item||[], //出库商品
+            supplier_code: out_code ? [out_code] : [], //出库供应商code
+            stock_code: wsm_out ? [wsm_out] : [], //出库仓库code
+            supplier_in_code: in_code ? [in_code] : [], //入库供应商code
+            stock_in_code: wsm_in ? [wsm_in] : [], //入库仓库code
           };
-          this.ruleForm.product_go.map((v) => {
-            v.usable_stock = v.usable_num;
+        }
+        if (this.$refs.tableForm) {
+          this.$refs.tableForm.resetFields();
+          this.$refs.tableForm.clearValidate();
+          const { item, status } = this.sitem;
+          this.status = status || "";
+          this.tableForm.product_go = [];
+          this.delList = [];
+          let list = JSON.parse(JSON.stringify(item || []));
+          list.forEach((v) => {
+            v.usable_num = v.usable_num;
             v.type_code = v.good_type_code;
-            v.edit = false
-            return v;
+            v.error_num = v.error_num || "0";
+            v.error_code = v.error_code || "";
+            v.error_code_name = v.error_code_name || "";
+            v.error_remark = v.error_remark || "";
+            v.stock_num = v.stock_num || "0";
+            v.edit = false;
+            this.tableForm.product_go.push(v);
+          });
+          let columnsList = JSON.parse(JSON.stringify(config.columns));
+          columnsList.forEach((v1) => {
+            if (this.status == "5" || this.status == "4") {
+              v1.show = true;
+            }
+            if (this.status == "4" && v1.prop === "stock_num") {
+              v1.type = "input";
+              v1.width = "150px";
+            }
+            if (this.status == "3") {
+              if (v1.prop === "error_remark" || v1.prop === "error_num") {
+                v1.show = true;
+                v1.width = "150px";
+                v1.type = "input";
+              }
+              if (v1.prop === "error_code") {
+                v1.show = true;
+                v1.width = "150px";
+                v1.type = "select";
+              }
+            }
+            if (this.status == "0") {
+              if (v1.prop === "allot_num") {
+                v1.width = "150px";
+                v1.type = "input";
+              }
+            }
+            this.columns.push(v1);
           });
         }
       });
@@ -448,24 +465,23 @@ export default {
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
-          if (this.stockCode == this.stock_in_code) {
+          if (this.stock_code == this.stock_in_code) {
             this.$message.warning("出入库仓库不能相同!");
             return;
           }
+          if (this.tableForm.product_go.length === 0) {
+            this.$message.warning("请选择调拨商品!");
+            return;
+          }
           let index = -1,
             isok = true,
             ishas = true,
             good = [];
-          this.ruleForm.product_go.forEach((v, i) => {
-            let goodModel = {
-              good_code: v.type_code,
-              allot_num: v.allot_num,
-            };
-
+          this.tableForm.product_go.forEach((v, i) => {
             if (v.edit && index === -1) {
               index = i;
             }
-            let stock = parseInt(v.usable_stock),
+            let stock = parseInt(v.usable_num),
               num = parseInt(v.allot_num);
             if (stock === 0) {
               ishas = false;
@@ -473,8 +489,8 @@ export default {
             if (num > stock) {
               isok = false;
             }
-            good.push(goodModel);
           });
+
           if (index !== -1) {
             this.$message.warning("当前已有商品正在编辑!");
             return;
@@ -489,7 +505,7 @@ export default {
           }
 
           this.loading = true;
-
+          good = this.getGoodList();
           const { stock_code, stock_in_code } = JSON.parse(
             JSON.stringify(this.ruleForm)
           );
@@ -533,87 +549,126 @@ export default {
         }
       });
     },
+    //提交表单前 商品信息list 汇总
+    getGoodList() {
+      let oldList = JSON.parse(JSON.stringify(this.tableForm.product_go)),
+        dList = JSON.parse(JSON.stringify(this.delList)),
+        resList = [];
+      oldList.forEach((v1) => {
+        let goodModel = {
+          id: v1.id || "",
+          good_code: v1.type_code,
+          allot_num: v1.allot_num,
+          is_del: "1",
+        };
+        resList.push(goodModel);
+      });
+      dList.forEach((v2) => {
+        let goodModel = {
+          id: v2.id || "",
+          good_code: v2.type_code,
+          allot_num: v2.allot_num,
+          is_del: "0",
+        };
+        resList.push(goodModel);
+      });
+      return resList;
+    },
+    // 删除行操作
+    deleteRow(index, rows) {
+      console.log(rows[index]);
+      if (this.id !== "add" && rows[index].id) {
+        this.delList.push(rows[index]);
+      }
+      rows.splice(index, 1);
+    },
     //保存某一行
     checkRow(rowIndex) {
-      const { usable_stock, allot_num } = this.ruleForm.product_go[rowIndex];
-      let num = allot_num === "" ? "0" : allot_num;
-      if (allot_num === "0") {
-        this.$message.warning("调拨数量不能为0!");
+      const { usable_num, allot_num } = this.tableForm.product_go[rowIndex];
+      if (!isnumber(allot_num)) {
+        this.$message.warning("请输入数字!");
         return;
       }
-      if (allot_num === "") {
-        this.$message.warning("调拨数量不能为空!");
+      if (allot_num === "0") {
+        this.$message.warning("调拨数量不能为0!");
         return;
       }
-      if (parseInt(num) > parseInt(usable_stock)) {
+      if (parseInt(allot_num) > parseInt(usable_num)) {
         this.$message.warning("调拨数量不大于可用库存数!");
         return;
       }
-      this.ruleForm.product_go[rowIndex].edit = false;
+      this.tableForm.product_go[rowIndex].edit = false;
     },
     //编辑某一行
     editRow(rowIndex) {
-      let index = this.ruleForm.product_go.findIndex((v) => v.edit);
+      console.log(this.tableForm.product_go);
+      let index = this.tableForm.product_go.findIndex((v) => v.edit);
       if (index !== -1) {
         this.$message.warning("请完成其他行的编辑!");
         return;
       } else {
-        this.ruleForm.product_go[rowIndex].edit = true;
+        this.tableForm.product_go[rowIndex].edit = true;
       }
-      console.log(index);
     },
     // 执行点击商品名称的抛出事件
     addGoodsRes(e) {
-      let oldList = JSON.parse(JSON.stringify(this.ruleForm.product_go)),
+      let oldList = JSON.parse(JSON.stringify(this.tableForm.product_go)),
         addList = JSON.parse(JSON.stringify(e)),
-        newList = [].concat(...oldList);
+        newList = [].concat(...oldList),
+        dList = JSON.parse(JSON.stringify(this.delList));
+      console.log(addList);
       addList.forEach((v1, index) => {
         let oldindex = oldList.findIndex((v2) => v1.type_code === v2.type_code);
         if (oldindex === -1) {
+          addList[index].usable_num = addList[index].usable_stock;
           addList[index].allot_num = addList[index].usable_stock;
           addList[index].edit = false;
           newList.push(addList[index]);
         }
       });
-      this.ruleForm.product_go = [].concat(...newList);
-      this.$refs.ruleForm.validateField("product_go");
+      newList.forEach((v3) => {
+        let otherindex = dList.findIndex((v4) => v3.type_code === v4.type_code);
+        if (otherindex !== -1) {
+          dList.splice(otherindex, 1);
+        }
+      });
+      this.tableForm.product_go = [].concat(...newList);
+      this.delList = [].concat(...dList);
+      this.$refs.tableForm.validateField("product_go");
     },
 
-    // 选择出库仓库
-    selectStock(e) {
-      if (e && e.id) {
-        this.ruleForm.stock_code = [e.code];
-        this.stockCode = e.code;
-      } else {
-        this.ruleForm.stockCode = [];
-        this.stockCode = "";
-      }
-      this.$refs.ruleForm.validateField("stock_code");
-    },
     // 选择出库供应商
-    selectSupplier(e) {
+    selectSupplierOut(e) {
       if (e && e.id) {
         this.ruleForm.supplier_code = [e.code];
         this.supplier_code = e.code;
-        this.isDisabled = false;
       } else {
         this.ruleForm.supplier_code = [];
         this.supplier_code = "";
       }
+      this.ruleForm.stock_code = [];
+      this.tableForm.product_go = [];
+      this.delList = [];
       this.$refs.ruleForm.validateField("supplier_code");
     },
+    // 选择出库仓库
+    selectStockOut(e) {
+      if (e && e.id) {
+        this.ruleForm.stock_code = [e.code];
+        this.stock_code = e.code;
+      } else {
+        this.ruleForm.stock_code = [];
+        this.stock_code = "";
+      }
+      this.tableForm.product_go = [];
+      this.delList = [];
+      this.$refs.ruleForm.validateField("stock_code");
+    },
     // 选择入库仓库
     selectStockIn(e) {
       if (e && e.id) {
         this.ruleForm.stock_in_code = [e.code];
         this.stock_in_code = e.code;
-        if (this.stockCode == this.stock_in_code) {
-          this.$message({
-            message: "出库供应商仓库不能和入库供应商仓库相同",
-            type: "warning",
-          });
-          return;
-        }
       } else {
         this.ruleForm.stock_in_code = [];
         this.stock_in_code = "";
@@ -624,12 +679,12 @@ export default {
     selectSupplierIn(e) {
       if (e && e.id) {
         this.ruleForm.supplier_in_code = [e.code];
-        this.stock_in_code = e.code;
-        this.isDisabledIn = false;
+        this.supplier_in_code = e.code;
       } else {
         this.ruleForm.supplier_in_code = [];
-        this.stock_in_code = "";
+        this.supplier_in_code = "";
       }
+      this.ruleForm.stock_in_code = [];
       this.$refs.ruleForm.validateField("supplier_in_code");
     },
   },

+ 0 - 574
src/views/stock/allot/components/checkStock.vue

@@ -1,574 +0,0 @@
-<template>
-  <div class="newApply pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-form
-        :disabled="myType !== 2"
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="110px"
-      >
-        <el-form-item label="验货审核" prop="check_audit">
-          <ex-table
-            v-loading="false"
-            :table="table"
-            :data="tableData"
-            :columns="columns"
-            :page="pageInfo"
-            :size="size"
-            @page-curr-change="handlePageChange"
-            @page-size-change="handleSizeChange"
-            @screen-reset="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-            @screen-submit="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-          >
-            <template #table-header="{}">
-              <div style="width: 100%; height: 40px"></div>
-            </template>
-            <template #operation="{ scope }">
-              <el-tooltip
-                v-if="powers.some((item) => item == '002')"
-                effect="dark"
-                content="重置密码"
-                placement="top"
-              >
-                <i
-                  class="el-icon-refresh-left tb-icon"
-                  @click="openPasswordModal(scope.row.id, false)"
-                ></i>
-              </el-tooltip>
-
-              <el-tooltip
-                v-if="powers.some((item) => item == '007')"
-                effect="dark"
-                content="详情"
-                placement="top"
-              >
-                <i
-                  class="el-icon-view tb-icon"
-                  @click="openModal(scope.row.id, true, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="powers.some((item) => item == '005')"
-                effect="dark"
-                content="修改"
-                placement="top"
-              >
-                <i
-                  class="el-icon-edit tb-icon"
-                  @click="openModal(scope.row.id, false, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '1'
-                "
-                effect="dark"
-                content="禁用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-pause tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '0'
-                "
-                effect="dark"
-                content="启用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-play tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-            </template>
-          </ex-table>
-        </el-form-item>
-        <!-- <el-form-item label="发货物流编号" prop="expressage_sn">
-          <el-input
-            type="number"
-            :rows="2"
-            style="width: 30%"
-            placeholder="请输入物流单号"
-            :size="searchSize"
-            v-model="expressage"
-            clearable
-          >
-          </el-input>
-        </el-form-item>
-        <el-form-item label="发货物流费用" prop="expressage_cost">
-          <el-input
-            type="number"
-            style="width: 20%"
-            placeholder="请输入物流费用"
-            :size="searchSize"
-            v-model="expressage"
-            clearable
-          >
-          </el-input>
-        </el-form-item> -->
-        <el-form-item>
-          <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="save">保 存 </el-button>
-            <!-- <el-button type="warning" @click="submitForm"
-              >保 存 并 发 起 流 程
-            </el-button> -->
-          </el-col>
-        </el-form-item>
-        <!-- 入库方审核备注 -->
-
-        <!-- 物流费用 -->
-        <!-- <el-form-item label="入库仓库" prop="stock_in_rule">
-          <el-cascader
-            placeholder="请选择入库仓库"
-            filterable
-            clearable
-            :size="searchSize"
-            v-model="selectStock_in"
-            :options="options"
-            style="width: 30%"
-            @change="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              stockName();
-            "
-          ></el-cascader>
-        </el-form-item>
-        <el-form-item label="出库商品" prop="stock_go_product">
-          <ex-table
-            v-loading="false"
-            :table="table"
-            :data="tableData"
-            :columns="columns"
-            :page="pageInfo"
-            :size="size"
-            @page-curr-change="handlePageChange"
-            @page-size-change="handleSizeChange"
-            @screen-reset="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-            @screen-submit="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-          >
-            <template #table-header="{}">
-              <div style="width: 100%; height: 40px"></div>
-            </template>
-            <template #operation="{ scope }">
-              <el-tooltip
-                v-if="powers.some((item) => item == '002')"
-                effect="dark"
-                content="重置密码"
-                placement="top"
-              >
-                <i
-                  class="el-icon-refresh-left tb-icon"
-                  @click="openPasswordModal(scope.row.id, false)"
-                ></i>
-              </el-tooltip>
-
-              <el-tooltip
-                v-if="powers.some((item) => item == '007')"
-                effect="dark"
-                content="详情"
-                placement="top"
-              >
-                <i
-                  class="el-icon-view tb-icon"
-                  @click="openModal(scope.row.id, true, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="powers.some((item) => item == '005')"
-                effect="dark"
-                content="修改"
-                placement="top"
-              >
-                <i
-                  class="el-icon-edit tb-icon"
-                  @click="openModal(scope.row.id, false, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '1'
-                "
-                effect="dark"
-                content="禁用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-pause tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '0'
-                "
-                effect="dark"
-                content="启用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-play tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-            </template>
-          </ex-table>
-        </el-form-item> -->
-      </el-form>
-
-      <add-edit
-        :id="modelId"
-        :sitem="sitem"
-        :show-model="showModel"
-        :is-detail="isDetail"
-        @refresh="searchList"
-        @cancel="showModel = false"
-      />
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
-</template>
-   <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import asyncRequest from "@/mock/service/stock/newApply";
-import addEdit from "./addEdit-newApply";
-import { mapGetters } from "vuex";
-
-export default {
-  name: "allotFlow",
-  mixins: [mixinPage, resToken],
-  components: {
-    addEdit,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "allotFlow"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    return {
-      options: [
-        {
-          value: "选项1",
-          label: "顺丰",
-        },
-        {
-          value: "选项2",
-          label: "韵达",
-        },
-        {
-          value: "选项3",
-          label: "中通",
-        },
-      ],
-      value: "",
-      // selectStock_in: "", //选择的入库仓库名称
-      // selectStock_go: "", //选择的出库仓库名称
-      // stock_go: "", //出库仓库name
-      // stock_in: "", //入库仓库name
-      //   options: [], //用于渲染二级仓库名
-      ruleForm: {},
-      rules: {
-        //出入库规则
-        check_audit: [
-          {
-            required: true,
-          },
-        ],
-      },
-      expressage: "",
-      expressage_cost: 0,
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      tableData: [],
-      // 表格 - 参数
-      table: {
-        stripe: true,
-        border: true,
-        // _defaultHeader_: ["setcol"],
-      },
-      // 表格 - 分页
-      pageInfo: {
-        size: 15,
-        curr: 1,
-        total: 0,
-      },
-      // 表格 - 列参数
-      columns: [
-        {
-          prop: "nickname",
-          label: "商品编号",
-        },
-        {
-          prop: "role_name",
-          label: "商品名称",
-        },
-        {
-          prop: "mobile",
-          label: "总数量",
-        },
-        {
-          prop: "mobile",
-          label: "异常数量",
-        },
-        {
-          prop: "mobile",
-          label: "异常备注",
-        },
-        {
-          prop: "mobile",
-          label: "入库数量",
-        },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      // sitem: null,
-      // // 状态
-      // statusOptions: [
-      //   { id: "0", label: "禁用" },
-      //   { id: "1", label: "启用" },
-      // ],
-      parmValue: {
-        //入参
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 15, // 每页显示条数
-      },
-      // passwordModel: false,
-      // passwordModelId: 0,
-      // isPasswordDetail: false,
-      // statusList: statusList,
-    };
-  },
-  mounted() {
-    this.searchList();
-    // this.stockName(); //假数据,获取二级仓库名
-  },
-
-  methods: {
-    restSearch() {
-      //重置入参
-      this.parmValue = {
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 10, // 每页显示条数
-      };
-      this.searchList();
-    },
-
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    async deleteById(id, status) {
-      // await this.$confirm("确定要删除?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.$notify.success({
-      //         title: "删除成功",
-      //         message: "",
-      //       });
-      //       this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    async searchList() {
-      // this.loading = true;
-      // const res = await asyncRequest.list(this.parmValue);
-      // if (res && res.code === 0 && res.data) {
-      //   this.tableData = res.data.list;
-      //   this.pageInfo.total = Number(res.data.count);
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.tableData = [];
-      //   this.pageInfo.total = 0;
-      // }
-      // this.loading = false;
-    },
-
-    async statusConfirm(id, status) {
-      // let str = status === "1" ? "禁用" : "启用";
-      // await this.$confirm("确定要改为" + str + "?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     this.loading = true;
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.loading = false;
-      //       this.$notify.success({
-      //         title: "状态修改成功!",
-      //         message: "",
-      //       });
-      //       await this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    // async stockName() {
-    //   //获取多级仓库名称的方法
-    //   const res = await asyncRequest.listAll(this.parmValue);
-    //   // console.log(res.data);
-    //   // this.openModal("005", true);
-    //   // console.log(this.selectStock_go);
-    //   // console.log(this.selectStock_in);
-    //   // this.options = res.data;
-    //   // console.log(this.options);
-    //   let arr = res.data;
-    //   // console.log(arr);
-    //   arr.forEach((ele) => {
-    //     //重新封装后台传递来的数据,转换格式
-    //     let item = {
-    //       value: ele.id,
-    //       label: ele.name,
-    //       children: [],
-    //     };
-    //     ele.child.forEach((elem) => {
-    //       let model = {
-    //         value: elem.id,
-    //         label: elem.name,
-    //       };
-    //       item.children.push(model);
-    //     });
-    //     this.options.push(item);
-    //   });
-    //   this.options.forEach((ele) => {
-    //     //从数据表中筛选出我们要用的数据
-    //     if (ele.value === this.selectStock_go[0]) {
-    //       ele.children.forEach((elem) => {
-    //         if (elem.value === this.selectStock_go[1]) {
-    //           this.stock_go = ele.label + "/" + elem.label;
-    //         }
-    //       });
-    //     }
-    //     if (ele.value === this.selectStock_in[0]) {
-    //       ele.children.forEach((elem) => {
-    //         if (elem.value === this.selectStock_in[1]) {
-    //           this.stock_in = ele.label + "/" + elem.label;
-    //         }
-    //       });
-    //     }
-    //   });
-    //   if (this.selectStock_in != "" || this.selectStock_go != "") {
-    //     console.log("选择了一个项目");
-    //     this.openModal("005", true);
-    //   }
-    //   // console.log(this.stock_go);
-    //   // console.log(this.stock_in);
-    //   // console.log(this.pageInfo.total);
-    //   this.compareStock(); //比较出库仓库和入库仓库是否相同
-    // },
-
-    compareStock() {
-      //比较出库仓库和入库仓库是否相同
-      if (
-        this.stock_go === this.stock_in &&
-        this.stock_go !== "" &&
-        this.stock_go != ""
-      ) {
-        console.log("出库仓库和入库仓库相同");
-        this.$message({
-          message: "出库仓库不能和入库仓库相同",
-          type: "error",
-        });
-      }
-    },
-  },
-};
-</script>
-   <style lang="scss" >
-.newApply {
-}
-.el-form-item__content {
-  margin: 0 !important;
-}
-.setcol-table-lie {
-  // margin: 0 !important;
-}
-</style>
-   

+ 114 - 0
src/views/stock/allot/components/columns.js

@@ -0,0 +1,114 @@
+
+export default {
+  tableFormThis: {
+    type_code: [
+      {
+        required: false,
+        message: "",
+        trigger: "blur",
+      },
+    ],
+    good_name: [
+      {
+        required: false,
+        message: "",
+        trigger: "blur",
+      },
+    ],
+    usable_num: [
+      {
+        required: false,
+        message: "",
+        trigger: "blur",
+      },
+    ],
+    allot_num: [
+      {
+        required: false,
+        message: "",
+        trigger: "blur",
+      },
+    ],
+    error_num: [
+      {
+        required: false,
+        message: "",
+        trigger: "blur",
+      },
+    ],
+    error_code: [
+      {
+        required: false,
+        message: "",
+        trigger: "change",
+      },
+    ],
+    error_remark: [
+      {
+        required: false,
+        message: "",
+        trigger: "blur",
+      },
+    ],
+  },
+  columns: [
+    // 表格 - 列参数
+    {
+      prop: "type_code",
+      label: "商品属性编码",
+      width: "125",
+      show: true,
+      type:"text"
+    },
+    {
+      prop: "good_name",
+      label: "商品名称",
+      minWidth: "180",
+      show: true,
+      type:"text"
+    },
+    {
+      prop: "usable_num",
+      label: "可用库存数",
+      width: "100",
+      show: true,
+      type:"text"
+    },
+    {
+      prop: "allot_num",
+      label: "调拨总数量",
+      width: "100",
+      show: true,
+      type:"text"
+    },
+    {
+      prop: "error_num",
+      label: "异常数量",
+      width: "100",
+      show: false,
+      type:"text"
+    },
+    {
+      prop: "error_code",
+      label: "异常原因",
+      width: "100",
+      show: false,
+      type:"text"
+    },
+    {
+      prop: "error_remark",
+      label: "异常原因备注",
+      width: "100",
+      show: false,
+      type:"text"
+    },
+    {
+      prop: "stock_num",
+      label: "入库数量",
+      width: "100",
+      show: false,
+      type:"text"
+    },
+  ]
+
+}

+ 0 - 96
src/views/stock/allot/components/companySearch.vue

@@ -1,96 +0,0 @@
-<template>
-  <div class="companySearch" style="width: 200px; display: inline-block">
-    <div class="block" style="width: 100%">
-      <!-- <el-cascader
-        style="width: 400px"
-        :options="options"
-        v-model="value"
-        collapse-tags
-        :props="{ multiple: true, checkStrictly: false }"
-        clearable
-        filterable
-        @change="a"
-      ></el-cascader> -->
-      <el-select
-        :size="searchSize"
-        v-model="value"
-        :multiple="false"
-        filterable
-        remote
-        reserve-keyword
-        placeholder="请选择公司"
-        :remote-method="remoteMethod"
-        :loading="loading"
-        @change="a"
-      >
-        <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-    </div>
-  </div>
-</template>
-
-<script>
-import { mapGetters } from "vuex";
-
-export default {
-  data() {
-    return {
-      options: [],
-      value: [],
-      list: [],
-      states: [],
-      children: [],
-    };
-  },
-  mounted() {
-    this.list = this.states.map((item) => {
-      return { value: `value:${item}`, label: `label:${item}` };
-    });
-  },
-  computed: {
-    ...mapGetters(["searchSize"]),
-  },
-  props: ["options"],
-  methods: {
-    a() {
-      console.log("选择了一个公司");
-      console.log(this.value);
-      // console.log(this.list);
-      console.log(this.options);
-      this.$emit("searchCard", this.value);
-      this.options.forEach((element) => {
-        // console.log(element);
-        if (element.value === this.value) {
-          console.log(element.label);
-          console.log(element.children);
-          this.children = element.children;
-          this.$emit("stock", this.children);
-        }
-      });
-    },
-
-    remoteMethod(query) {
-      if (query !== "") {
-        this.loading = true;
-        setTimeout(() => {
-          this.loading = false;
-          this.options = this.list.filter((item) => {
-            return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
-          });
-        }, 200);
-      } else {
-        this.options = [];
-      }
-    },
-  },
-};
-</script>
-
-<style>
-</style>

+ 89 - 109
src/views/stock/allot/components/goStock-audit.vue

@@ -1,80 +1,64 @@
 <template>
-  <div class="newApply pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      发货物流公司
-      <el-form
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="150px"
-      >
-        <el-row>
-          <el-col :span="24"
-            ><el-form-item label="发货物流公司" prop="expressage_company">
-              <el-input
-                placeholder="请输入物流公司"
-                v-model="ruleForm.expressage_company"
-              /> </el-form-item
-          ></el-col>
-          <el-col :span="24"
-            ><el-form-item label="发货物流编号" prop="expressage_sn">
-              <el-input
-                :rows="2"
-                placeholder="请输入物流单号"
-                v-model="ruleForm.expressage_sn"
-                clearable
-              >
-              </el-input> </el-form-item
-          ></el-col>
-          <el-col :span="24"
-            ><el-form-item label="发货物流费用" prop="expressage_cost">
-              <el-input
-                type="number"
-                placeholder="请输入物流费用"
-                v-model="ruleForm.expressage_cost"
-                clearable
-              >
-                <template slot="append">元</template>
-              </el-input>
-            </el-form-item></el-col
+  <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="90px">
+    <el-row>
+      <el-col :span="12"
+        ><el-form-item label="物流公司" prop="post_name">
+          <el-input
+            placeholder="请输入物流公司"
+            :disabled="!(status == '2' && powers.some((item) => item == '021'))"
+            v-model="ruleForm.post_name"
+          />
+        </el-form-item>
+        <el-form-item label="物流费用" prop="post_fee">
+          <el-input
+            type="number"
+            placeholder="请输入物流费用"
+            :disabled="!(status == '2' && powers.some((item) => item == '021'))"
+            v-model="ruleForm.post_fee"
           >
-        </el-row>
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+      </el-col>
 
+      <el-col :span="12">
+        <el-form-item label="物流单号" prop="post_code">
+          <el-input
+            placeholder="请输入物流单号"
+            maxlength="20"
+            :disabled="!(status == '2' && powers.some((item) => item == '021'))"
+            v-model="ruleForm.post_code"
+            clearable
+          >
+          </el-input>
+        </el-form-item>
         <el-form-item>
-          <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="submitForm">保 存 </el-button>
-            <el-button type="">关 闭 </el-button>
-          </el-col>
+          <el-button
+            v-if="status == '2' && powers.some((item) => item == '021')"
+            type="primary"
+            class="fr"
+            :size="'medium'"
+            @click="submitForm"
+            >保 存
+          </el-button>
         </el-form-item>
-      </el-form>
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
+      </el-col>
+    </el-row>
+  </el-form>
 </template>
    <script>
-import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import addEdit from "./addEdit-newApply";
-import { mapGetters } from "vuex";
-import { isAlphanumeric } from "@/utils/validate";
+import asyncRequest from "@/apis/service/stock/allot/detail";
+import { isAlphanumeric, isnumber2 } from "@/utils/validate";
 export default {
   name: "allotFlow",
-  mixins: [mixinPage, resToken],
-  props: ["myType"],
-  components: {
-    addEdit,
-  },
+  mixins: [resToken],
+  props: ["id", "sitem"],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       let tran =
         this.$store.getters.btnList.find(
-          (item) => item.menu_route == "allotFlow"
+          (item) => item.menu_route == "allotDetail"
         ) || {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
@@ -86,7 +70,7 @@ export default {
   data() {
     const validateExpressSn = (rule, value, callback) => {
       if (value === "") {
-        callback(new Error("物流单号不能为空!"));
+        callback(new Error("物流单号不能为空!"));
       } else {
         if (!isAlphanumeric(value)) {
           callback(new Error("请输入正确的物流单号"));
@@ -95,84 +79,80 @@ export default {
         }
       }
     };
+    const validate_post_fee = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("物流费用不能为空!"));
+      } else {
+        if (!isnumber2(value + "")) {
+          callback(new Error("物流费用仅支持整数及两位小数!"));
+        } else {
+          callback();
+        }
+      }
+    };
     return {
+      status: "",
       ruleForm: {
-        expressage_company: "", //发货物流公司
-        expressage_sn: "", //物流单号
-        expressage_cost: 0,
+        post_name: "", //发货物流公司
+        post_code: "", //物流单号
+        post_fee: "",
       },
       rules: {
-        //出入库规则
-        expressage_company: [
+        post_name: [
           {
             required: true,
             message: "请选择发货公司",
             trigger: "blur",
           },
         ],
-        expressage_sn: [
+        post_fee: [
           {
             required: true,
-            message: "请输入物流单号",
+            validator: validate_post_fee,
             trigger: "blur",
-            validate: validateExpressSn,
           },
         ],
-        expressage_cost: [
+        post_code: [
           {
             required: true,
-            message: "请输入物流费用",
             trigger: "blur",
+            validator: validateExpressSn,
           },
         ],
       },
     };
   },
   mounted() {
-    this.searchList();
+    this.resetForm();
   },
 
   methods: {
-    restSearch() {
-      //重置入参
-      this.ruleForm = {
-        expressage_company: "", //发货物流公司
-        expressage_sn: "", //物流单号
-        expressage_cost: 0,
-      };
-      this.searchList();
-    },
-    async searchList() {
-      // this.loading = true;
-      // const res = await asyncRequest.list(this.parmValue);
-      // if (res && res.code === 0 && res.data) {
-      //   this.tableData = res.data.list;
-      //   this.pageInfo.total = Number(res.data.count);
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.tableData = [];
-      //   this.pageInfo.total = 0;
-      // }
-      // this.loading = false;
-    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { post_code, post_fee, post_name, status } = this.sitem;
+          this.status = status;
 
+          this.ruleForm = {
+            post_code,
+            post_fee: post_fee + "",
+            post_name,
+          };
+        }
+      });
+    },
     // 商品保存提交
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
-          // const { stock_code, stock_in_code, supplier_code, supplier_in_code } =
-          //   JSON.parse(JSON.stringify(this.ruleForm));
-          console.log(this.ruleForm);
-          const model = {};
-          let res = {};
-          // if (this.id === "add") {
-          //   delete model["id"];
-          //   res = await asyncRequest.add(model);
-          // } else {
-          //   res = await asyncRequest.update(model);
-          // }
+          const model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.allot_code = this.sitem.allot_code;
+          model.status = "3";
+          let res = await asyncRequest.allotgetont(model);
           this.loading = false;
           if (res && res.code === 0) {
             //

+ 0 - 254
src/views/stock/allot/components/inStock-check.vue

@@ -1,254 +0,0 @@
-<template>
-  <div class="newApply pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-form
-        :disabled="myType !== 4"
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="120px"
-      >
-        <el-form-item label="验货详情" prop="check_detail">
-          <ex-table
-            v-loading="false"
-            :table="table"
-            :data="tableData"
-            :columns="columns"
-            :page="pageInfo"
-            :size="size"
-            @page-curr-change="handlePageChange"
-            @page-size-change="handleSizeChange"
-            @screen-reset="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-            @screen-submit="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-          >
-            <template #table-header="{}">
-              <div style="width: 100%; height: 40px"></div>
-            </template>
-            <template #operation="{ scope }">
-              <el-tooltip
-                v-if="powers.some((item) => item == '002')"
-                effect="dark"
-                content="重置密码"
-                placement="top"
-              >
-                <i
-                  class="el-icon-refresh-left tb-icon"
-                  @click="openPasswordModal(scope.row.id, false)"
-                ></i>
-              </el-tooltip>
-
-              <el-tooltip
-                v-if="powers.some((item) => item == '007')"
-                effect="dark"
-                content="详情"
-                placement="top"
-              >
-                <i
-                  class="el-icon-view tb-icon"
-                  @click="openModal(scope.row.id, true, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="powers.some((item) => item == '005')"
-                effect="dark"
-                content="修改"
-                placement="top"
-              >
-                <i
-                  class="el-icon-edit tb-icon"
-                  @click="openModal(scope.row.id, false, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '1'
-                "
-                effect="dark"
-                content="禁用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-pause tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '0'
-                "
-                effect="dark"
-                content="启用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-play tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-            </template>
-          </ex-table>
-        </el-form-item>
-        <el-form-item>
-          <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="save">保 存 </el-button>
-          </el-col>
-        </el-form-item>
-      </el-form>
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
-</template>
-   
-<script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import asyncRequest from "@/apis/service/stock/newApply";
-// import asyncRequest from "@/mock/service/stock/newApply";
-import addEdit from "./addEdit-newApply";
-import { mapGetters } from "vuex";
-
-export default {
-  name: "allotFlow",
-  mixins: [mixinPage, resToken],
-  props: ["myType"],
-  components: {
-    addEdit,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "allotFlow"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    return {
-      value: "",
-      ruleForm: {},
-      rules: {
-        //出入库规则
-        check_detail: [
-          {
-            required: true,
-            message: "请选择发货公司",
-            trigger: "blur",
-          },
-        ],
-      },
-
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      tableData: [],
-      // 表格 - 参数
-      table: {
-        stripe: true,
-        border: true,
-        // _defaultHeader_: ["setcol"],
-      },
-      // 表格 - 分页
-      pageInfo: {
-        size: 15,
-        curr: 1,
-        total: 0,
-      },
-      // 表格 - 列参数
-      columns: [
-        {
-          prop: "nickname",
-          label: "商品编号",
-        },
-        {
-          prop: "role_name",
-          label: "商品名称",
-        },
-        {
-          prop: "mobile",
-          label: "总数量",
-        },
-        {
-          prop: "mobile",
-          label: "异常数量",
-        },
-        {
-          prop: "mobile",
-          label: "异常备注",
-        },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      //入参
-      parmValue: {
-        // page: 1, // 页码
-        // size: 15, // 每页显示条数
-      },
-    };
-  },
-  mounted() {
-    this.searchList();
-  },
-
-  methods: {
-    restSearch() {
-      //重置入参
-      this.parmValue = {
-        // page: 1, // 页码
-        // size: 10, // 每页显示条数
-      };
-      this.searchList();
-    },
-
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    async searchList() {
-      // this.loading = true;
-      // const res = await asyncRequest.list(this.parmValue);
-      // if (res && res.code === 0 && res.data) {
-      //   this.tableData = res.data.list;
-      //   this.pageInfo.total = Number(res.data.count);
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.tableData = [];
-      //   this.pageInfo.total = 0;
-      // }
-      // this.loading = false;
-    },
-  },
-};
-</script>
-   

+ 0 - 104
src/views/stock/allot/components/stockSearch.vue

@@ -1,104 +0,0 @@
-<template>
-  <div
-    class="stockSearch"
-    style="display: inline-block; width: 200px; padding-left: 10px"
-  >
-    {{ stockName }}
-    <div class="block">
-      <!-- <el-cascader
-        style="width: 400px"
-        :options="options"
-        v-model="value"
-        collapse-tags
-        :props="{ multiple: true, checkStrictly: false }"
-        clearable
-        filterable
-        @change="a"
-      ></el-cascader> -->
-      <el-select
-        :size="searchSize"
-        v-model="value"
-        multiple
-        filterable
-        remote
-        :disabled="companyName === ''"
-        reserve-keyword
-        placeholder="请选择仓库"
-        :remote-method="remoteMethod"
-        :loading="loading"
-        @change="a"
-      >
-        <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-    </div>
-  </div>
-</template>
-
-<script>
-import { mapGetters } from "vuex";
-
-export default {
-  data() {
-    return {
-      company_name: "",
-      options: [],
-      value: [],
-      list: [],
-      states: [],
-    };
-  },
-  mounted() {
-    this.list = this.states.map((item) => {
-      return { value: `value:${item}`, label: `label:${item}` };
-    });
-  },
-  watch: {
-    companyName: "nameChange",
-  },
-  computed: {
-    ...mapGetters(["searchSize"]),
-  },
-  props: ["options", "companyName", "stockName"],
-  methods: {
-    nameChange() {
-      console.log("选择了其他公司");
-      this.value = "";
-      // console.log(this.value);
-      console.log(this.stockName);
-      this.options = this.stockName;
-    },
-    a() {
-      console.log("选择了一个仓库");
-      this.$emit("searchCard");
-      this.company_name = this.companyName;
-      // console.log(this.companyName);
-      // console.log(this.company_name);
-      // console.log(this.value);
-    },
-    remoteMethod(query) {
-      if (query !== "") {
-        this.loading = true;
-
-        console.log(this.options);
-        // setTimeout(() => {
-        //   this.loading = false;
-        //   this.options = this.list.filter((item) => {
-        //     return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
-        //   });
-        // }, 200);
-      } else {
-        this.options = [];
-      }
-    },
-  },
-};
-</script>
-
-<style>
-</style>

+ 70 - 47
src/views/stock/allot/detail.vue

@@ -4,9 +4,7 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      {{ status }},{{ powers }}
       <div class="tr" style="padding: 10px 0">
-        <span class="fl" style="padding: 3px 0 0 3px">调拨详情</span>
         <el-button
           type="primary"
           plain
@@ -16,13 +14,6 @@
           >发起审核流程
         </el-button>
 
-        <el-button
-          type="primary"
-          :size="'mini'"
-          @click="statusConfirm('-2', '导出盘点商品')"
-          v-if="status === '1' && powers.some((item) => item == '014')"
-          >导出盘点商品
-        </el-button>
         <el-button
           @click="statusConfirm('0', '取消审核流程')"
           plain
@@ -36,35 +27,73 @@
           plain
           :size="'mini'"
           v-if="
-            (status === '0' || status === '1') &&
+            status !== '' &&
+            status !== '5' &&
             powers.some((item) => item == '015')
           "
           >作废该条信息</el-button
         >
       </div>
-      <add-form
-        :newTime="newTime"
-        v-if="newTime !== ''"
-        :sitem="sitem"
-        :id="queryId"
-      />
-      <!-- 详情 -->
+      <el-collapse v-model="activeNames" @change="handleChange">
+        <el-collapse-item title="调拨详情" name="0">
+          <add-form
+            :newTime="newTime"
+            v-if="newTime !== ''"
+            :sitem="sitem"
+            :id="queryId"
+          />
+        </el-collapse-item>
 
-      <!-- <GoStock
-        style="width: 100%"
-        v-if="$route.query.id"
-        :myType="type"
-      ></GoStock>
-      <InStockCheck
-        style="width: 100%"
-        v-if="$route.query.id"
-        :myType="type"
-      ></InStockCheck>
-      <CheckStock
-        style="width: 100%"
-        v-if="$route.query.id"
-        :myType="type"
-      ></CheckStock> -->
+        <el-collapse-item
+          title="入库方审核"
+          name="1"
+          v-if="status == '1' && powers.some((item) => item == '020')"
+        >
+          <exam-form
+            :statusList="statusList"
+            :newTime="newTime"
+            v-if="newTime !== ''"
+            :disabled="false"
+            :isMust="false"
+            @searchChange="examForm"
+          />
+        </el-collapse-item>
+        <el-collapse-item
+          title="出库方发货"
+          name="2"
+          v-if="status !== '' && status !== '0' && status !== '1'"
+        >
+          <go-stock-audit
+            :newTime="newTime"
+            :sitem="sitem"
+            v-if="newTime !== ''"
+            :id="queryId"
+            @refresh="initData()"
+          />
+        </el-collapse-item>
+        <el-collapse-item title="入库方验货" name="3" v-if="status == '3'">
+          <inspection-table
+            :newTime="newTime"
+            :sitem="sitem"
+            v-if="newTime !== ''"
+            :id="queryId"
+            @refresh="initData()"
+          />
+        </el-collapse-item>
+        <el-collapse-item
+          title="入库方验货审核"
+          name="4"
+          v-if="status == '4' "
+        >
+          <inspection-table
+            :newTime="newTime"
+            :sitem="sitem"
+            v-if="newTime !== ''"
+            :id="queryId"
+            @refresh="initData()"
+          />
+        </el-collapse-item>
+      </el-collapse>
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -75,23 +104,19 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/stock/allot/detail";
-import { mapGetters } from "vuex";
 import addForm from "./components/addForm"; //新建申请页面
-// import GoStock from "./components/goStock-audit.vue"; //出库方发货
-// import InStockCheck from "./components/inStock-check.vue"; //入库方验货
-// import CheckStock from "./components/checkStock.vue"; //验货审核
+import GoStockAudit from "./components/goStock-audit"; //出库方发货
+import InspectionTable from "./components/Inspection-table"; //入库验货 入库验货审核
 
 export default {
   name: "allotDetail",
   mixins: [mixinPage, resToken],
   components: {
     addForm,
-    // GoStock,
-    // InStockCheck,
-    // CheckStock,
+    GoStockAudit,
+    InspectionTable,
   },
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       let tran =
         this.$store.getters.btnList.find(
@@ -109,11 +134,11 @@ export default {
   },
   data() {
     return {
-      activeNames: [],
+      activeNames: ["0", "1", "2", "3", "4", "5"],
       sitem: null,
       status: "",
       newTime: "",
-      loading: true,
+      loading: false,
       queryId: "",
     };
   },
@@ -136,8 +161,6 @@ export default {
         .then(async () => {
           if (status === "-1") {
             await this.deleteById(message);
-          } else if (status === "-2") {
-            await this.exportGood(message);
           } else {
             await this.setStatus(status, message);
           }
@@ -187,9 +210,9 @@ export default {
       }
     },
     async examForm(e) {
-      if (!loading) {
+      if (!this.loading) {
         let type = e.state === "1" ? "2" : "0";
-        await this.setStatus(type, message, e.remark);
+        await this.setStatus(type, "提交入库方审核", e.remark);
       }
     },
     async initData() {
@@ -198,7 +221,7 @@ export default {
       if (res && res.code === 0 && res.data) {
         this.sitem = res.data;
         this.status = this.sitem.status;
-        this.activeNames = [this.status];
+
         //;
         this.getNewTime();
       } else if (res && res.code >= 100 && res.code <= 104) {

+ 136 - 55
src/views/stock/allot/index.vue

@@ -27,17 +27,37 @@
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
               <el-col :span="24">
-                <el-col :span="6" style="width: 292px">
+                <el-col :span="4" style="width: 160px">
+                  <el-select
+                    v-model="parmValue.status"
+                    :size="searchSize"
+                    style="width: 100%"
+                    placeholder="调拨状态"
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
+                    <el-option
+                      v-for="item in statusOptions"
+                      :key="item.id"
+                      :label="item.label"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-col>
+                <el-col :span="6" style="width: 303px; padding: 0 0 0 10px">
                   <period-date-picker
                     :type="1"
                     :width="'135px'"
-                    :title="'时间搜索'"
                     :size="searchSize"
                     @timeReturned="handleTime"
                   />
-                  <!-- @numReturned="numReturned($event, 0)" -->
                 </el-col>
-                <el-col :span="4" style="width: 220px; padding: 0 0 0 10px">
+
+                <el-col :span="4" style="width: 260px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
                     v-model="parmValue.allot_code"
@@ -56,49 +76,61 @@
                     刷新
                   </el-button>
                 </el-col>
+                <el-col :span="4" style="width: 66px; float: right">
+                  <el-button
+                    style="width: 100%"
+                    type="warning"
+                    class="mr5"
+                    :size="searchSize"
+                    @click="restSearch"
+                  >
+                    重置
+                  </el-button>
+                </el-col>
               </el-col>
             </el-row>
-            <el-row style="padding:10px 0 0 0;">
-              <!-- 入库仓库 -->
-              <el-col :span="4" style="width: 220px; ">
-                <el-input
-                  :size="searchSize"
-                  v-model="parmValue.wsm_in"
-                  :maxlength="40"
-                  placeholder="入库仓库名称"
-                />
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="4" style="width: 165px">
+                <el-dropdown @command="handleClick($event)" :size="searchSize">
+                  <el-button :size="searchSize">
+                    {{ sselect }}
+                    <i
+                      class="el-icon-arrow-down el-icon--right"
+                      :size="searchSize"
+                    ></i>
+                  </el-button>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item
+                      v-for="item in options"
+                      :key="item"
+                      :command="item"
+                      >{{ item }}</el-dropdown-item
+                    >
+                  </el-dropdown-menu>
+                </el-dropdown>
               </el-col>
-              <!-- 出库仓库 -->
-              <el-col :span="4" style="width: 230px; padding: 0 0 0 10px;">
-                <el-input
+
+              <el-col :span="4" style="width: 379px; padding: 0 0 0 10px">
+                <search-supplier
                   :size="searchSize"
-                  v-model="parmValue.wsm_out"
-                  :maxlength="40"
-                  placeholder="出库仓库名称"
+                  :value="parmValue.supplierNo"
+                  :placeholder="'公司名称'"
+                  :disabled="false"
+                  :isDetail="false"
+                  @searchChange="supplierChange"
                 />
               </el-col>
-              <!--搜索按钮 -->
-              <el-col :span="4" style="width: 54px; padding-left: 10px">
-                <el-button
-                  style="width: 100%"
-                  type="primary"
-                  class="fr mr10"
-                  icon="el-icon-search"
+              <el-col :span="4" style="width: 260px; padding: 0 0 0 10px">
+                <search-stock
                   :size="searchSize"
-                  @click="searchList"
-                >
-                </el-button>
-              </el-col>
-              <el-col :span="4" style="width: 66px; padding-left: 10px">
-                <el-button
-                  style="width: 100%"
-                  type="warning"
-                  class="mr5"
-                  :size="searchSize"
-                  @click="restSearch"
-                >
-                  重置
-                </el-button>
+                  :value="parmValue.stockNo"
+                  :placeholder="'仓库名称'"
+                  :disabled="false"
+                  :isDetail="false"
+                  :isRelation="true"
+                  :companyCode="supplierNo"
+                  @searchChange="stockChange"
+                />
               </el-col>
               <el-col
                 :span="4"
@@ -109,7 +141,7 @@
                   type="success"
                   class="fr"
                   :size="searchSize"
-                  @click="addSearch('add', false)"
+                  @click="openModal('add', false)"
                 >
                   新建
                 </el-button>
@@ -120,7 +152,7 @@
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
-            :type="scope.row.status == '0' ? 'warning' : ''"
+            :type="scope.row.status == '0' ? 'info' : scope.row.status == '5'?'success':'warning'"
             v-text="
               (statusOptions.find((item) => item.id == scope.row.status) || {})
                 .label || '--'
@@ -184,6 +216,7 @@ export default {
   },
   data() {
     return {
+      supplierNo: "",
       // 状态
       statusOptions: [
         { id: "0", label: "待发起流程" },
@@ -194,7 +227,9 @@ export default {
         { id: "5", label: "调拨已完成" },
       ],
       statusList: statusList,
+      options: ["按出库公司/仓库筛选", "按入库公司/仓库筛选"],
       loading: true,
+      sselect: "按出库公司/仓库筛选",
       showModel: false,
       isDetail: false,
       modelId: 0,
@@ -202,8 +237,8 @@ export default {
         start: "", //开始日期
         end: "", //结束日期
         allot_code: "", //调拨编号
-        wsm_in: "", //入仓库名称
-        wsm_out: "", //出仓库名称
+        supplierNo: [], //供应商code
+        stockNo: [], //仓库code
         page: 1,
         size: 15,
       },
@@ -225,6 +260,7 @@ export default {
     };
   },
   mounted() {
+    this.sselect = "按出库公司/仓库筛选";
     this.searchList();
   },
 
@@ -247,13 +283,13 @@ export default {
         await this.searchList();
       }
     },
-    //点击新建按钮
-    addSearch(id, isDetail) {
-      console.log("新建申请");
-      this.openModal(id, isDetail);
+    handleClick(e) {
+      this.sselect = e;
     },
     // 重置搜索框
     restSearch() {
+      this.sselect = "按出库公司/仓库筛选";
+      this.supplierNo = "";
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
@@ -261,17 +297,41 @@ export default {
         total: 0,
       };
       this.parmValue = {
-        allot_code: "", //调拨编号
-        wsm_in: "", //入仓库名称
-        wsm_out: "", //出仓库名称
         start: "", //开始日期
         end: "", //结束日期
-        page: 1, // 页码
-        size: 15, // 每页显示条数
+        allot_code: "", //调拨编号
+        supplierNo: [], //供应商code
+        stockNo: [], //仓库code
+        page: 1,
+        size: 15,
       };
       this.searchList();
     },
+    async supplierChange(e) {
+      if (e && e.id) {
+        this.parmValue.supplierNo = [e.code];
+        this.supplierNo = e.code;
+      } else {
+        this.parmValue.supplierNo = [];
+        this.supplierNo = "";
+      }
+      this.parmValue.stockNo = [];
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
+    async stockChange(e) {
+      if (e && e.id) {
+        this.parmValue.stockNo = [e.code];
+      } else {
+        this.parmValue.stockNo = [];
+      }
 
+      console.log(e);
+      this.parmValue.page = 1;
+      this.pageInfo.curr = 1;
+      await this.searchList();
+    },
     openModal(id, isDetail) {
       this.showModel = true;
       this.modelId = id;
@@ -287,7 +347,19 @@ export default {
         return;
       }
       this.loading = true;
-      const res = await asyncRequest.list(this.parmValue);
+
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      let supplierNo = model.supplierNo.length == 1 ? model.supplierNo[0] : "",
+        stockNo = model.stockNo.length == 1 ? model.stockNo[0] : "";
+      delete model["supplierNo"];
+      delete model["stockNo"];
+      model.wsm_out = this.sselect == "按出库公司/仓库筛选" ? stockNo : "";
+      model.wsm_in = this.sselect != "按出库公司/仓库筛选" ? stockNo : "";
+      model.wsm_out_supplierNo =
+        this.sselect == "按出库公司/仓库筛选" ? supplierNo : "";
+      model.wsm_in_supplierNo =
+        this.sselect != "按出库公司/仓库筛选" ? supplierNo : "";
+      const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
@@ -301,4 +373,13 @@ export default {
     },
   },
 };
-</script>
+</script>
+<style lang="scss" scoped>
+.el-dropdown-link {
+  cursor: pointer;
+  color: #409eff;
+}
+.el-icon-arrow-down {
+  font-size: 12px;
+}
+</style>

+ 3 - 9
src/views/stock/check/detail.vue

@@ -101,7 +101,6 @@ import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/stock/check/detail";
 import addEdit from "./components/addEdit";
 import resultUplod from "./components/resultUplod";
-import { getToken } from "@/utils/auth";
 import urlConfig from "@/apis/url-config";
 import { mapGetters } from "vuex";
 
@@ -186,16 +185,11 @@ export default {
         this.loading = true;
         let httpType = `aplication/zip`;
         let model = {
-          end: "2021-10-29",
-start: "2021-10-01",
-token: "b04d184cc37ad3658ae87dac1755ae8470c80afd"
-          // id: this.queryId,
-          // token: getToken(),
+          id: this.queryId,
         };
         axios({
           method: "post",
-          //urlConfig.baseURL + "admin/checkexport"
-          url: 'http://inv.sitw.wanyuhengtong.com/downqrdinv',
+          url: this.fileUrl + "admin/checkexport",
           responseType: "blob",
           data: model,
           headers: {
@@ -222,7 +216,7 @@ token: "b04d184cc37ad3658ae87dac1755ae8470c80afd"
                 this.loading = false;
               }, 500);
             } else {
-              // this.$message.error(res.data.message);
+              this.$message.error(res.data.message);
               setTimeout(() => {
                 this.loading = false;
               }, 500);

+ 9 - 65
src/views/stock/check/index.vue

@@ -3,13 +3,7 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <el-button
-        type="primary"
-        :size="'mini'"
-        @click="exportGood('导出盘点商品')"
-        >导出盘点商品
-      </el-button>
-      <!-- <ex-table
+      <ex-table
         v-loading="false"
         :table="table"
         :data="tableData"
@@ -140,9 +134,13 @@
                   </el-button>
                 </el-col>
 <<<<<<< HEAD
+<<<<<<< HEAD
              
 =======
                
+>>>>>>> live
+=======
+
 >>>>>>> live
                 <el-col
                   :span="3"
@@ -195,15 +193,15 @@
             ></i>
           </el-tooltip>
         </template>
-      </ex-table> -->
-      <!-- <add-model
+      </ex-table>
+      <add-model
         :id="modelId"
         :sitem="sitem"
         :show-model="showModel"
         :is-detail="isDetail"
         @refresh="searchList"
         @cancel="showModel = false"
-      /> -->
+      />
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -215,9 +213,7 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/stock/check";
 import addModel from "./addModel";
-import { getToken } from "@/utils/auth";
 import { mapGetters } from "vuex";
-
 export default {
   name: "check",
   mixins: [mixinPage, resToken],
@@ -343,7 +339,7 @@ export default {
     };
   },
   mounted() {
-    // this.searchList();
+    this.searchList();
   },
 
   methods: {
@@ -390,59 +386,7 @@ export default {
         await this.searchList();
       }
     },
-    async exportGood(message) {
-      // if (!this.loading) {
-        this.loading = true;
-        let httpType = `aplication/zip`;
-        let model = {
-          end: "2021-10-29",
-          start: "2021-10-01",
-          token: getToken(),
-          // id: this.queryId,
-          // token: getToken(),
-        };
-        axios({
-          method: "post",
-          //urlConfig.baseURL + "admin/checkexport"
-          url: "http://inv.sitw.wanyuhengtong.com/downqrdinv",
-          responseType: "blob",
-          data: model,
-          headers: {
-            Accept: httpType,
-          },
-        })
-          .then((res) => {
-            if (res && res.status == 200 && res.data) {
-              let blob = new Blob([res.data], {
-                type: httpType,
-              });
-              let url = window.URL.createObjectURL(blob);
-              let aLink = document.createElement("a");
-              aLink.style.display = "none";
-              aLink.href = url;
-              aLink.setAttribute("download", `${message}.zip`);
-              document.body.appendChild(aLink);
-              aLink.click();
-              document.body.removeChild(aLink); //下载完成移除元素
-              window.URL.revokeObjectURL(url); //释放掉blob对象
 
-              this.$message.success(`${message}导出成功!`);
-              setTimeout(() => {
-                this.loading = false;
-              }, 500);
-            } else {
-              // this.$message.error(res.data.message);
-              setTimeout(() => {
-                this.loading = false;
-              }, 500);
-            }
-          })
-          .catch((error) => {
-            console.log(error);
-            this.loading = false;
-          });
-      // }
-    },
     async searchList() {
       if (
         (this.parmValue.start !== "" && this.parmValue.end === "") ||

+ 81 - 0
src/views/stock/my-test/index.vue

@@ -3,6 +3,15 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
+      <el-button
+        type="primary"
+        class="fr"
+        icon="el-icon-download"
+        :size="searchSize"
+        @click="batchExport(selection)"
+        >导出</el-button
+      >
+
       <el-button type="primary" @click="addListItem()" size="mini"
         >添加</el-button
       >
@@ -196,6 +205,78 @@ export default {
   },
 
   methods: {
+    /**
+     * 批量导出开票信息
+     * * @param {Array} selection //选中的对账编码
+     */
+    async batchExport() {
+      if (!this.loading) {
+        if (this.parmValue.start === "" || this.parmValue.end === "") {
+          this.$message.warning("请选择时间区间!");
+          return;
+        }
+        this.loading = true;
+        let url = "";
+        if (this.value === "1") {
+          url = "downreportqrdtz";
+        } else if (this.value === "2") {
+          url = "downreportqrd";
+        } else if (this.value === "3") {
+          url = "downreportcgdtz";
+        } else if (this.value === "4") {
+          url = "downreportcgd";
+        } else {
+          url = "downreportthtz";
+        }
+        this.loading = true;
+
+        let httpType = `aplication/zip`;
+        axios({
+          method: "post",
+          url: urlConfig.baseURL + url,
+          responseType: "blob",
+          data: this.parmValue,
+          headers: {
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            if (res && res.status == 200 && res.data) {
+              let title =
+                (this.options.find((item) => item.value == this.value) || {})
+                  .label || "--";
+              let blob = new Blob([res.data], {
+                type: httpType,
+              });
+              let url = window.URL.createObjectURL(blob);
+              let aLink = document.createElement("a");
+              aLink.style.display = "none";
+              aLink.href = url;
+              aLink.setAttribute(
+                "download",
+                `${this.parmValue.start}至${this.parmValue.end}${title}.zip`
+              );
+              document.body.appendChild(aLink);
+              aLink.click();
+              document.body.removeChild(aLink); //下载完成移除元素
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+
+              this.$message.success(title + `信息导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            this.loading = false;
+          });
+      }
+    },
     // 添加list
     addListItem() {
       let addItem = {};

+ 55 - 0
src/views/stock/stockCount/components/dataWeido/columns.js

@@ -0,0 +1,55 @@
+export default [
+    {
+          type: "expand",
+          _slot_: "expand",
+          label: "",
+        },
+        {
+          prop: "supplier_code",
+          label: "供应商编码",
+          width: "150",
+        },
+        {
+          prop: "supplier_name",
+          label: "供应商名称",
+          'min-width':"180"
+        },
+        {
+          prop: "wsm_code",
+          label: "仓库编码",
+          width:'180'
+        },
+        {
+          prop: "wsm_name",
+          label: "仓库名称",
+          'min-width':"100"
+        },
+        {
+          prop: "total_stock",
+          label: "当前库存",
+        },
+        {
+          prop: "wait_in_stock",
+          label: "待入库",
+        },
+        {
+          prop: "wait_out_stock",
+          label: "待出库",
+          width: "80px",
+        },
+        {
+          prop: "usable_stock",
+          label: "可用库存",
+          // sortable: true,
+        },
+        {
+          prop: "intra_stock",
+          label: "在途库存",
+          // sortable: true,
+        },
+        {
+          prop: "warn_stock",
+          label: "预警库存",
+        },
+      
+]

+ 9 - 52
src/views/stock/stockCount/components/dataWeido/index.vue

@@ -49,7 +49,7 @@
                   />
                 </el-col>
                 <!-- 搜索 -->
-                <el-col :span="4" style="width: 54px;">
+                <el-col :span="4" style="width: 54px">
                   <el-button
                     :size="searchSize"
                     type="primary"
@@ -57,19 +57,18 @@
                     icon="el-icon-search"
                     label=""
                     @click="searchList"
-                    ></el-button
-                  >
+                  ></el-button>
                 </el-col>
                 <!-- 重置 -->
                 <el-col
                   :span="4"
-                  style="width: 74px; margin-left: 10px"
+                  style="width: 54px; margin-left: 10px"
                   class="mr5"
                 >
                   <el-button
                     :size="searchSize"
                     class="fr"
-                    icon="el-icon-refresh-right"
+                    type="warning"
                     @click="restSearch"
                     >重置</el-button
                   >
@@ -103,13 +102,14 @@
             <el-table-column
               label="商品名称"
               prop="good_name"
-              width="120"
+              min-width="150"
               :show-overflow-tooltip="true"
             ></el-table-column>
                        
             <el-table-column
               label="商品属性"
               prop="attribute"
+              min-width="120"
               :show-overflow-tooltip="true"
             ></el-table-column>
                        
@@ -153,7 +153,7 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/stock/dataWeido";
-
+import columns from "./columns";
 import { mapGetters } from "vuex";
 
 export default {
@@ -200,53 +200,11 @@ export default {
         total: 0,
       },
       // 表格 - 列参数
-      columns: [
-        {
-          type: "expand",
-          _slot_: "expand",
-          label: "",
-        },
-        {
-          prop: "wsm_code",
-          label: "仓库编号",
-        },
-        {
-          prop: "wsm_name",
-          label: "仓库名称",
-        },
-        {
-          prop: "total_stock",
-          label: "当前库存",
-        },
-        {
-          prop: "wait_in_stock",
-          label: "待入库",
-        },
-        {
-          prop: "wait_out_stock",
-          label: "待出库",
-          width: "80px",
-        },
-        {
-          prop: "usable_stock",
-          label: "可用库存",
-          // sortable: true,
-        },
-        {
-          prop: "intra_stock",
-          label: "在途库存",
-          // sortable: true,
-        },
-        {
-          prop: "warn_stock",
-          label: "预警库存",
-        },
-      ],
+      columns: columns,
     };
   },
   mounted() {
     this.searchList();
-    // this.stockName();
   },
 
   methods: {
@@ -321,6 +279,5 @@ export default {
   },
 };
 </script>
-<style lang="scss" scoped>
-</style>
+
    

+ 57 - 0
src/views/stock/stockCount/components/productWeido/columns.js

@@ -0,0 +1,57 @@
+export default [
+    {
+          type: "expand",
+          _slot_: "expand",
+          label: "",
+        },
+        {
+          prop: "good_code",
+          label: "商品编码",
+          width: "150",
+        },
+        {
+          prop: "type_code",
+          label: "属性编码",
+          width: "150",
+        },
+        {
+          prop: "good_name",
+          label: "商品名称",
+          "min-width": "150",
+        },
+        {
+          prop: "sort_f",
+          label: "分类",
+          width: "100",
+        },
+        {
+          prop: "unit",
+          label: "单位",
+          width: "50",
+        },
+        {
+          prop: "usable_stock",
+          label: "当前库存",
+          width: "80",
+        },
+        {
+          prop: "wait_in_stock",
+          label: "待入库",
+          width: "80",
+        },
+        {
+          prop: "wait_out_stock",
+          label: "待出库",
+          width: "80",
+        },
+        {
+          prop: "intra_stock",
+          label: "在途库存",
+          width: "80",
+        },
+        {
+          prop: "intra_stock",
+          label: "预警库存",
+          width: "80",
+        },
+]

+ 7 - 62
src/views/stock/stockCount/components/productWeido/index.vue

@@ -36,7 +36,7 @@
                 </el-col>
 
                 <!-- 搜索 -->
-                <el-col :span="4" style="width: 74px; margin-left: 10px">
+                <el-col :span="4" style="width: 54px">
                   <el-button
                     :size="searchSize"
                     type="primary"
@@ -44,19 +44,18 @@
                     icon="el-icon-search"
                     label=""
                     @click="searchList"
-                    >搜索</el-button
-                  >
+                  ></el-button>
                 </el-col>
                 <!-- 重置 -->
                 <el-col
                   :span="4"
-                  style="width: 74px; margin-left: 10px"
+                  style="width: 56px; margin-left: 10px"
                   class="mr5"
                 >
                   <el-button
                     :size="searchSize"
                     class="fr"
-                    icon="el-icon-refresh-right"
+                    type="warning"
                     @click="restSearch"
                     >重置</el-button
                   >
@@ -125,7 +124,7 @@ import resToken from "@/mixins/resToken";
 import statusList from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/stock/productWeido";
 import { mapGetters } from "vuex";
-
+import columns from "./columns";
 export default {
   name: "productWeido",
   mixins: [mixinPage, resToken],
@@ -171,62 +170,7 @@ export default {
         total: 0,
       },
       // 表格 - 列参数
-      columns: [
-        {
-          type: "expand",
-          _slot_: "expand",
-          label: "",
-        },
-        {
-          prop: "good_code",
-          label: "商品编码",
-          width: "150",
-        },
-        {
-          prop: "type_code",
-          label: "属性编码",
-          width: "150",
-        },
-        {
-          prop: "good_name",
-          label: "商品名称",
-          width: "120",
-        },
-        {
-          prop: "sort_f",
-          label: "分类",
-        },
-        {
-          prop: "unit",
-          label: "单位",
-          width: "50",
-        },
-        {
-          prop: "usable_stock",
-          label: "当前库存",
-          width: "80",
-        },
-        {
-          prop: "wait_in_stock",
-          label: "待入库",
-          width: "80",
-        },
-        {
-          prop: "wait_out_stock",
-          label: "待出库",
-          width: "80",
-        },
-        {
-          prop: "intra_stock",
-          label: "在途库存",
-          width: "80",
-        },
-        {
-          prop: "intra_stock",
-          label: "预警库存",
-          width: "80",
-        },
-      ],
+      columns: columns,
     };
   },
   mounted() {
@@ -253,6 +197,7 @@ export default {
     async searchList() {
       this.loading = true;
       // { type_code: "GY202104290049" }
+      console.log(this.parmValue);
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 44 - 0
src/views/stock/stockCount/components/spaceCount/columns.js

@@ -0,0 +1,44 @@
+export default [
+     {
+          prop: "supplier_code",
+          label: "供应商编码",
+          width: "150",
+        },
+        {
+          prop: "supplier_name",
+          label: "供应商名称",
+          "min-width": "180",
+        },
+        {
+          prop: "wsm_code",
+          label: "仓库编码",
+          width: "180",
+        },
+        {
+          prop: "wsm_name",
+          label: "仓库名称",
+        },
+        {
+          prop: "good_code",
+          label: "商品编码",
+          width: "150",
+        },
+        {
+          prop: "good_name",
+          label: "商品名称",
+          "min-width": "150",
+        },
+        {
+          prop: "type_code",
+          label: "商品属性编码",
+          width: "130",
+        },
+        {
+          prop: "in_total",
+          label: "入库量",
+        },
+        {
+          prop: "out_total",
+          label: "出库量",
+        },
+]

+ 2 - 52
src/views/stock/stockCount/components/spaceCount/index.vue

@@ -127,9 +127,8 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-// import statusList from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/stock/spaceCount";
-
+import columns from "./columns";
 import { mapGetters } from "vuex";
 export default {
   name: "spaceCount",
@@ -178,55 +177,7 @@ export default {
         total: 0,
       },
       // 表格 - 列参数
-      columns: [
-        {
-          prop: "wsm_code",
-          label: "仓库编码",
-          width: "180",
-        },
-        {
-          prop: "wsm_name",
-          label: "仓库名称",
-        },
-        {
-          prop: "good_code",
-          label: "商品编码",
-          width: "150",
-        },
-        {
-          prop: "good_name",
-          label: "商品名称",
-        },
-        {
-          prop: "type_code",
-          label: "属性编码",
-          width: "130",
-        },
-        {
-          prop: "total_stock",
-          label: "当前库存",
-        },
-        {
-          prop: "usable_stock",
-          label: "可用库存",
-        },
-        {
-          prop: "warn_stock",
-          label: "预警库存",
-        },
-        {
-          prop: "wait_in_stock",
-          label: "待入库",
-        },
-        {
-          prop: "wait_out_stock",
-          label: "待出库",
-        },
-        {
-          prop: "intra_stock",
-          label: "在途库存",
-        },
-      ],
+      columns: columns,
     };
   },
   mounted() {
@@ -286,7 +237,6 @@ export default {
         total: 0,
       };
       this.parmValue = {
-        // 缺少时间区间(开始-结束)
         start: "",
         end: "",
         type_code: "", //商品编码