Explorar el Código

报价单授权

lihongxiao hace 2 años
padre
commit
ba8a9def0b

+ 6 - 1
src/components/TemplateTable/index.vue

@@ -105,7 +105,12 @@
           </template>
         </el-table-column>
         <!-- 自定义内容 -->
-        <slot v-if="item.type === 'slot'" show-overflow-tooltip :name="item.name"></slot>
+        <el-table-column v-if="item.type === 'slot'" :align="'center'"  show-overflow-tooltip :name="item.name"
+          :label="item.label" :key="item.prop" :prop="item.prop">
+          <template slot-scope="scope">
+            <slot show-overflow-tooltip v-bind="scope" :name="item.name"></slot>
+          </template>
+        </el-table-column>
         <!-- 常规文本内容 -->
         <el-table-column v-if="item.type === 'text'" :align="'center'" :width="item.width || ''" :fixed="item.fixed"
           :label="item.label" :key="item.prop" :prop="item.prop"></el-table-column>

+ 7 - 0
src/http/moudules/menu.js

@@ -126,4 +126,11 @@ export const findUserList= (data) => {
         method: 'post',
         data
     })
+}
+export const quotationConfig= (data) => {
+    return axios({
+        url: '/sys/quotation/config',
+        method: 'post',
+        data
+    })
 }

+ 38 - 9
src/views/Sys/QuotationAuthorization.vue

@@ -37,6 +37,14 @@
               </el-option>
             </el-select>
           </template>
+            <template slot="quotationAbbr" slot-scope="scope">
+                <div v-if="scope.row.quotation && scope.row.quotation.length>0">
+                    <span v-for="(val,index) in scope.row.quotation" :key="index" :style="'color:' +val.themeColour +';display: block' "> {{ val.quotationAbbr  }} </span>
+                </div>
+                <div v-else>
+                    <span >无</span>
+                </div>
+            </template>
           </templateTable>
                 <!-- <div style="margin-bottom: 20px; margin-top: 15px" class="flex a-start">
                     <el-form :inline="true" class="demo-form-inline" size="small" style="margin-left: 30px">
@@ -143,10 +151,10 @@ export default {
     this.searchLeaderFun()
         this.findLeftTreeData(); // 获取机构树的数据
         //获取所有下拉框数据
-        this.getDictItems("comlevel");
-        this.getDictItems("comattribute");
-        this.getDictItems("comtype");
-        this.getDicType("organizationSource");
+        // this.getDictItems("comlevel");
+        // this.getDictItems("comattribute");
+        // this.getDictItems("comtype");
+        // this.getDicType("organizationSource");
         this.$api.menu.quotationList()
                 .then((res) => {
                     if(res.code==200){
@@ -166,6 +174,7 @@ export default {
             btnGroup:[
                 {
                     name:'报价单配置',
+                    disabled: () => { return this.selectList.length==0 },
                     click:(row, index) => {return this.batchEditing()},
                 }
             ],
@@ -200,6 +209,9 @@ export default {
           type: "slot",
         },
       ],
+      user_statusoptions: JSON.parse(
+          localStorage.getItem("user_statusoptions")
+        ),
             tableConfig: {
         columns: [
           // 数据列
@@ -224,6 +236,11 @@ export default {
           label: "来源",
           type: "text",
         },
+          {
+            name: "quotationAbbr",
+            label: "报价单名称",
+            type: "slot",
+          },
           {
             prop: "status",
             label: "状态",
@@ -284,6 +301,7 @@ export default {
             checkedKeys:false,
             currentTreeNode: null,
             deptId: JSON.parse(localStorage.getItem("user_data")).deptId,
+        roles: JSON.parse(localStorage.getItem("find_all")),
             pageData: {
                 pageNum: 1,
                 pageSize: 10,
@@ -400,6 +418,19 @@ export default {
                 ,leaderName:this.queryFrom.leaderName },
             }).then((res) => {
                 if(res.code == 200){
+                    res.data.records.forEach((val) => {
+                        val.managementSource=val.managementSource=='2'?"个代":"渠道"
+                        if (val.status && val.status !== "" && val.status !== null) {
+                            val.status = this.user_statusoptions.find(
+                            (ele) => ele.value == val.status
+                            ).label;
+                        }
+                        if (val.roleId && val.roleId !== "" && val.roleId !== null) {
+                            val.roleId = this.roles.find(
+                            (ele) => ele.id == val.roleId
+                            ).name;
+                        }
+                        });
                     this.tableConfig.loading = false;
                     this.pageResult = res.data.records;
                     this.pageData.pageNum = res.data.current;
@@ -438,9 +469,7 @@ export default {
             });
         },
         handleSelectionChange(select) {
-            if(select.length>0){
                 this.selectList=select
-            }
             // if (!row.children) {
             // return false;
             // }
@@ -472,15 +501,15 @@ export default {
         },
         deptSubmitForm() {
             let  data={
-                    // organizationIds:this.deptDialogTitle=='编辑'?[this.organizationId]:this.$refs.expandTable.selection.map(e=>e.id),
-                    authorizationIds:this.selectList.map(e=>e.id),
+                    authorizationIds:this.selectList.map(e=>e.userId),
                     themecodes:this.themeId
                 }
             this.$api.menu
-                .quotationBatch(data)
+                .quotationConfig(data)
                 .then((res) => {
                     if(res.code==200){
                         this.deptDialogVisible=false
+                        this.selectList=[]
                         this.findPage()
                         this.$message({ message: res.msg, type: "success" });
                     }