snow 2 年之前
父节点
当前提交
3210b22a4e

文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/0.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.js


+ 3 - 1
src/store/modules/user.js

@@ -342,8 +342,10 @@ const actions = {
            let _companylist = []
            if(companyCode === 0) {
             _companylist = isSupertube ? companyData.list : convertCompanylist(companyData.list);
+
+            //超管 + 业务公司 需要将 relation_code 设置为 code
             if(isSupertube) _companylist = _companylist.map(item => ({...item, code: item.relation_code}))
-            
+
             commit('setCompanylist', _companylist)
            }
 

+ 11 - 11
src/views/interest/account/addEditDepart.vue

@@ -50,14 +50,12 @@
 
               <el-col :span="24">
                 <el-form-item label="业务公司">
-                  <el-select v-model="companyNo" style="width:100%" placeholder="业务公司">
-                    <el-option
-                      v-for="company in companyList"
-                      :key="company.companyCode"
-                      :value="company.companyCode"
-                      :label="company.companyName"
-                    />
-                  </el-select>
+                  <search-work-company
+                    :value="companyNo"
+                    :placeholder="'业务公司'"
+                    :size="'mini'"
+                    @searchChange="companyNosearchChange"
+                  />
                 </el-form-item>
               </el-col>
 
@@ -266,6 +264,10 @@ export default {
       this.ruleForm.is_all = checkedCount === this.coptions.length
       this.isIndeterminate = checkedCount > 0 && checkedCount < this.coptions.length
     },
+    async companyNosearchChange(e) {
+      const { code } = e
+      this.companyNo = code || ''
+    },
     recursion(list) {
       list.map((v) => {
         if (v && Array.isArray(v.child)) {
@@ -325,10 +327,8 @@ export default {
             } = sitem
 
             this.itemlist = item_list
-
             this.companyList = sitem.company_relaton
-            this.companyNo = item_companyNo
-
+            this.companyNo = item_companyNo || this.companyList[0].companyCode
             this.ruleForm = {
               id,
               mobile: mobile || '',

+ 106 - 83
src/views/serviceParam/orderuse/addEdit.vue

@@ -24,6 +24,15 @@
             label-width="80px"
             class="demo-ruleForm"
           >
+            <el-form-item label="业务公司" prop="companyNo">
+              <search-work-company
+                :value="ruleForm.companyNo"
+                :placeholder="'业务公司'"
+                size="large"
+                @searchChange="companyNosearchChange"
+              />
+            </el-form-item>
+
             <el-form-item label="订单用途" prop="order_use">
               <el-input
                 v-model="ruleForm.order_use"
@@ -34,9 +43,13 @@
             </el-form-item>
           </el-form>
         </el-col>
+
         <el-col :span="24" style="text-align: right">
-          <el-button v-if="id !== '007'" type="primary" @click="submitForm"
-            >保 存
+          <el-button
+            v-if="id !== '007'"
+            type="primary"
+            @click="submitForm"
+          >保 存
           </el-button>
           <el-button @click="showModelThis = false">{{
             id == "007" ? "关 闭" : "取 消"
@@ -47,156 +60,166 @@
   </el-dialog>
 </template>
 <script>
-import asyncRequest from "@/apis/service/serviceParam/orderuse";
-import resToken from "@/mixins/resToken";
+import asyncRequest from '@/apis/service/serviceParam/orderuse'
+import resToken from '@/mixins/resToken'
 export default {
-  name: "orderuse",
-  props: ["showModel", "id", "sitem"],
+  name: 'Orderuse',
   mixins: [resToken],
+  props: ['showModel', 'id', 'sitem'],
   data() {
     return {
       loading: false,
-      title: "添加订单用途",
+      title: '添加订单用途',
       showModelThis: this.showModel,
-      select: "1",
+      select: '1',
       activeOptions: [],
       actionList: [],
       ruleForm: {
-        id: "",
-        order_use: "",
-        logo_url: "",
+        id: '',
+        order_use: '',
+        companyNo: '',
+        logo_url: ''
       },
       rulesThis: this.rules,
       rules: {
         order_use: [
-          { required: true, message: "订单用途不能为空!", trigger: "blur" },
+          { required: true, message: '订单用途不能为空!', trigger: 'blur' }
         ],
-      },
-    };
+        companyNo: [
+          { required: true, message: '请选择业务公司!', trigger: 'blur' }
+        ]
+      }
+    }
   },
   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;
-      if (this.id === "003") {
-        this.title = "添加订单用途";
-        this.rulesThis = this.rules;
-      } else if (this.id === "005") {
-        this.title = "修改订单用途";
-        this.rulesThis = this.rules;
+      this.loading = true
+      if (this.id === '003') {
+        this.title = '添加订单用途'
+        this.rulesThis = this.rules
+      } else if (this.id === '005') {
+        this.title = '修改订单用途'
+        this.rulesThis = this.rules
       } else {
-        this.title = "订单用途详情";
-        this.rulesThis = {};
+        this.title = '订单用途详情'
+        this.rulesThis = {}
       }
-      await this.resetForm();
-      this.loading = false;
+      await this.resetForm()
+      this.loading = false
     },
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          const { id, order_use, logo_url } = this.sitem;
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+          const { id, order_use, logo_url, companyNo } = this.sitem
           this.ruleForm = {
-            id: id || "",
-            order_use: order_use || "",
-          };
+            id: id || '',
+            companyNo: companyNo || '',
+            order_use: order_use || ''
+          }
         }
-      });
+      })
     },
     async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
+      await this.$refs.ruleForm.validate(async(valid) => {
         if (valid) {
           if (this.loading) {
-            return;
+            return
           }
-          this.loading = true;
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let res = {};
-          if (this.id === "003") {
-            delete model["id"];
-            res = await asyncRequest.add(model);
+          this.loading = true
+          const model = JSON.parse(JSON.stringify(this.ruleForm))
+          let res = {}
+          if (this.id === '003') {
+            delete model['id']
+            res = await asyncRequest.add(model)
           } else {
-            res = await asyncRequest.update(model);
+            res = await asyncRequest.update(model)
           }
-          this.loading = false;
+          this.loading = false
           if (res && res.code === 0) {
-            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            const title = this.id === 'add' ? '添加成功!' : '修改成功!'
             this.$notify.success({
               title,
-              message: "",
-            });
-            this.showModelThis = false;
+              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
         }
-      });
+      })
     },
-    //判断图片规格
+    // 判断图片规格
     beforeAvatarUpload(file) {
-      let isJPG = false,
-        isLt2M = false;
+      let isJPG = false
+      let isLt2M = false
       if (file) {
         if (
-          file.type === "image/jpg" ||
-          file.type === "image/png" ||
-          file.type === "image/jpeg"
+          file.type === 'image/jpg' ||
+          file.type === 'image/png' ||
+          file.type === 'image/jpeg'
         ) {
-          isJPG = true;
+          isJPG = true
         }
-        isLt2M = file.size / 1024 / 1024 < 1;
+        isLt2M = file.size / 1024 / 1024 < 1
         if (!isJPG) {
-          this.$message.error("图片格式不正确!");
+          this.$message.error('图片格式不正确!')
         }
         if (!isLt2M) {
-          this.$message.error("图片大小不能超过 1MB!");
+          this.$message.error('图片大小不能超过 1MB!')
         }
       }
 
-      return isJPG && isLt2M;
+      return isJPG && isLt2M
+    },
+    async companyNosearchChange(e) {
+      const { code, label } = e
+      this.ruleForm.companyNo = code || ''
+      this.ruleForm.companyName = label
     },
-    //图片上传失败
+    // 图片上传失败
     UploadErrorEvent(res) {
-      if (res !== "break") {
-        this.$message.error("图片上传失败!");
-        this.ruleForm.logo_url = "";
-        this.$refs.ruleForm.validateField("logo_url");
+      if (res !== 'break') {
+        this.$message.error('图片上传失败!')
+        this.ruleForm.logo_url = ''
+        this.$refs.ruleForm.validateField('logo_url')
       }
     },
-    //图片上传成功
+    // 图片上传成功
     async UploadSuccessEvent(data) {
-      const { url } = data;
-      if (url === "noToken") {
-        await this.logout();
+      const { url } = data
+      if (url === 'noToken') {
+        await this.logout()
       } else {
-        this.ruleForm.logo_url = url;
-        this.$message.success("图片上传成功!");
-        this.$refs.ruleForm.validateField("logo_url");
+        this.ruleForm.logo_url = url
+        this.$message.success('图片上传成功!')
+        this.$refs.ruleForm.validateField('logo_url')
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
 
    <style lang="scss" scoped>

+ 10 - 4
src/views/serviceParam/orderuse/index.vue

@@ -103,7 +103,7 @@
                 placeholder="创建人"
               ></el-input>
             </el-col>
-            <el-col :span="4" style="width: 170px; padding: 0 0 0 10px">
+            <!-- <el-col :span="4" style="width: 170px; padding: 0 0 0 10px">
               <el-input
                 :size="searchSize"
                 v-model="parmValue.company_name"
@@ -115,7 +115,7 @@
                 "
                 placeholder="创建人部门"
               ></el-input>
-            </el-col>
+            </el-col> -->
             <el-col
               :span="3"
               class="fr"
@@ -303,8 +303,13 @@ export default {
           label: "创建人",
         },
         {
-          prop: "company_name",
-          label: "创建人部门",
+          prop: "companyNo",
+          label: "公司编码",
+          minWidth: "150px",
+        },
+        {
+          prop: "companyName",
+          label: "公司名称",
           minWidth: "150px",
         },
         {
@@ -317,6 +322,7 @@ export default {
           label: "操作",
           fixed: "right",
           _noset_: true,
+          minWidth: "90px",
           _slot_: "operation",
         },
       ],

部分文件因为文件数量过多而无法显示