snow 2 anos atrás
pai
commit
42470f99c5

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/static/js/0.js


+ 17 - 13
src/views/sellOut/salesOrder/index.vue

@@ -468,20 +468,24 @@ export default {
     },
     handleOrderCancel(row) {
       MessageBox.confirm("是否确认撤销该销售订单?").then(async () => {
-        const { orderCode } = row;
-        this.loading = true
-        const { code, message } = await asyncRequest.orderCancel({
-          orderCode: [orderCode],
-        });
-        this.loading = false
+        try{
+          const { orderCode } = row;
+          this.loading = true
+          const { code, message } = await asyncRequest.orderCancel({
+            orderCode: [orderCode],
+          });
+          this.loading = false
 
-        switch (Number(code)) {
-          case 0:
-            this.searchList();
-            break;
-          default:
-            this.$message.warning(message);
-            break;
+          switch (Number(code)) {
+            case 0:
+              await this.searchList();
+              break;
+            default:
+              this.$message.warning(message);
+              break;
+          }
+        }catch(e){
+          this.loading = false
         }
       });
     },

+ 3 - 2
src/views/serviceParam/grossProfit/addEditRate.vue

@@ -87,7 +87,7 @@
                 @reschange="rate_change($event, 'rate')"
               />
             </el-form-item>
-            <el-form-item label="财务利率" prop="money_rate">
+            <!-- <el-form-item label="财务利率" prop="money_rate">
               <digital-input
                 :values="ruleForm.money_rate"
                 :placeholder="'财务利率'"
@@ -100,7 +100,7 @@
                 :append="'%'"
                 @reschange="rate_change($event, 'money_rate')"
               />
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item label="项目最低毛利" prop="low_rate">
               <digital-input
                 :values="ruleForm.low_rate"
@@ -304,6 +304,7 @@ export default {
             delete model['cat_name']
             delete model['pid']
             delete model['fund_code']
+            model['money_rate'] = 0
             const res = await asyncRequest.editRate(model)
             this.loading = false
             if (res && res.code === 0) {

+ 138 - 138
src/views/serviceParam/platformGrossProfit/addEditRate.vue

@@ -32,10 +32,9 @@
                 disabled
                 placeholder="分类名称"
                 maxlength="20"
-                ><template v-if="pid_name" slot="prepend">{{
-                  pid_name
-                }}</template></el-input
-              >
+              ><template v-if="pid_name" slot="prepend">{{
+                pid_name
+              }}</template></el-input>
             </el-form-item>
             <el-form-item label="预算→成本" prop="order_rate">
               <digital-input
@@ -80,7 +79,7 @@
                 @reschange="rate_change($event, 'rate')"
               />
             </el-form-item>
-            <el-form-item label="财务利率" prop="money_rate">
+            <!-- <el-form-item label="财务利率" prop="money_rate">
               <digital-input
                 :values="ruleForm.money_rate"
                 :placeholder="'财务利率'"
@@ -93,7 +92,7 @@
                 :append="'%'"
                 @reschange="rate_change($event, 'money_rate')"
               />
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item label="项目最低毛利" prop="low_rate">
               <digital-input
                 :values="ruleForm.low_rate"
@@ -116,7 +115,7 @@
             type="primary"
             :size="'small'"
             @click="submitForm"
-            >保 存
+          >保 存
           </el-button>
           <el-button :size="'small'" @click="showModelThis = false">{{
             id == "007" ? "关 闭" : "取 消"
@@ -128,129 +127,129 @@
 </template>
 
 <script>
-import asyncRequest from "@/apis/service/serviceParam/platformGrossProfit";
-import companyHelper from "@/mixins/companyHelper";
-import resToken from "@/mixins/resToken";
+import asyncRequest from '@/apis/service/serviceParam/platformGrossProfit'
+import companyHelper from '@/mixins/companyHelper'
+import resToken from '@/mixins/resToken'
 
 export default {
-  name: "Sort",
+  name: 'Sort',
   mixins: [resToken, companyHelper],
-  props: ["showModel", "id", "sitem", "titleList", "isDetail", "platform_id"],
+  props: ['showModel', 'id', 'sitem', 'titleList', 'isDetail', 'platform_id'],
   data() {
     const validate_rate = (rule, value, callback) => {
-      const { required } = rule;
-      if (value === "" && required) {
-        callback(new Error("主管利率毛利率不能为空!"));
+      const { required } = rule
+      if (value === '' && required) {
+        callback(new Error('主管利率毛利率不能为空!'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     const validate_order_rate = (rule, value, callback) => {
-      const { required } = rule;
-      if (value === "" && required) {
-        callback(new Error("预算→成本毛利率不能为空!"));
+      const { required } = rule
+      if (value === '' && required) {
+        callback(new Error('预算→成本毛利率不能为空!'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     const validate_sale_rate = (rule, value, callback) => {
-      const { required } = rule;
-      if (value === "" && required) {
-        callback(new Error("成本→售价毛利率不能为空!"));
+      const { required } = rule
+      if (value === '' && required) {
+        callback(new Error('成本→售价毛利率不能为空!'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
 
     const validate_lower_rate = (rule, value, callback) => {
-      const { required } = rule;
-      if (value === "" && required) {
-        callback(new Error("BOSS毛利率不能为空!"));
+      const { required } = rule
+      if (value === '' && required) {
+        callback(new Error('BOSS毛利率不能为空!'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     const validate_low_rate = (rule, value, callback) => {
-      const { required } = rule;
-      if (value === "" && required) {
-        callback(new Error("项目最低毛利率不能为空!"));
+      const { required } = rule
+      if (value === '' && required) {
+        callback(new Error('项目最低毛利率不能为空!'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     const validate_money_rate = (rule, value, callback) => {
-      const { required } = rule;
-      if (value === "" && required) {
-        callback(new Error("财务毛利率不能为空!"));
+      const { required } = rule
+      if (value === '' && required) {
+        callback(new Error('财务毛利率不能为空!'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     return {
       loading: false,
       showModelThis: this.showModel,
-      pid_name: "",
+      pid_name: '',
       ruleForm: {
-        id: "",
-        cat_name: "",
-        order_rate: "0",
-        sale_rate: "0",
-        lower_rate: "0",
-        rate: "0",
-        low_rate: "0",
-        money_rate: "0",
+        id: '',
+        cat_name: '',
+        order_rate: '0',
+        sale_rate: '0',
+        lower_rate: '0',
+        rate: '0',
+        low_rate: '0',
+        money_rate: '0'
       },
       rulesThis: this.rules,
       rules: {
-        order_rate: [{ required: true, validator: validate_order_rate, trigger: "blur" }],
-        sale_rate: [{ required: true, validator: validate_sale_rate, trigger: "blur" }],
+        order_rate: [{ required: true, validator: validate_order_rate, trigger: 'blur' }],
+        sale_rate: [{ required: true, validator: validate_sale_rate, trigger: 'blur' }],
         lower_rate: [
-          { required: false, validator: validate_lower_rate, trigger: "blur" },
+          { required: false, validator: validate_lower_rate, trigger: 'blur' }
         ],
-        rate: [{ required: true, validator: validate_rate, trigger: "blur" }],
-        low_rate: [{ required: true, validator: validate_low_rate, trigger: "blur" }],
-        money_rate: [{ required: true, validator: validate_money_rate, trigger: "blur" }],
-      },
-    };
+        rate: [{ required: true, validator: validate_rate, trigger: 'blur' }],
+        low_rate: [{ required: true, validator: validate_low_rate, trigger: 'blur' }],
+        money_rate: [{ required: true, validator: validate_money_rate, trigger: 'blur' }]
+      }
+    }
   },
   computed: {
     title() {
-      const base = "毛利率";
-      const prefix = this.isDetail ? "查看" : "设置";
-      return prefix + base;
-    },
+      const base = '毛利率'
+      const prefix = this.isDetail ? '查看' : '设置'
+      return prefix + base
+    }
   },
   watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
+    showModel: function(val) {
+      this.showModelThis = val
       if (val) {
-        this.initForm();
+        this.initForm()
       }
     },
     showModelThis(val) {
       if (!val) {
-        this.$emit("cancel");
+        this.$emit('cancel')
       }
-    },
+    }
   },
   methods: {
     async initForm() {
-      this.loading = true;
-      this.pid_name = "";
+      this.loading = true
+      this.pid_name = ''
       this.titleList.forEach((e, i) => {
-        this.pid_name += i !== 0 ? `${e.titleName}/` : "";
-      });
-      this.rulesThis = this.rules;
-      await this.resetForm();
-      this.loading = false;
+        this.pid_name += i !== 0 ? `${e.titleName}/` : ''
+      })
+      this.rulesThis = this.rules
+      await this.resetForm()
+      this.loading = false
     },
 
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
 
           const {
             pid,
@@ -262,107 +261,108 @@ export default {
             rate,
             fund_code,
             low_rate,
-            money_rate,
-          } = this.sitem;
+            money_rate
+          } = this.sitem
 
           this.ruleForm = {
-            pid: pid || "",
-            cat_id: cat_id || "",
-            cat_name: cat_name || "",
-            fund_code: fund_code || "",
-            order_rate: order_rate || "0",
-            sale_rate: sale_rate || "0",
-            lower_rate: lower_rate || "0",
-            rate: rate || "0",
-            low_rate: low_rate || "0",
-            money_rate: money_rate || "0",
-            platform_id: this.platform_id || "",
-          };
+            pid: pid || '',
+            cat_id: cat_id || '',
+            cat_name: cat_name || '',
+            fund_code: fund_code || '',
+            order_rate: order_rate || '0',
+            sale_rate: sale_rate || '0',
+            lower_rate: lower_rate || '0',
+            rate: rate || '0',
+            low_rate: low_rate || '0',
+            money_rate: money_rate || '0',
+            platform_id: this.platform_id || ''
+          }
         }
-      });
+      })
     },
 
     rate_change(e, key) {
-      this.ruleForm[key] = e + "";
-      this.$refs.ruleForm.validateField(key);
+      this.ruleForm[key] = e + ''
+      this.$refs.ruleForm.validateField(key)
     },
 
     async changeStatus(cat_id, status) {
-      await this.$confirm(`确定要改为${status + "" === "1" ? "禁用" : "启用"}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      await this.$confirm(`确定要改为${status + '' === '1' ? '禁用' : '启用'}?`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
-        .then(async () => {
-          this.loading = true;
+        .then(async() => {
+          this.loading = true
 
-          console.log(status + "" === "1" ? "0" : "1");
+          console.log(status + '' === '1' ? '0' : '1')
 
           const model = {
             cat_id,
             platform_id: this.pa,
-            status: status + "" === "1" ? "0" : "1",
-            companyNo: this.currentCompany,
-          };
+            status: status + '' === '1' ? '0' : '1',
+            companyNo: this.currentCompany
+          }
 
-          const res = await asyncRequest.status(model);
+          const res = await asyncRequest.status(model)
           if (res && res.code === 0) {
-            this.loading = false;
+            this.loading = false
 
             this.$notify.success({
-              title: "状态修改成功!",
-              message: "",
-            });
+              title: '状态修改成功!',
+              message: ''
+            })
 
-            await this.searchList();
+            await this.searchList()
           } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
+            await this.logout()
           } else {
-            this.loading = false;
-            this.$message.warning(res.message);
+            this.loading = false
+            this.$message.warning(res.message)
           }
         })
         .catch(() => {
-          console.log("取消");
-        });
+          console.log('取消')
+        })
     },
 
     async submitForm() {
-      if (!this.isHasCurrentCompany()) return;
+      if (!this.isHasCurrentCompany()) return
 
-      await this.$refs.ruleForm.validate(async (valid) => {
+      await this.$refs.ruleForm.validate(async(valid) => {
         if (valid) {
           if (!this.loading) {
-            this.loading = true;
-            const model = JSON.parse(JSON.stringify(this.ruleForm));
-            model.companyNo = this.currentCompany;
-            delete model["cat_name"];
-            delete model["pid"];
-            delete model["fund_code"];
-            const res = await asyncRequest.setSpcp(model);
-            this.loading = false;
+            this.loading = true
+            const model = JSON.parse(JSON.stringify(this.ruleForm))
+            model.companyNo = this.currentCompany
+            model['money_rate'] = 0
+            delete model['cat_name']
+            delete model['pid']
+            delete model['fund_code']
+            const res = await asyncRequest.setSpcp(model)
+            this.loading = false
             if (res && res.code === 0) {
               this.$notify.success({
-                title: "毛利率设置成功!",
-                message: "",
-              });
-              this.showModelThis = false;
+                title: '毛利率设置成功!',
+                message: ''
+              })
+              this.showModelThis = false
               // 刷新
-              this.$emit("refresh");
+              this.$emit('refresh')
             } else if (res && res.code >= 100 && res.code <= 104) {
-              await this.logout();
+              await this.logout()
             } else {
-              this.$message.warning(res.message);
+              this.$message.warning(res.message)
             }
           }
         } else {
-          console.log("error submit!!");
-          return false;
+          console.log('error submit!!')
+          return false
         }
-      });
-    },
-  },
-};
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff