戴艳蓉 %!s(int64=3) %!d(string=hai) anos
pai
achega
dcfc7015be

+ 5 - 1
src/apis/service/interest/account/index.js

@@ -21,5 +21,9 @@ export default {
   // 修改状态
   status: (data, params) => http(api + 'userstatus', data, 'post', params),
   // 拉取角色列表
-  getRole: (data, params) => http(api + 'roleall', data, 'post', params)
+  getRole: (data, params) => http(api + 'roleall', data, 'post', params),
+  // 获取业务公司列表
+  getWorkList: (data, params) => http(api + "businesslist", data, "post", params),
+  // 获取平台
+  getTerraceList: (data, params) => http(api + "platformlist", data, "post", params),
 }

+ 242 - 59
src/views/interest/account/addEdit.vue

@@ -20,65 +20,163 @@
             ref="ruleForm"
             :model="ruleForm"
             status-icon
+            :size="'mini'"
             :rules="rulesThis"
-            label-width="110px"
+            label-width="80px"
             class="demo-ruleForm"
           >
-            <el-form-item
-              v-if="id === 'add' || isDetail"
-              label="账号"
-              prop="username"
-            >
-              <el-input v-model="ruleForm.username" :disabled="isDetail" />
-            </el-form-item>
-            <el-form-item label="真实姓名" prop="name">
-              <el-input v-model="ruleForm.name" :disabled="isDetail" />
-            </el-form-item>
-            <el-form-item label="手机号" prop="mobile">
-              <el-input v-model="ruleForm.mobile" :disabled="isDetail" />
-            </el-form-item>
-            <el-form-item label="所在部门" prop="itemid">
-              <all-organize
-                :value="ruleForm.itemid"
-                :is-detail="isDetail"
-                :disabled="isDetail"
-                :multiple="true"
-                :checkStrictly="true"
-                :placeholder="'请选择所在部门'"
-                @searchChange="itemidChange"
-              />
-            </el-form-item>
-            <el-form-item label="邮箱" prop="email">
-              <el-input v-model="ruleForm.email" :disabled="isDetail" />
-            </el-form-item>
-
-            <el-form-item label="角色" prop="role_id">
-              <el-radio-group v-model="ruleForm.role_id" :disabled="isDetail">
-                <el-radio
-                  v-for="item in roleList"
-                  :key="item.id"
-                  :label="item.id"
-                  :disabled="item.status !== '1'"
-                  >{{ item.role_name }}</el-radio
+            <el-row>
+              <el-col :span="12">
+                <el-form-item
+                  v-if="id === 'add' || isDetail"
+                  label="账号"
+                  prop="username"
                 >
-              </el-radio-group>
-            </el-form-item>
-
-            <el-form-item label="状态" prop="status">
-              <el-switch
-                v-model="ruleForm.status"
-                active-value="1"
-                inactive-value="0"
-                :disabled="isDetail"
-              />
-            </el-form-item>
+                  <el-input v-model="ruleForm.username" :disabled="isDetail" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="真实姓名" prop="name">
+                  <el-input
+                    v-model="ruleForm.name"
+                    :placeholder="'真实姓名'"
+                    :disabled="isDetail"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="手机号" prop="mobile">
+                  <el-input
+                    v-model="ruleForm.mobile"
+                    :placeholder="'手机号'"
+                    :disabled="isDetail"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="所在部门" prop="itemid">
+                  <all-organize
+                    :value="ruleForm.itemid"
+                    :is-detail="isDetail"
+                    :disabled="isDetail"
+                    :multiple="true"
+                    :size="'mini'"
+                    :checkStrictly="true"
+                    :placeholder="'所在部门'"
+                    @searchChange="itemidChange"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="邮箱" prop="email">
+                  <el-input
+                    v-model="ruleForm.email"
+                    :placeholder="'邮箱'"
+                    :disabled="isDetail"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="角色" prop="role_id">
+                  <el-radio-group
+                    v-model="ruleForm.role_id"
+                    :size="'mini'"
+                    :disabled="isDetail"
+                  >
+                    <el-radio
+                      v-for="item in roleList"
+                      :key="item.id"
+                      :label="item.id"
+                      :disabled="item.status !== '1'"
+                      >{{ item.role_name }}</el-radio
+                    >
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="业务公司" prop="status1">
+                  <el-row>
+                    <el-col :span="20">
+                      <el-checkbox
+                        :size="'mini'"
+                        :indeterminate="isIndeterminate"
+                        v-model="checkAll"
+                        @change="handleCheckAllChange"
+                        >全选</el-checkbox
+                      >
+                      <el-checkbox-group
+                        :size="'mini'"
+                        v-model="ruleForm.statu1"
+                        class="“fl"
+                      >
+                        <el-checkbox
+                          style="
+                            display: block;
+                            margin: 0;
+                            box-sizing: border-box;
+                          "
+                          v-for="(item, i) in coptions"
+                          :key="item.companyNo + i"
+                          :label="item.companyNo"
+                          :style="{ background: i % 2 === 0 ? '#f00' : '#0ff' }"
+                          :disabled="item.status === '0'"
+                          >{{ item.company }}</el-checkbox
+                        >
+                      </el-checkbox-group>
+                    </el-col>
+                    <el-col :span="4" style="padding: 33px 0 0 0">
+                      <el-radio-group v-model="ruleForm.statu2">
+                        <el-radio
+                          v-for="(si, sii) in statu2options"
+                          :key="si + sii"
+                          :style="{
+                            background: sii % 2 === 0 ? '#0f0' : '#00f',
+                          }"
+                          style="
+                            display: block;
+                            margin: 0;
+                            padding: 6px 0 0 0;
+                            height: 28px;
+                            box-sizing: border-box;
+                          "
+                          :label="si"
+                          >设为默认</el-radio
+                        >
+                      </el-radio-group>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="业务平台" prop="status3">
+                  <el-checkbox-group
+                    :size="'mini'"
+                    v-model="ruleForm.statu3"
+                    class="“fl"
+                  >
+                    <el-checkbox
+                      style="display: block; margin: 0; box-sizing: border-box"
+                      v-for="(item, i) in statu3options"
+                      :key="item.id + i"
+                      :label="item.id"
+                      :style="{ background: i % 2 === 0 ? '#f00' : '#0ff' }"
+                      >{{ item.platform_name }}</el-checkbox
+                    >
+                  </el-checkbox-group>
+                </el-form-item>
+              </el-col>
+            </el-row>
           </el-form>
         </el-col>
         <el-col :span="24" style="text-align: right">
-          <el-button v-if="!isDetail" type="primary" @click="submitForm"
+          <el-button
+            v-if="!isDetail"
+            type="primary"
+            @click="submitForm"
+            :size="'mini'"
             >保 存
           </el-button>
-          <el-button @click="showModelThis = false">{{
+          <el-button @click="showModelThis = false" :size="'mini'">{{
             isDetail ? "关 闭" : "取 消"
           }}</el-button>
         </el-col>
@@ -168,6 +266,10 @@ export default {
       title: "添加账号",
       organizeList: [],
       showModelThis: this.showModel,
+      coptions: [],
+      statu2options: [],
+      checkAll: false,
+      isIndeterminate: true,
       ruleForm: {
         username: "", // 账号
         name: "", // 真实姓名
@@ -176,7 +278,11 @@ export default {
         role_id: "",
         status: "1",
         itemid: [],
+        statu1: [],
+        statu2: "",
+        statu3: "",
       },
+      statu3options: [],
       rulesThis: this.rules,
       rules: {
         name: [
@@ -229,6 +335,21 @@ export default {
             trigger: "change",
           },
         ],
+        statu1: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择状态",
+            trigger: "change",
+          },
+        ],
+        statu2: [
+          {
+            required: true,
+            message: "请选择默认业务公司",
+            trigger: "change",
+          },
+        ],
       },
     };
   },
@@ -245,21 +366,18 @@ export default {
       }
     },
   },
-  mounted(){},
+  mounted() {},
   methods: {
-    
     itemidChange(e) {
       this.ruleForm.itemid = e;
       this.$refs.ruleForm.validateField("itemid");
     },
     async initForm() {
       this.loading = true;
-      await this.getClist();
-      await this.getRole();
+
       if (this.id === "add") {
         this.title = "添加账号";
         this.rulesThis = this.rules;
-        await this.resetForm();
       } else {
         if (this.isDetail) {
           this.title = "账号详情";
@@ -268,7 +386,16 @@ export default {
           this.title = "修改账号";
           this.rulesThis = this.rules;
         }
-        await this.resetForm(this.sitem);
+        await this.getClist();
+        await this.getRole();
+        await this.getWorkList();
+        await this.getTerraceList();
+        if (this.id === "add") {
+          await this.resetForm();
+        } else {
+          await this.resetForm(this.sitem);
+        }
+
         // await this.initData()
       }
       this.loading = false;
@@ -276,12 +403,65 @@ export default {
 
     async getClist() {
       this.organizeList = [];
-      const res = await asyncRequest.getClist({});
-      if (res && res.code === 0 && res.data) {
-        this.organizeList = res.data;
+      const { code, data, message } = await asyncRequest.getClist({
+        size: 10000,
+      });
+      if (code === 0) {
+        this.organizeList = data;
         this.recursion(this.organizeList);
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
       }
     },
+    //获取全部业务公司
+    async getWorkList() {
+      this.coptions = [];
+      this.statu2options = [];
+      const { code, data, message } = await asyncRequest.getWorkList({
+        size: 10000,
+        page: 1,
+      });
+      if (code === 0) {
+        const { list, count } = data;
+        this.coptions = list;
+        this.coptions.forEach((e) => {
+          this.statu2options.push(e.companyNo);
+        });
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+    //获取全部业务平台
+    async getTerraceList() {
+      this.statu3options = [];
+      const { code, data, message } = await asyncRequest.getTerraceList({
+        size: 10000,
+        page: 1,
+      });
+      if (code === 0) {
+        const { list, count } = data;
+        this.statu3options = list;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+    handleCheckAllChange(val) {
+      this.checkedCities = val ? this.coptions : [];
+      this.isIndeterminate = false;
+    },
+    handleCheckedCitiesChange(value) {
+      console.log(value);
+      let checkedCount = value.length;
+      this.checkAll = checkedCount === this.coptions.length;
+      this.isIndeterminate =
+        checkedCount > 0 && checkedCount < this.coptions.length;
+    },
     recursion(list) {
       list.map((v) => {
         if (v && Array.isArray(v.child)) {
@@ -346,6 +526,9 @@ export default {
             role_id: roleid || "",
             status: status || "",
             itemid: depart_code || [],
+            statu2: "",
+            statu1: [],
+            statu3: "",
           };
           // console.log(depart_code);
           // if (this.id === "add" || this.isDetail) {

+ 5 - 4
src/views/serviceParam/terrace/index.vue

@@ -272,13 +272,14 @@ export default {
       },
       // 表格 - 列参数
       columns: [
-        {
-          prop: "id",
-          label: "ID",
-        },
+        // {
+        //   prop: "id",
+        //   label: "ID",
+        // },
         {
           prop: "platform_code",
           label: "平台编号",
+          width:'160px'
         },
         {
           prop: "platform_name",