Преглед на файлове

Merge branch 'feature/Feature-supply' into develop

莫绍宝 преди 3 години
родител
ревизия
12a1e3830d
променени са 2 файла, в които са добавени 28 реда и са изтрити 13 реда
  1. 19 7
      src/views/setting/account.vue
  2. 9 6
      src/views/supply/apply/components/apply_form.vue

+ 19 - 7
src/views/setting/account.vue

@@ -136,26 +136,33 @@
             <el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="部门" prop="department" v-show="accountType === 0">
+        <el-form-item label="部门" prop="department" v-show="roleObj.type === 0">
           <el-tree
             :data="departmentList"
             show-checkbox
+            :check-strictly="true"
             node-key="adminWebsitId"
             ref="tree"
             highlight-current
             :props="props">
           </el-tree>
         </el-form-item>
-        <el-form-item label="经销商" prop="dealer" v-show="accountType === 0">
+        <el-form-item label="经销商" prop="dealer" v-show="roleObj.type === 0 && roleObj.name === '经销商'">
           <el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%;">
             <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="商户" prop="merchant" v-show="accountType === 1 || accountType === 2">
+        <el-form-item label="商户" prop="merchant" v-show="roleObj.type === 1 || roleObj.type === 2">
           <el-select v-model="AccountForm.merchant" placeholder="请选择商户" style="width: 100%;">
             <el-option :label="item.adminCompanyName" :value="item.adminCompanyId" v-for="(item, index) in merchantList" :key="index"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="集团公司" prop="isGroup" v-show="roleObj.type === 0 && roleObj.name === '经销商'">
+          <el-radio-group v-model="AccountForm.isGroup">
+            <el-radio :label="false">否</el-radio>
+            <el-radio :label="true">是</el-radio>
+          </el-radio-group>
+        </el-form-item>
         <el-form-item label="密码" prop="newPassword">
           <el-input v-model="AccountForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入密码" :type="passwordType1"></el-input>
           <span class="show-pwd" @click="showPwd(1)">
@@ -271,6 +278,7 @@ export default {
         merchant: '', // 商户
         dealer: '', //经销商
         role: '', // 角色组
+        isGroup: false,
         newPassword: '', // 新密码
         confirmPassword: '', // 确认密码
       },
@@ -326,8 +334,8 @@ export default {
         ],
       },
 
-      accountType: '',
       roleList: [], // 角色列表
+      roleObj: {}, // 选中的角色
       merchantList: [],
       dealerList: [],
 
@@ -342,7 +350,7 @@ export default {
     'AccountForm.role'() {
       if(this.AccountForm.role) {
         let index = findElem(this.roleList, 'adminRoleId', this.AccountForm.role);
-        this.accountType = this.roleList[index].type;
+        this.roleObj = this.roleList[index];
       }
     }
   },
@@ -505,6 +513,7 @@ export default {
           this.AccountForm.nickName = res.data.nickName;
           this.AccountForm.merchant = res.data.companyWechatId;
           this.AccountForm.dealer = res.data.customerId;
+          this.AccountForm.isGroup = res.data.isGroupCompany;
           this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
         })
       }
@@ -528,9 +537,12 @@ export default {
             roleId: this.AccountForm.role,
             password: this.AccountForm.newPassword,
           }
-          if(this.accountType === 0) {
+          if(this.roleObj.type === 0) {
             params.adminWebsitIds = this.$refs.tree.getCheckedKeys();
-            params.customerId = this.AccountForm.dealer;
+            if(this.roleObj.name === '经销商') {
+              params.customerId = this.AccountForm.dealer;
+              params.isGroupCompany = this.AccountForm.isGroup;
+            }
           }else {
             params.adminCompanyId = this.AccountForm.merchant;
           }

+ 9 - 6
src/views/supply/apply/components/apply_form.vue

@@ -84,7 +84,7 @@
         </el-table-column>
         <el-table-column align="center" label="操作" width="100" fixed="right">
           <template slot-scope="scope">
-            <el-button type="text" @click="deleteItem(scope.row.orderId)">删除</el-button>
+            <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -267,6 +267,7 @@ export default {
     getDetail() {
       getApplyDetail({id: this.listItem.id}).then(res => {
         let data = res.data;
+        this.mainForm.orderNum = data.id;
         this.mainForm.date = data.orderTime;
         this.mainForm.jxsNum = data.customerNumber;
         this.mainForm.createMan = data.createBy;
@@ -318,7 +319,8 @@ export default {
         stockId: this.screenForm.warehouse,
         mainId: this.screenForm.type,
         id: this.screenForm.orderNum,
-        // examineStatus: 'OK',
+        examineStatus: 'OK',
+        type: 1,
       }).then(res => {
         let goodsList = [];
         res.data.records.forEach(item => {
@@ -453,10 +455,11 @@ export default {
     },
 
     // 删除产品
-    deleteItem(id) {
-      this.goodsList = this.goodsList.filter((item) => {
-        return item.orderId != id
-      })
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+      // this.goodsList = this.goodsList.filter((item) => {
+      //   return item.orderId != id
+      // })
     },
 
     // 保存