Bladeren bron

企业设置,服务改善自动创建规则调整

qymljy 2 maanden geleden
bovenliggende
commit
859cabbb85

+ 1 - 1
src/HDrpManagement/serviceImprovement/components/actionImplementation/actionDetail.vue

@@ -2,7 +2,7 @@
   <div>
     <div style="display:flex;justify-content: left">
       <div style="width: 5px;height: 20px;background: #3874F6"></div>
-      <div style="margin-left: 10px">{{$t(data.title)}}</div>
+      <div style="margin-left: 10px;font-size: 16px;font-weight: bold">{{$t(data.title) + $t(`_执行情况`)}}</div>
       <addRecord style="margin-left: 20px;" v-if="userid == data.userid_charge && mainData.status == '方案已发布' && data.status != '已完成'"
                  :data="data" @addSuccess="addSuccess" btn-title="新增改善记录"></addRecord>
       <confirmBtn style="margin-left: 10px;" btn_title="确认完成任务" :id="data.sa_service_improvement_planid" param-id="2026020210240002"

+ 30 - 10
src/HManagement/siteManage/securityConfig/modules/serviceImprovementRule.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-button size="small" style="width:120px" type="primary" @click="openDialog">{{ $t('设 置') }}</el-button>
-    <el-dialog :title="$t(`服务改善自动创建规则`)" append-to-body :visible.sync="dialogVisible" width="860px">
+    <el-dialog :title="$t(`服务改善自动创建规则`)" append-to-body :visible.sync="dialogVisible" width="60%">
       <div style="margin-bottom: 16px;">
         <div style="display: flex; justify-content: space-between; align-items: center;">
           <span style="font-weight: bold;">{{ $t('设置真因分析产品经理') }}</span>
@@ -9,8 +9,8 @@
         </div>
       </div>
 
-      <el-table :data="tableData" style="width: 100%" border size="small">
-        <el-table-column :label="$t('产品经理')" prop="name">
+      <el-table :data="tableData" style="width: 100%;height: calc(100vh - 500px);overflow: auto" border size="small">
+        <el-table-column :label="$t('产品经理')" prop="name" width="100px">
           <template slot-scope="scope" >
             <el-popover
               v-if="scope.row.timestamp"
@@ -54,7 +54,7 @@
             <span v-else>{{ scope.row.name }}</span>
           </template>
         </el-table-column>
-        <el-table-column :label="$t('商品型号')">
+        <el-table-column :label="$t('商品型号')" width="600px">
           <template slot-scope="scope">
             <el-popover
               v-if="scope.row.timestamp"
@@ -103,10 +103,25 @@
             <span v-else>{{ formatModelLabel(scope.row.productModel) || $t('未选择') }}</span>
           </template>
         </el-table-column>
-        <el-table-column :label="$t('操作')" width="100" align="center">
+        <el-table-column :label="$t('客诉大类及其发生次数')">
           <template slot-scope="scope">
-            <el-button v-if="scope.row.timestamp" type="text" size="mini" @click="saveRow(scope.row)">{{ $t('保存') }}</el-button>
-            <el-button type="text" size="mini" @click="deleteRow(scope.row, scope.$index)">{{ $t('删除') }}</el-button>
+            <div v-if="scope.row.class2s && scope.row.class2s.length > 0">
+              <span v-for="(item,index) in scope.row.class2s" :key="item.index">
+                <span v-if="scope.row.class2s.length -1 == index">
+                  {{item.str}}
+                </span>
+                <span v-else>{{item.str + ','}}</span>
+              </span>
+            </div>
+            <div v-else>--</div>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('操作')" width="130px" align="center">
+          <template slot-scope="scope">
+            <el-button v-if="scope.row.timestamp" type="text" size="mini" @click="saveRow(scope.row)" class="inline-16">{{ $t('保存') }}</el-button>
+            <el-button type="text" size="mini" @click="deleteRow(scope.row, scope.$index)" class="inline-16">{{ $t('删除') }}</el-button>
+<!--            <el-button type="text" size="mini" v-if="!scope.row.timestamp" class="inline-16" @click="setNumber">{{$t(`设置次数`)}}</el-button>-->
+            <setServiceSet v-if="!scope.row.timestamp" class="inline-16" :data="scope.row" @setSuccess="setSuccess"></setServiceSet>
           </template>
         </el-table-column>
       </el-table>
@@ -121,10 +136,10 @@
 
 <script>
 import tableTemplate from '@/template/popoverTable/table'
-
+import setServiceSet from './setServiceSet'
 export default {
   name: "serviceImprovementRule",
-  components: { tableTemplate },
+  components: { tableTemplate , setServiceSet },
   data() {
     return {
       dialogVisible: false,
@@ -159,7 +174,8 @@ export default {
           "pageSize": 20
         },
         "id": 2026011710020402,
-      }
+      },
+
     }
   },
   methods: {
@@ -318,7 +334,11 @@ export default {
       } else {
         this.$message.warning(res.msg || this.$t('保存失败'));
       }
+    },
+    setSuccess(){
+      this.queryData()
     }
+
   }
 }
 </script>

+ 172 - 0
src/HManagement/siteManage/securityConfig/modules/setServiceSet.vue

@@ -0,0 +1,172 @@
+<template>
+  <div>
+    <dialogTem btnType="text" btn-title="设置次数" ref="dialogRef" dialogTitle="设置客诉大类及其发生次数" @dialogShow="dialogShow" @onSubmit="onSubmit">
+      <template v-slot:formRule>
+        <div>
+          <el-button type="primary" size="mini" style="float: right;margin-bottom: 10px" @click="addRow">{{$t(`添加行`)}}</el-button>
+        </div>
+        <el-table
+            :data="tableData"
+            border
+            style="width: 100%">
+          <el-table-column
+              prop="class2"
+              label="客诉大类"
+              min-width="200px">
+            <template slot-scope="scope">
+              <el-select
+                  v-model="scope.row.class2"
+                  :placeholder="$t('请选择客诉大类')"
+                  @focus="queryType('customerclass')"
+                  @change="classChange(scope.row)"
+                  size="mini"
+                  style="width: 80%"
+              >
+                <el-option
+                    v-for="item in options.customerclass"
+                    :key="item.value"
+                    :label="$t(item.value)"
+                    :value="item.value"
+                >
+                  <span style="float: left">{{ $t(item.value) }}</span>
+                </el-option>
+              </el-select>
+              <div v-if="scope.row.isClass && isSubmit" style="color: #e13333;font-size: 12px">{{$t(`请选择客诉大类`)}}</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+              prop="num"
+              label="发生次数"
+              min-width="100px">
+            <template slot-scope="scope">
+              <el-input-number size="mini" v-model="scope.row.num" @change="numChange" :min="1"  label="发生次数"></el-input-number>
+            </template>
+          </el-table-column>
+          <el-table-column
+              prop="operation"
+              min-width="70px"
+              label="操作">
+            <template slot-scope="scope">
+              <el-button type="text" size="mini" @click="delClick(scope.row)">{{$t(`删除`)}}</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </template>
+    </dialogTem>
+  </div>
+</template>
+
+<script>
+import dialogTem from '@/components/dialogTemplate/index2'
+export default {
+  name: "setServiceSet",
+  components:{dialogTem},
+  props:['data'],
+  data(){
+    return {
+      form:{
+        "class2": '',
+        "num": ""
+      },
+      rules:{},
+      tableData:[],
+      options:{
+        customerclass:''
+      },
+      isSubmit:false,
+      hrid:JSON.parse(sessionStorage.getItem('active_account')).hrid,
+      userid:JSON.parse(sessionStorage.getItem('active_account')).userid
+    }
+  },
+  methods:{
+    dialogShow(){
+      if (this.data.class2s.length > 0){
+        let newData = this.data.class2s.map((item,index) => {
+          return {
+            index:index,
+            class2:item.class2,
+            num:item.num,
+            isClass:false
+          }
+        })
+        this.tableData = newData
+      }
+
+    },
+    setNumber(){
+      this.$refs.dialogRef.dialogTableVisible = true
+    },
+    addRow(){
+      this.tableData.push(
+          {
+            index:this.tableData.length,
+            class2:'',
+            num:1,
+            isClass:false
+          }
+      )
+    },
+    numChange(){},
+    async onSubmit(){
+      this.tableData.forEach(item => {
+        if (item.class2){
+          item.isClass = false
+        }else {
+          item.isClass = true
+        }
+      })
+      this.isSubmit = true
+      let  isFlag = 0
+      this.tableData.forEach(item =>{
+        if (item.isClass){
+          isFlag = 1
+        }
+      })
+      if (isFlag == 0){
+        let class2s = []
+        class2s = this.tableData.map(item => {
+          return {
+            class2:item.class2,
+            num:item.num
+          }
+        })
+        const res = await this.$api.requested({
+          "content": {
+            "hrid": this.data.hrid,
+            "userid": this.data.userid,
+            "class2s": class2s
+          },
+          "id": 2026031115464102,
+        })
+        if (res.code == 0){
+          this.tool.showMessage(res,()=>{})
+        }else {
+          this.$refs.dialogRef.dialogTableVisible = false
+          this.$emit(`setSuccess`)
+        }
+      }
+    },
+    onCancel(){
+      this.tableData = []
+    },
+    classChange(data){
+      this.tableData[data.index].isClass = false
+    },
+    delClick(data){
+      this.tableData.splice(data.index,1)
+      this.tableData.map((item,index) => {
+        item.index = index
+      })
+    },
+    /*获取分类*/
+    async queryType(val){
+      const res = await this.$store.dispatch("optiontypeselect", val)
+      this.options[val] = res.data
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>