Prechádzať zdrojové kódy

fix:报备单转单省市区必填去除

snow 1 rok pred
rodič
commit
5859177eb1

+ 48 - 34
src/components/globalComponents/search-supplier/main.vue

@@ -27,12 +27,22 @@
 </template>
 
 <script>
-import asyncRequest from '@/apis/components/search-supplier'
-import resToken from '@/mixins/resToken'
+import asyncRequest from "@/apis/components/search-supplier";
+import resToken from "@/mixins/resToken";
 export default {
-  name: 'SearchSupplier',
+  name: "SearchSupplier",
   mixins: [resToken],
-  props: ['size', 'value', 'placeholder', 'isDetail', 'disabled', 'names', 'type', 'isp', 'noDisabled'],
+  props: [
+    "size",
+    "value",
+    "placeholder",
+    "isDetail",
+    "disabled",
+    "names",
+    "type",
+    "isp",
+    "noDisabled"
+  ],
   /**
    * 属性集合
    * @param {String}        size             : 组件大小            非必填
@@ -51,16 +61,17 @@ export default {
     return {
       options: [],
       selectLoading: false,
-      searchName: ''
-    }
+      searchName: ""
+    };
   },
   watch: {
     names: {
       handler: function(val, old) {
-      // console.log(val, old, this.isDetail, "1");
-        this.searchName = val
+        // console.log(val, old, this.isDetail, "1");
+        this.searchName = val;
         if (this.isDetail && this.searchName) {
-          this.remoteMethod(this.searchName, this.isp)
+          console.log(this.searchName);
+          this.remoteMethod(this.searchName, this.isp);
         }
       },
       immediate: true
@@ -68,73 +79,76 @@ export default {
     isDetail: {
       handler: function(val, old) {
         if (val && this.searchName) {
-          this.remoteMethod(this.searchName, this.isp)
+          this.remoteMethod(this.searchName, this.isp);
         }
       }
     }
   },
   mounted() {
-    this.options = []
-    this.selectLoading = false
+    this.options = [];
+    this.selectLoading = false;
   },
   methods: {
     async selectChange(e) {
       // console.log(e);
       // console.log("1111" + this.isp);
       if (e && e.length > 0) {
-        const index = this.options.findIndex((v) => v.code === e[0])
+        const index = this.options.findIndex(v => v.code === e[0]);
         if (index !== -1) {
           const model = {
             id: this.options[index].id,
             code: this.options[index].code,
             label: this.options[index].name,
-            isPower: this.options[index].has_account + '' !== '0'
-          }
-          this.$emit('searchChange', model)
+            isPower: this.options[index].has_account + "" !== "0"
+          };
+
+          this.$emit("searchChange", model);
         } else {
-          this.$emit('searchChange', {})
+          this.$emit("searchChange", {});
         }
       } else {
-        this.$emit('searchChange', {})
+        this.$emit("searchChange", {});
       }
     },
     async remoteMethod(query, types) {
-      this.selectLoading = true
-      if (query !== '') {
-        this.options = []
+      this.selectLoading = true;
+      if (query !== "") {
+        this.options = [];
         const formValue = {
           page: 1,
           size: 100,
           name: query,
-          code: '',
-          is_platform: this.type ? this.type : ''
-        }
-        const { code, data, message } = await asyncRequest.list(formValue)
+          code: "",
+          is_platform: this.type ? this.type : ""
+        };
+        const { code, data, message } = await asyncRequest.list(formValue);
         if (code === 0) {
-          const { list } = data
-          this.options = list
+          const { list } = data;
+          this.options = list;
           if (types) {
             // console.log(this.value);
-            const index = this.options.findIndex((v) => v.code + '' === this.value[0] + '')
+            const index = this.options.findIndex(
+              v => v.code + "" === this.value[0] + ""
+            );
             // console.log(this.options);
             // console.log(index);
             if (index !== -1) {
-              await this.selectChange([this.options[index].code])
+              await this.selectChange([this.options[index].code]);
             }
           }
           // console.log(types);
         } else if (code >= 100 && code <= 104) {
-          await this.logout()
+          await this.logout();
         } else {
-          this.$message.warning(message)
+          this.$message.warning(message);
         }
       } else {
-        this.options = []
+        this.options = [];
       }
-      this.selectLoading = false
+      this.selectLoading = false;
     }
   }
-}
+};
 </script>
 
 <style></style>

+ 2 - 2
src/views/sellOut/filing/detail.vue

@@ -71,8 +71,8 @@ export default {
     title() {
       const mapTitle = {
         add: "新建报备单",
-        view: "报备单详情",
-        edit: "编辑报备单"
+        edit: "编辑报备单",
+        view: "报备单详情"
       };
 
       return mapTitle[this.$route.query.type];

+ 55 - 64
src/views/sellOut/salesOrder/index.vue

@@ -75,8 +75,8 @@
                     :label="item.label"
                     :value="item.value"
                   />
-                </el-select> -->
-                <el-switch 
+                </el-select>-->
+                <el-switch
                   v-model="parmValue.use_type"
                   :active-value="usetypeOtions[1].value"
                   :inactive-value="usetypeOtions[0].value"
@@ -96,20 +96,20 @@
                   type="primary"
                   style="float: right; margin-left: 5px"
                   @click="searchList"
-                >
-                  刷新
-                </el-button>
+                >刷新</el-button>
               </el-col>
 
-              <el-col :span="3" style="width: 66px; float: right" v-if="!isSupertube && powers.includes('094')">
+              <el-col
+                :span="3"
+                style="width: 66px; float: right"
+                v-if="!isSupertube && powers.includes('094')"
+              >
                 <el-button
                   :size="searchSize"
                   type="primary"
                   style="float: right; margin-left: 5px"
                   @click="set_user(selection)"
-                >
-                  设置订单用途
-                </el-button>
+                >设置订单用途</el-button>
               </el-col>
             </el-row>
             <el-row style="padding: 10px 0 0 0">
@@ -169,14 +169,7 @@
               </el-col>
 
               <el-col :span="4" style="width: 66px; float: right">
-                <el-button
-                  type="warning"
-                  class="fr"
-                  :size="searchSize"
-                  @click="restSearch"
-                >
-                  重置
-                </el-button>
+                <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
               </el-col>
 
               <el-col
@@ -189,9 +182,7 @@
                   type="success"
                   style="float: right"
                   @click="routeGoto('salesOrderDetail', { id: 'add', type: 'add' })"
-                >
-                  新建
-                </el-button>
+                >新建</el-button>
               </el-col>
             </el-row>
 
@@ -237,15 +228,15 @@
           <span v-for="(si, i) in scope.row.speclist" :key="si.spec_id + i">
             <span v-if="i !== 0">-</span>
             <span v-else>_</span>
-            <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
+            <span>{{ si.spec_name }}[{{ si.spec_value || si.spec_value_name }}]</span>
           </span>
         </template>
 
         <template #use_type="{ scope }">
           <el-tag size="mini">
             {{
-              (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
-                .label || "---"
+            (usetypeOtions.find(({ value }) => value === scope.row.use_type) || {})
+            .label || "---"
             }}
           </el-tag>
         </template>
@@ -253,13 +244,15 @@
         <template #cgd_status="{ scope }">
           <el-tag size="mini">
             <template v-if="String(scope.row.order_type) === '1'">--</template>
-            <template v-else>{{
+            <template v-else>
+              {{
               (
-                purchaseStatusOptions.find(
-                  ({ value }) => value === scope.row.cgd_status
-                ) || {}
+              purchaseStatusOptions.find(
+              ({ value }) => value === scope.row.cgd_status
+              ) || {}
               ).label || "---"
-            }}</template>
+              }}
+            </template>
           </el-tag>
         </template>
 
@@ -299,10 +292,7 @@
 
         <template #operation="{ scope }">
           <el-tooltip effect="dark" content="详情" placement="top">
-            <i
-              class="el-icon-view tb-icon"
-              @click="getRouter('salesOrderDetail', scope.row.id)"
-            ></i>
+            <i class="el-icon-view tb-icon" @click="getRouter('salesOrderDetail', scope.row.id)"></i>
           </el-tooltip>
 
           <el-tooltip
@@ -310,10 +300,7 @@
             placement="top"
             v-if="isCancel(scope.row) && powers.includes('006') && !isSupertube"
           >
-            <i
-              class="el-icon-refresh-right tb-icon"
-              @click="handleOrderCancel(scope.row)"
-            />
+            <i class="el-icon-refresh-right tb-icon" @click="handleOrderCancel(scope.row)" />
           </el-tooltip>
         </template>
       </ex-table>
@@ -354,7 +341,7 @@ import { MessageBox } from "element-ui";
 import {
   xs_order_type_options,
   xs_order_source_options,
-  usetypeOtions,
+  usetypeOtions
 } from "@/assets/js/statusList";
 
 export default {
@@ -362,16 +349,18 @@ export default {
   mixins: [mixinPage, resToken, companyHelper],
   components: {
     addEdit,
-    userAddEdit,
+    userAddEdit
   },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size", "isSupertube"]),
     powers() {
       const tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "salesOrder") || {};
+        this.$store.getters.btnList.find(
+          item => item.menu_route == "salesOrder"
+        ) || {};
       const { action } = tran ?? {};
       return action ?? [];
-    },
+    }
   },
   data() {
     return {
@@ -386,7 +375,7 @@ export default {
         { id: "0", label: "待发货" },
         { id: "1", label: "待发货完成" },
         { id: "2", label: "发货已完成" },
-        { id: "3", label: "订单已取消" },
+        { id: "3", label: "订单已取消" }
       ],
       /* 采购单状态 **/
       purchaseStatusOptions: [
@@ -394,7 +383,7 @@ export default {
         { value: "1", label: "待入库" },
         { value: "2", label: "部分入库" },
         { value: "3", label: "入库完成" },
-        { value: "4", label: "已取消订单" },
+        { value: "4", label: "已取消订单" }
       ],
       xs_order_type_options,
       xs_order_source_options,
@@ -418,7 +407,7 @@ export default {
         start: "", //新建起始时间
         end: "", // 新建结束时间
         company_name: "", //创建人部门
-        use_type: "1",
+        use_type: "1"
       },
       // 表格 - 数据
       tableData: [],
@@ -426,18 +415,18 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"],
+        _defaultHeader_: ["setcol"]
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格 - 列参数
       columns: columns,
       orderCodeList: [],
-      userShowModel: false,
+      userShowModel: false
     };
   },
   mounted() {
@@ -454,7 +443,7 @@ export default {
       this.pageInfo = {
         size: size,
         curr: page,
-        total: 0,
+        total: 0
       };
       //多选条件
       this.select = this.parmValue.select;
@@ -479,13 +468,13 @@ export default {
     },
     handleOrderCancel(row) {
       MessageBox.confirm("是否确认撤销该销售订单?").then(async () => {
-        try{
+        try {
           const { orderCode } = row;
-          this.loading = true
+          this.loading = true;
           const { code, message } = await asyncRequest.orderCancel({
-            orderCode: [orderCode],
+            orderCode: [orderCode]
           });
-          this.loading = false
+          this.loading = false;
 
           switch (Number(code)) {
             case 0:
@@ -495,8 +484,8 @@ export default {
               this.$message.warning(message);
               break;
           }
-        }catch(e){
-          this.loading = false
+        } catch (e) {
+          this.loading = false;
         }
       });
     },
@@ -504,7 +493,7 @@ export default {
       if (toRouter && queryId) {
         let model = {
           id: queryId,
-          type: "view",
+          type: "view"
         };
 
         //有多选框的条件
@@ -514,7 +503,7 @@ export default {
         //
         let routerModel = {
           options: JSON.parse(JSON.stringify(this.parmValue)),
-          router: this.$route.path,
+          router: this.$route.path
         };
         model.preModel = JSON.stringify(routerModel);
 
@@ -541,13 +530,13 @@ export default {
         start: "", //新建起始时间
         end: "", // 新建结束时间
         company_name: "", //部门
-        use_type: "1",
+        use_type: "1"
       };
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       };
       this.searchList();
     },
@@ -571,7 +560,7 @@ export default {
       }
       this.orderCodeList = [];
       let isok = true;
-      selection.forEach((e) => {
+      selection.forEach(e => {
         this.orderCodeList.push(e.orderCode);
         if (e.use_order) {
           isok = false;
@@ -621,17 +610,19 @@ export default {
       this.loading = true;
       this.parmValue.orderCode = this.select === "orderCode" ? this.input : "";
       this.parmValue.good_name = this.select === "good_name" ? this.input : "";
-      this.parmValue.apply_name = this.select === "apply_name" ? this.input : "";
-      this.parmValue.company_name = this.select === "company_name" ? this.input : "";
+      this.parmValue.apply_name =
+        this.select === "apply_name" ? this.input : "";
+      this.parmValue.company_name =
+        this.select === "company_name" ? this.input : "";
 
       const res = await asyncRequest.list({
         ...this.parmValue,
-        needRela: true,
+        needRela: true
       });
 
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
-        this.tableData.forEach((v) => {
+        this.tableData.forEach(v => {
           v.good_class = "";
           if (v.can && v.can.length > 0) {
             v.can.forEach((x, i) => {
@@ -660,8 +651,8 @@ export default {
       } else {
         this.parmValue.end = "";
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 7 - 0
src/views/supplierSellOut/supplierFiling/config/columns.js

@@ -713,6 +713,13 @@ const validate_good_name = (rule, value, callback) => {
   }
 }
 const rules = {
+  supplierNo:[
+    {
+      required: true,
+      message: '供应商不能为空',
+      trigger: 'blur'
+    }
+  ],
   companyName: [
     {
       required: true,

+ 3 - 2
src/views/supplierSellOut/supplierFiling/cpns/baseForm.vue

@@ -51,7 +51,7 @@
             <search-supplier
               :isDetail="true"
               :value="ruleForm.supplierNo"
-              :names="ruleForm.supplierName"
+              :names="supplierName"
               :placeholder="'供应商'"
               :disabled="true"
               :size="'mini'"
@@ -1292,9 +1292,10 @@ export default {
     },
     //供应商选择
     supplierNosearchChange(e) {
+      console.log(e, "--");
       const { code, name } = e;
       this.ruleForm.supplierNo = code ? [code] : [];
-      this.supplierName = name ? [name] : "";
+      this.supplierName = name;
       this.$refs.ruleForm && this.$refs.ruleForm.validateField("supplierNo");
     }, //业务公司选择
     company_idsearchChange(e) {