Browse Source

feat(卖出销售入库单管理):审批节点更新

snow 2 years ago
parent
commit
98567d588e

+ 1 - 6
src/apis/components/search-account.js

@@ -3,12 +3,7 @@ const api = 'admin/'
 export default {
   // 列表
   list: (data, params) => http(api + 'userCompanyBasicList', {
-    ...data,
-    level: '2'
-  }, 'post', params),
-  supplier_list: (data, params) => http(api + 'userCompanyBasicList', {
-    ...data,
-    level: '3'
+    ...data
   }, 'post', params)
 }
 

+ 26 - 24
src/apis/service/goodStore/goodsOnline/index.js

@@ -1,53 +1,55 @@
 // 物业管理员
-import http from "@/apis/axios";
-const api = "admin/";
+import http from '@/apis/axios'
+const api = 'admin/'
 export default {
   // 分页查询
-  list: (data, params) => http(api + "goodlist", data, "post", params),
+  list: (data, params) => http(api + 'goodlist', data, 'post', params),
   // 添加
-  add: (data, params) => http(api + "gooduponline", data, "post", params),
+  add: (data, params) => http(api + 'gooduponline', data, 'post', params),
   // 详情
-  detail: (data, params) => http(api + "goodinfo", data, "post", params),
+  detail: (data, params) => http(api + 'goodinfo', data, 'post', params),
   // 产品部门审核
-  goodupexam: (data, params) => http(api + "goodupexam", data, "post", params),
+  goodupexam: (data, params) => http(api + 'goodupexam', data, 'post', params),
   // 更新状态
-  status: (data, params) => http(api + "goodupexam", data, "post", params),
+  status: (data, params) => http(api + 'goodupexam', data, 'post', params),
 
   // 定价岗定价
   ladderOne: (data, params) =>
-    http(api + "goodupeditladder", data, "post", params),
+    http(api + 'goodupeditladder', data, 'post', params),
   // 删除
-  delete: (data, params) => http(api + "gooddel", data, "post", params),
+  delete: (data, params) => http(api + 'gooddel', data, 'post', params),
   // 重新发起审核流程
   againonline: (data, params) =>
-    http(api + "againonline", data, "post", params),
+    http(api + 'againonline', data, 'post', params),
   // 获取系统售价
   goodupprice: (data, params) =>
-    http(api + "goodupprice", data, "post", params),
+    http(api + 'goodupprice', data, 'post', params),
 
   // 复制
-  copy: (data, params) => http(api + "goodcopy", data, "post", params),
+  copy: (data, params) => http(api + 'goodcopy', data, 'post', params),
   // 获取全部分类
-  catAll: (data, params) => http(api + "catAll", data, "post", params),
+  catAll: (data, params) => http(api + 'catAll', data, 'post', params),
   // 获取全部品牌
-  brandAll: (data, params) => http(api + "brandall", data, "post", params),
+  brandAll: (data, params) => http(api + 'brandall', data, 'post', params),
   // 获取全部供应商账号
   supplierAll: (data, params) =>
-    http(api + "supplierall", data, "post", params),
+    http(api + 'supplierall', data, 'post', params),
   // 商品种类ID换取规格值
-  specByCat: (data, params) => http(api + "SpecByCat", data, "post", params),
+  specByCat: (data, params) => http(api + 'SpecByCat', data, 'post', params),
   // 规格属性值新建
   specinfoadd: (data, params) =>
-    http(api + "specinfoadd", data, "post", params),
+    http(api + 'specinfoadd', data, 'post', params),
 
-  //导出线上商品
-  exportgood: (data, params) => http(api + "exportgood", data, "post", params),
-  //商品上线审核时、驳回重新审核
+  // 导出线上商品
+  exportgood: (data, params) => http(api + 'exportgood', data, 'post', params),
+  // 商品上线审核时、驳回重新审核
   goodupreject: (data, params) =>
-    http(api + "goodupreject", data, "post", params),
+    http(api + 'goodupreject', data, 'post', params),
   // 异常原因列表
-  resultlist: (data, params) => http(api + "resultlist", data, "post", params),
+  resultlist: (data, params) => http(api + 'resultlist', data, 'post', params),
   // 获取某个商品编号下的所有审核备注列表
   getgoodexamlist: (data, params) =>
-    http(api + "getgoodexamlist", data, "post", params),
-};
+    http(api + 'getgoodexamlist', data, 'post', params),
+  goodcompliance: (data, params) =>
+    http(api + 'goodcompliance', data, 'post', params)
+}

+ 6 - 3
src/components/globalComponents/search-account/main.vue

@@ -113,9 +113,12 @@ export default {
           companyNo: this.filterCompany ? this.currentCompany : ''
         }
 
-        const level = this.level || '2'
-        const listApi = level === '3' ? asyncRequest.supplier_list : asyncRequest.list
-        const res = await listApi(formValue)
+        // const level = this.level || '2'
+        // const listApi = level === '3' ? asyncRequest.supplier_list : asyncRequest.list
+        const res = await asyncRequest.list({
+          ...formValue,
+          level: this.level
+        })
 
         if (res && res.code === 0 && res.data) {
           const { list } = res.data

+ 1 - 1
src/views/goodStore/goodsOnline/columns.js

@@ -149,7 +149,7 @@ const listCol = [
     label: '操作',
     fixed: 'right',
     _noset_: true,
-    width: '110px',
+    width: '150px',
     _slot_: 'operation'
   }
 ]

+ 106 - 0
src/views/goodStore/goodsOnline/components/compiance-modal.vue

@@ -0,0 +1,106 @@
+<template>
+  <el-dialog title="设置是否合规" :visible.sync="innerVisible" width="500px">
+    <el-form
+      ref="formRef"
+      :rules="rules"
+      :model="formData"
+      class="demo-ruleForm"
+      label-width="80px"
+    >
+      <el-form-item label="是否合规" prop="is_compliance">
+        <el-select v-model="formData.is_compliance" style="width:100%">
+          <el-option value="1" label="合规" />
+          <el-option value="2" label="不合规" />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="审核备注" prop="compliance_remark">
+        <el-input v-model="formData.compliance_remark" type="textarea" maxlength="250" show-word-limit />
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="innerVisible = false">取 消</el-button>
+      <el-button type="primary" @click="submit">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import asyncRequest from '@/apis/service/goodStore/goodsOnline'
+export default {
+  props: ['visible', 'sitem'],
+  data() {
+    return {
+      loading: false,
+      formData: {
+        is_compliance: '',
+        compliance_remark: ''
+      }
+    }
+  },
+  computed: {
+    rules() {
+      const { is_compliance } = this.formData
+      return {
+        is_compliance: [{
+          required: true,
+          message: '请选择是否合规',
+          trigger: 'blur'
+        }],
+        compliance_remark: [{
+          required: is_compliance === '2',
+          message: '请输入审核备注',
+          trigger: 'blur'
+        }]
+      }
+    },
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newVal) {
+        this.$emit('update:visible', newVal)
+      }
+    }
+  },
+  watch: {
+    visible() {
+      if (!this.visible) {
+        this.formData = {
+          is_compliance: '',
+          compliance_remark: ''
+        }
+      } else {
+        this.$nextTick(() => {
+          const { is_compliance, compliance_remark } = this.sitem
+          this.formData = {
+            is_compliance: is_compliance !== '0' ? is_compliance : '',
+            compliance_remark
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    async submit() {
+      const isValid = await this.$refs.formRef.validate()
+      if (!isValid) return
+      this.loading = true
+      const { code, message } = await asyncRequest.goodcompliance({
+        ...this.formData,
+        skuCode: this.sitem.skuCode
+      })
+      this.loading = false
+      switch (code) {
+        case 0:
+          this.$emit('refresh')
+          this.innerVisible = false
+          break
+        default:
+          this.$message.warning(message)
+          break
+      }
+    }
+  }
+}
+</script>

+ 20 - 0
src/views/goodStore/goodsOnline/index.vue

@@ -280,6 +280,17 @@
             @click="showDonlineDlg(scope.row.skuCode)"
           ></i>
         </el-tooltip>
+
+        <el-tooltip
+          effect="dark"
+          content="设置是否合规"
+          placement="top"
+        >
+          <i
+            class="el-icon-setting tb-icon"
+            @click="showCompianceModal(scope.row)"
+          ></i>
+        </el-tooltip>
       </template>
     </ex-table>
     <no-auth v-else></no-auth>
@@ -385,6 +396,8 @@
       @refresh="searchList"
       @cancel="showModel = false"
     />
+
+    <compiance-modal :visible.sync="compianceModalVisible" :sitem="sitem" />
   </div>
 </template>
 <script>
@@ -396,9 +409,11 @@ import resToken from "@/mixins/resToken";
 import { listCol, options1, options8 } from "./columns";
 import companyHelper from "@/mixins/companyHelper";
 import { isStockOptions } from "@/assets/js/statusList";
+import CompianceModal from "./components/compiance-modal.vue"
 
 export default {
   name: "goodsOnline",
+  components:{CompianceModal},
   mixins: [mixinPage, resToken, companyHelper],
   computed: {
     //组件SIZE设置
@@ -451,6 +466,7 @@ export default {
         status: [{ validator: validate, required: true, trigger: "change" }],
         platform_id: [{ validator: validate, required: true, trigger: "change" }],
       },
+      compianceModalVisible: false,
       centerDialogVisible: false,
       options1: options1,
       options8: options8,
@@ -773,6 +789,10 @@ export default {
       this.donline_form.skuCode = skuCode;
       // this.donlineDlg(skuCode)
     },
+    showCompianceModal(row){
+      this.compianceModalVisible = true;
+      this.sitem = row;
+    },
     //商品下线原因 确定
     async donlineDlg() {
       await this.$refs.donline_Form.validate(async (valid) => {

+ 9 - 9
src/views/serviceParam/storeSet/addEdit.vue

@@ -102,7 +102,6 @@
                     :is-detail="id !== 'add'"
                     :disabled="isDetail"
                     :size="'mini'"
-                    level="3"
                     :names="accountNames"
                     @searchChange="accountChange"
                   /> </el-form-item></el-col>
@@ -331,14 +330,14 @@ export default {
             trigger: 'change'
           }
         ],
-        // supplierNo: [
-        //   {
-        //     // type: 'array',
-        //     required: true,
-        //     message: '供应商公司',
-        //     trigger: 'change'
-        //   }
-        // ],
+        supplierNo: [
+          {
+            type: 'array',
+            required: true,
+            message: '供应商公司',
+            trigger: 'blur'
+          }
+        ],
         addr_code: [
           {
             type: 'array',
@@ -428,6 +427,7 @@ export default {
       } else {
         this.ruleForm.supplierNo = []
       }
+
       this.$refs.ruleForm.validateField('supplierNo')
     },
     // 仓库省市区

+ 6 - 6
src/views/supplierPurchaseIn/supplierWsmInOrder/columns.js

@@ -135,14 +135,14 @@ export default [
     'min-width': '135'
   },
   {
-    prop: "supplierNo",
-    label: "供应商编号",
-    width: "145px",
+    prop: 'supplierNo',
+    label: '供应商编号',
+    width: '145px'
   },
   {
-    prop: "supplier_name",
-    label: "供应商名称",
-    width: "155px",
+    prop: 'supplier_name',
+    label: '供应商名称',
+    width: '155px'
   },
 
   // {

+ 219 - 0
src/views/supplierPurchaseIn/supplierWsmInOrder/components/wsm-in.vue

@@ -0,0 +1,219 @@
+<template>
+  <div v-loading="loading">
+    <el-form
+      :model="ruleForm"
+      :rules="rules"
+      status-icon
+      :size="'mini'"
+      ref="ruleForm"
+      label-width="110px"
+      class="demo-ruleForm"
+    >
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="计划入库总数">
+            <el-input
+              placeholder="计划入库总数"
+              disabled
+              v-model="ruleForm.send_num"
+              maxlength="100"
+            >
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="实际入库总数" prop="wsm_num">
+            <el-input
+              placeholder="实际入库总数"
+              v-model="ruleForm.wsm_num"
+              maxlength="100"
+            >
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8" style="text-align: right; padding: 0 0 10px 0">
+          <el-button :size="'mini'" type="primary" @click="submitForm">保 存 </el-button>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+<script>
+import asyncRequest from "@/apis/service/purchaseIn/wsmInOrder";
+import resToken from "@/mixins/resToken";
+import { isMobile, isLicense, isnumber, isPhone } from "@/utils/validate";
+export default {
+  name: "wsmInOrderAdd",
+  props: ["id", "sitem", "newTime", "modelSitem"],
+  mixins: [resToken],
+  computed: {
+    powers() {
+      const { btnList } = this.$store.getters;
+      const tran = btnList.find((item) => item.menu_route == "wsmInOrderDetail") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "RKD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    const validateWeight = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("不能为空!"));
+      } else {
+        if (!isnumber(value)) {
+          callback(new Error("仅支持整数!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    const validatemobile = (rule, value, callback) => {
+      if (value !== "") {
+        if (isPhone(value) || isMobile(value)) {
+          callback();
+        } else {
+          callback(new Error("联系电话格式不正确!"));
+        }
+      } else {
+        callback(new Error("请输入收货联系电话!"));
+      }
+    };
+    return {
+      loading: true,
+      status: "",
+      showModel: false,
+      modelAllnum: "",
+      modelitem: null,
+      modelId: "",
+      ruleForm: {
+        send_num: "",
+        wsm_num: "",
+      },
+      rules: {
+        wsm_num: {
+          required: true,
+          validator: validateWeight,
+          trigger: "blur",
+        },
+      },
+    };
+  },
+  watch: {
+    newTime: function (val) {
+      if (val) {
+        this.initForm();
+      }
+    },
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+
+      await this.resetForm();
+      this.loading = false;
+    },
+    //初始化表单
+    async resetForm() {
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { wsm_in_code, send_num } = this.sitem;
+          const { wsm_num } = this.sitem.return;
+
+          this.status = status;
+          this.ruleForm = {
+            wsm_in_code: wsm_in_code || "",
+            send_num: send_num || "0",
+            wsm_num: wsm_num || "0",
+          };
+        }
+        if (this.$refs.tableForm) {
+          this.$refs.tableForm.resetFields();
+          this.$refs.tableForm.clearValidate();
+
+          const { checkinfo } = this.sitem;
+          this.tableForm = {
+            error_list: checkinfo || [],
+          };
+        }
+      });
+    },
+    addError(index) {
+      this.modelAllnum = "2";
+      this.modelitem = index === -1 ? {} : this.tableForm.error_list[index];
+      this.modelId = index;
+      this.showModel = true;
+    },
+
+    // 保存更改
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (this.loading) {
+            return;
+          }
+          this.loading = true;
+          const { send_num, wsm_num } = this.ruleForm;
+          if (parseInt(send_num) < parseInt(wsm_num)) {
+            this.$message.warning("实际入库总数不能大于计划入库总数!");
+            this.loading = false;
+            return;
+          }
+
+          const { code, data, message } = await asyncRequest.status(this.ruleForm);
+          this.loading = false;
+          if (code === 0) {
+            this.$notify.success({
+              title: "提交成功",
+              message: "",
+            });
+            this.$emit("refresh"); //抛出事件给详情页。
+          } else if (code >= 100 && code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.stockInDetail {
+  .el-table-column-error_img-ul {
+    position: relative;
+    box-sizing: border-box;
+    li {
+      float: left;
+      border: 1px solid #dfe6ec;
+      margin: 0px 2px 2px 0px;
+      box-sizing: border-box;
+      img {
+        display: inline-block;
+        box-sizing: border-box;
+        width: 50px;
+        vertical-align: top;
+        height: 32px;
+        &:hover {
+          cursor: pointer;
+        }
+      }
+    }
+  }
+}
+</style>

+ 21 - 115
src/views/supplierPurchaseIn/supplierWsmInOrder/detail.vue

@@ -88,73 +88,13 @@
                 :iscgd="iscgd"
               />
             </el-collapse-item>
-            <el-collapse-item
-              title="入库验收登记"
-              name="3"
-              v-if="sitem && sitem.sendtype + '' === '1' && !isSupertube"
-            >
-              <wsm-in-order-record-form
-                v-if="newTime !== ''"
-                :id="queryId"
-                :newTime="newTime"
-                :sitem="sitem"
-                @refresh="initData()"
-              />
-            </el-collapse-item>
-
-            <el-collapse-item
-              title="入库验收登记审核"
-              name="4"
-              v-if="
-                sitem &&
-                sitem.sendtype + '' === '1' &&
-                status + '' !== '0' &&
-                status + '' !== '1' &&
-                !isSupertube
-              "
-            >
-              <wsm-in-order-check-form
-                v-if="newTime !== ''"
-                :id="queryId"
-                :newTime="newTime"
-                :modelSitem="{}"
-                :sitem="sitem"
-                @refresh="initData()"
-              />
-            </el-collapse-item>
 
             <el-collapse-item
-              title="入库审核"
-              name="5"
-              v-if="
-                status == '3' &&
-                ppowers.some((i) => i == '3') &&
-                sitem &&
-                sitem.sendtype + '' === '1' &&
-                !isSupertube
-              "
-            >
-              <exam-form
-                :statusList="statusList"
-                :newTime="newTime"
-                v-if="newTime !== ''"
-                :disabled="false"
-                :isMust="false"
-                @searchChange="examForm"
-              />
-            </el-collapse-item>
-
-            <el-collapse-item
-              title="入库退货"
-              name="6"
-              v-if="
-                status == '5' &&
-                ppowers.some((i) => i == '5') &&
-                sitem.sendtype + '' === '1' &&
-                !isSupertube
-              "
+              title="入库验收"
+              name="3"
+              v-if="status == '0' && ppowers.some((i) => i == '0') && !isSupertube"
             >
-              <wsm-in-order-return-form
+              <wsm-in
                 v-if="newTime !== ''"
                 :id="queryId"
                 :newTime="newTime"
@@ -199,6 +139,7 @@ import wsmInOrderRecordForm from "./components/wsm-in-order-record-form";
 import wsmInOrderCheckForm from "./components/wsm-in-order-check-form";
 import wsmInOrderReturnForm from "./components/wsm-in-order-return-form";
 import ShowDataTableColumns from "./components/ShowDataTableColumns";
+import wsmIn from "./components/wsm-in";
 import { cg_order_type_options } from "@/assets/js/statusList";
 import { mapGetters } from "vuex";
 export default {
@@ -208,6 +149,7 @@ export default {
     wsmInOrderRecordForm,
     wsmInOrderCheckForm,
     wsmInOrderReturnForm,
+    wsmIn
   },
   computed: {
     ...mapGetters(["isSupertube"]),
@@ -235,60 +177,24 @@ export default {
       iscgd:true,
       status: "",
       statusOptions: [
-        {
-          value: "0",
-          label: "待发货",
-        },
-        {
-          value: "1",
-          label: "待验货", //029
-        },
-        {
-          value: "2",
-          label: "待审核",
-        },
-        {
-          value: "3",
-          label: "待入库",
-        },
-        {
-          value: "4",
-          label: "入库完成",
-        },
-        {
-          value: "5", //30  || 32
-          label: "退货待物流",
-        },
-        {
-          value: "6",
-          label: "退货完成",
-        },
+          {
+           value: "1",
+           label: "待库管验货",
+         },
+         {
+           value: "2",
+           label: "入库完成",
+         },
       ],
       statusList: [
         {
-          code: "0",
-          label: "待发货",
-        },
-        {
-          code: "1",
-          label: "待验货",
-        },
-        {
-          code: "2",
-          label: "待审核",
-        },
-        {
-          code: "3",
-          label: "待入库",
-        },
-        {
-          code: "4",
-          label: "无退货入库成功",
-        },
-        {
-          code: "5",
-          label: "退货成功",
-        },
+           value: "1",
+           label: "待库管验货",
+         },
+         {
+           value: "2",
+           label: "入库完成",
+         },
       ],
       newTime: "",
       loading: false,

+ 8 - 28
src/views/supplierPurchaseIn/supplierWsmInOrder/index.vue

@@ -303,34 +303,14 @@ export default {
 
       // 状态
       statusOptions: [
-        // {
-        //   value: "0",
-        //   label: "待发货",
-        // },
-        {
-          value: "1",
-          label: "待库管验货",
-        },
-        {
-          value: "2",
-          label: "待仓库主管审核",
-        },
-        // {
-        //   value: "3",
-        //   label: "待入库",
-        // },
-        {
-          value: "4",
-          label: "入库完成",
-        },
-        {
-          value: "5",
-          label: "待填写物流",
-        },
-        {
-          value: "6",
-          label: "退货完成",
-        },
+         {
+           value: "1",
+           label: "待库管验货",
+         },
+         {
+           value: "2",
+           label: "入库完成",
+         },
       ],
       loading: false,
       showModel: false,