Kaynağa Gözat

Merge branch 'debelop' of http://192.168.1.222:3000/zhoufan/RMYY_CallCenter_UI into debelop

weieryang 3 yıl önce
ebeveyn
işleme
6f5844fefd

+ 18 - 0
CallCenterWeb.UI/RMYY/src/api/commonAPI.js

@@ -87,3 +87,21 @@ export function GetTypeState(params) {
87 87
     params
88 88
   })
89 89
 }
90
+// 保存自定义列
91
+export function AddFiled(data) {
92
+  return request({
93
+    url: '/CustomFiled/AddFiled',
94
+    method: 'post',
95
+    data
96
+  })
97
+}
98
+// 获取自定义列
99
+export function GetFiledState(TableId) {
100
+  return request({
101
+    url: '/CustomFiled/GetTab',
102
+    method: 'get',
103
+    params:{
104
+      TableId
105
+    }
106
+  })
107
+}

+ 118 - 0
CallCenterWeb.UI/RMYY/src/components/context/addDefinedList/index.vue

@@ -0,0 +1,118 @@
1
+<template>
2
+  <div>
3
+    <el-form ref="ruleForm" :model="ruleForm" label-width="100px">
4
+      <el-form-item label="自定义字段">
5
+        <el-checkbox
6
+          :indeterminate="isIndeterminate"
7
+          v-model="checkAll"
8
+          @change="handleCheckAllChange"
9
+        >
10
+          全选
11
+        </el-checkbox>
12
+        <div style="margin: 15px 0" />
13
+        <el-checkbox-group
14
+          v-model="checkedCities"
15
+          @change="handleCheckedCitiesChange"
16
+        >
17
+          <el-checkbox v-for="city in cities" :label="city.key" :key="city.key">
18
+            {{ city.value }}
19
+          </el-checkbox>
20
+        </el-checkbox-group>
21
+      </el-form-item>
22
+
23
+      <el-form-item>
24
+        <el-button type="primary" @click="submitForm()">保存</el-button>
25
+      </el-form-item>
26
+    </el-form>
27
+  </div>
28
+</template>
29
+<script>
30
+import { AddFiled, GetFiledState } from '@/api/commonAPI'
31
+import fieldDATA from '@/utils/fieldsData.js'
32
+export default {
33
+  props: {
34
+    definedId: {
35
+      type: String,
36
+      default: ''
37
+    },
38
+    layerid: {
39
+      type: String,
40
+      default: ''
41
+    }
42
+  },
43
+  data() {
44
+    return {
45
+      ruleForm: {
46
+        id: '', // id
47
+        TableId: '', // 列表ID
48
+        Fileds: '' // 字段值
49
+      },
50
+      cityOptionsValue: [],
51
+      checkAll: false,
52
+      checkedCities: [],
53
+      cities: [],
54
+      isIndeterminate: false
55
+    }
56
+  },
57
+  created() {
58
+    fieldDATA.orderManage_orderList.forEach((element) => {
59
+      this.cityOptionsValue.push(element.key)
60
+    })
61
+    this.cities = fieldDATA.orderManage_orderList
62
+    this.ruleForm.TableId = this.definedId.split('/').join('_')
63
+    this.getFiledTabDetail(this.ruleForm.TableId)
64
+  },
65
+  methods: {
66
+    handleCheckAllChange(val) {
67
+      this.checkedCities = val ? this.cityOptionsValue : []
68
+      this.ruleForm.Fileds = this.checkedCities.join(',')
69
+      this.isIndeterminate = false
70
+    },
71
+    handleCheckedCitiesChange(value) {
72
+      this.ruleForm.Fileds = value.join(',')
73
+      const checkedCount = value.length
74
+      this.checkAll = checkedCount === this.cities.length
75
+      this.isIndeterminate =
76
+        checkedCount > 0 && checkedCount < this.cities.length
77
+    },
78
+    submitForm() {
79
+      this.$refs.ruleForm.validate((valid) => {
80
+        if (valid) {
81
+          // 添加
82
+          AddFiled(this.ruleForm)
83
+            .then((response) => {
84
+              if (response.state.toLowerCase() === 'success') {
85
+                this.$parent.$layer.close(this.layerid)
86
+                this.$parent.getFiledTabDetail(this.ruleForm.TableId) // 重新加载父级数据
87
+                this.$message.success('保存成功!')
88
+              }
89
+            })
90
+            .catch(() => {
91
+              this.loading = false
92
+            })
93
+        } else {
94
+          this.$message.error('请输入有效的必填项信息!')
95
+          return false
96
+        }
97
+      })
98
+    },
99
+    getFiledTabDetail(TableId) {
100
+      GetFiledState(TableId).then((res) => {
101
+        this.ruleForm.TableId = res.F_TableId
102
+        if (res.F_Fileds) {
103
+          this.ruleForm.Fileds = res.F_Fileds
104
+          this.checkedCities = res.F_Fileds
105
+          if (this.checkedCities) {
106
+            this.handleCheckedCitiesChange(this.checkedCities)
107
+          }
108
+        }
109
+      })
110
+    }
111
+  }
112
+}
113
+</script>
114
+<style lang="scss" scoped>
115
+.form_select {
116
+  width: 100%;
117
+}
118
+</style>

+ 30 - 0
CallCenterWeb.UI/RMYY/src/utils/fieldsData.js

@@ -0,0 +1,30 @@
1
+export default {
2
+  orderManage_orderList: [
3
+    {
4
+      key: 'F_WoCode',
5
+      value: '工单编号'
6
+    },
7
+    {
8
+      key: 'F_ProposerName',
9
+      value: '姓名'
10
+    },
11
+    {
12
+      key: 'F_SonType',
13
+      value: '工单类别'
14
+    },
15
+    {
16
+      key: 'F_Content',
17
+      value: '工单内容'
18
+    },
19
+    {
20
+      key: 'StateName',
21
+      value: '工单状态'
22
+    },
23
+    {
24
+      key: 'F_CreateTime',
25
+      value: '创建时间'
26
+    }
27
+  ]
28
+
29
+}
30
+

+ 144 - 45
CallCenterWeb.UI/RMYY/src/views/orderManage/orderList/index.vue

@@ -11,10 +11,27 @@
11 11
         range-separator="至"
12 12
         start-placeholder="开始日期"
13 13
         end-placeholder="结束日期"
14
-        size="medium"/>
15
-      <el-input v-model="searchData.keyword" placeholder="请输入关键字" class="filter-item" size="medium"/>
16
-      <el-select v-model="searchData.type" clearable placeholder="请选择业务类别" size="medium" @change="changeOrder">
17
-        <el-option v-for="item in orderData" :key="item.id" :label="item.text" :value="item.id" />
14
+        size="medium"
15
+      />
16
+      <el-input
17
+        v-model="searchData.keyword"
18
+        placeholder="请输入关键字"
19
+        class="filter-item"
20
+        size="medium"
21
+      />
22
+      <el-select
23
+        v-model="searchData.type"
24
+        clearable
25
+        placeholder="请选择业务类别"
26
+        size="medium"
27
+        @change="changeOrder"
28
+      >
29
+        <el-option
30
+          v-for="item in orderData"
31
+          :key="item.id"
32
+          :label="item.text"
33
+          :value="item.id"
34
+        />
18 35
       </el-select>
19 36
       <el-cascader
20 37
         ref="cascader"
@@ -25,25 +42,99 @@
25 42
         placeholder="请选择工单类别"
26 43
         filterable
27 44
         clearable
28
-        @change="handleChange"/>
29
-      <el-button type="primary" class="filter-btn" icon="el-icon-search" @click="btn_search">搜索</el-button>
45
+        @change="handleChange"
46
+      />
47
+      <el-button
48
+        type="primary"
49
+        class="filter-btn"
50
+        icon="el-icon-search"
51
+        @click="btn_search"
52
+      >
53
+        搜索
54
+      </el-button>
55
+      <el-button
56
+        type="primary"
57
+        class="filter-btn"
58
+        icon="el-icon-search"
59
+        @click="btn_add_list"
60
+      >
61
+        设置列
62
+      </el-button>
30 63
     </div>
31
-    <el-table v-loading="loading" ref="multipleTable" :data="dataLists" border stripe row-key="F_Id">
32
-      <el-table-column type="index" label="编号" align="center" fixed width="60" />
33
-      <el-table-column prop="F_WoCode" label="工单编号" align="center" min-width="110">
64
+    <el-table
65
+      v-loading="loading"
66
+      ref="multipleTable"
67
+      :data="dataLists"
68
+      border
69
+      stripe
70
+      row-key="F_Id"
71
+    >
72
+      <el-table-column
73
+        type="index"
74
+        label="编号"
75
+        align="center"
76
+        fixed
77
+        width="60"
78
+      />
79
+      <el-table-column
80
+        v-if="fieldListFlag.F_WoCode"
81
+        prop="F_WoCode"
82
+        label="工单编号"
83
+        align="center"
84
+        min-width="110"
85
+      >
34 86
         <template slot-scope="scope">
35
-          <el-button type="text" size="small" @click="hadndleOrderCode(scope.row.F_WoCode)">{{ scope.row.F_WoCode }}
87
+          <el-button
88
+            type="text"
89
+            size="small"
90
+            @click="hadndleOrderCode(scope.row.F_WoCode)"
91
+          >
92
+            {{ scope.row.F_WoCode }}
36 93
           </el-button>
37 94
         </template>
38 95
       </el-table-column>
39
-      <el-table-column prop="F_ProposerName" label="姓名" align="center" min-width />
40
-      <el-table-column prop="F_SonType" :formatter="formtOrder" label="工单类别" align="center" />
41
-      <el-table-column prop="F_Content" label="工单内容" align="center" />
42
-      <el-table-column prop="StateName" label="工单状态" align="center" />
43
-      <el-table-column prop="F_CreateTime" label="创建时间" align="center" />
96
+      <el-table-column
97
+        v-if="fieldListFlag.F_ProposerName"
98
+        prop="F_ProposerName"
99
+        label="姓名"
100
+        align="center"
101
+        min-width
102
+      />
103
+      <el-table-column
104
+        v-if="fieldListFlag.F_SonType"
105
+        :formatter="formtOrder"
106
+        prop="F_SonType"
107
+        label="工单类别"
108
+        align="center"
109
+      />
110
+      <el-table-column
111
+        v-if="fieldListFlag.F_Content"
112
+        prop="F_Content"
113
+        label="工单内容"
114
+        align="center"
115
+      />
116
+      <el-table-column
117
+        v-if="fieldListFlag.StateName"
118
+        prop="StateName"
119
+        label="工单状态"
120
+        align="center"
121
+      />
122
+      <el-table-column
123
+        v-if="fieldListFlag.F_CreateTime"
124
+        prop="F_CreateTime"
125
+        label="创建时间"
126
+        align="center"
127
+      />
44 128
       <el-table-column label="操作" align="center" class-name="oparate_btn">
45 129
         <template slot-scope="scope">
46
-          <el-button v-for="item in scope.row.Buttons" :key="item.key" type="text" @click="btnClickEvents(item, scope.row.F_WoCode, scope.row)">{{ item.value }}</el-button>
130
+          <el-button
131
+            v-for="item in scope.row.Buttons"
132
+            :key="item.key"
133
+            type="text"
134
+            @click="btnClickEvents(item, scope.row.F_WoCode, scope.row)"
135
+          >
136
+            {{ item.value }}
137
+          </el-button>
47 138
         </template>
48 139
       </el-table-column>
49 140
     </el-table>
@@ -53,33 +144,26 @@
53 144
       :pageindex.sync="pageParams.pageindex"
54 145
       :pagesize.sync="pageParams.pagesize"
55 146
       class="pagination"
56
-      @pagination="getList" />
57
-    <order-button-operation ref="butOption" @refList="refList"/>
147
+      @pagination="getList"
148
+    />
149
+    <order-button-operation ref="butOption" @refList="refList" />
58 150
   </div>
59 151
 </template>
60 152
 
61 153
 <script>
62 154
 // import { getDictionaryValueList } from '@/api/commonAPI'
63 155
 import {
64
-  getorderList,
65 156
   deleteOrder,
66
-  SureOrder,
67
-  AssignOrder,
68 157
   CompleteOrder,
69 158
   comOrderList,
70 159
   getOrderStateData
71 160
 } from '@/api/orderManagement/orderList'
72
-import {
73
-  getOrderTypeList
74
-} from '@/api/commonAPI'
75
-import {
76
-  getOrderTypeDrop
77
-} from '@/api/systemSetup/roleSetting/menuSetup'
78
-  // import { pickerOptions } from '@/utils'
79
-// import AddOrEditInfOrder from '@/views/orderManage/components/addOrEditInfOrder'
161
+import { getOrderTypeDrop } from '@/api/systemSetup/roleSetting/menuSetup'
162
+import { GetFiledState } from '@/api/commonAPI'
80 163
 import addOrEditFaultRepair from '../../faultRepair/clinicalReporting/components/addRepairbase.vue'
81 164
 import detail from '../components/orderDetail.vue'
82 165
 import addAudit from './addAudit'
166
+import addDefinedList from '@/components/context/addDefinedList'
83 167
 import orderDeal from './orderDeal'
84 168
 import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
85 169
 import OrderButtonOperation from '@/components/button/orderList'
@@ -95,6 +179,7 @@ export default {
95 179
       isDisable: false, // 防止多次点击
96 180
       loading: false,
97 181
       deleteId: [],
182
+      fieldListFlag: {},
98 183
       buttonName: '',
99 184
       searchData: {
100 185
         keyword: '', // 关键字
@@ -121,14 +206,15 @@ export default {
121 206
       },
122 207
       orderData: [],
123 208
       subclassData: [],
124
-      orderstate: [] // 工单状态数据
209
+      orderstate: [], // 工单状态数据
210
+      DefinedId: ''
125 211
     }
126 212
   },
127 213
   created() {
128 214
     this.getList()
129 215
     this.getTreeList()
130
-    // this.getOrderTypeData(2, 1000)
131 216
     this.getOrderStat()
217
+    this.getFiledTabDetail(this.$route.path.split('/').join('_'))
132 218
     document.onkeyup = (e) => {
133 219
       if (e.keyCode === 13) {
134 220
         this.getList()
@@ -150,9 +236,8 @@ export default {
150 236
     },
151 237
     btnClickEvents(button, wocode, row) {
152 238
       this.buttonName = button.key
153
-      console.log(this.buttonName, 'name')
154 239
       this.$refs.butOption.butOptionMethod(this.buttonName, wocode)
155
-      if(this.buttonName=='bianji'){
240
+      if (this.buttonName === 'bianji') {
156 241
         this.btn_edit(wocode)
157 242
       }
158 243
     },
@@ -178,10 +263,36 @@ export default {
178 263
         resolve()
179 264
       })
180 265
     },
266
+    getFiledTabDetail(TableId) {
267
+      GetFiledState(TableId).then((res) => {
268
+        const filedsData = res.F_Fileds
269
+        const filedsObj = {}
270
+        if (filedsData) {
271
+          filedsData.forEach((element) => {
272
+            filedsObj[element] = true
273
+          })
274
+        }
275
+        this.fieldListFlag = filedsObj
276
+        this.$refs['multipleTable'].doLayout()
277
+      })
278
+    },
181 279
     btn_search() {
182 280
       this.pageParams.pageindex = 1
183 281
       this.getList()
184 282
     },
283
+    btn_add_list() {
284
+      this.$layer.iframe({
285
+        content: {
286
+          content: addDefinedList, // 传递的组件对象
287
+          parent: this, // 当前的vue对象
288
+          data: {
289
+            definedId: this.$route.path
290
+          } // props
291
+        },
292
+        area: ['70%', '30%'],
293
+        title: '自定义字段'
294
+      })
295
+    },
185 296
     // 编辑
186 297
     btn_edit(rid) {
187 298
       this.$layer.iframe({
@@ -277,14 +388,6 @@ export default {
277 388
         title: '订单详情'
278 389
       })
279 390
     },
280
-    // 工单类型
281
-    // getOrderTypeData(id, pid) {
282
-    //   getOrderTypeList(id, pid).then((response) => {
283
-    //     if (response.rows) {
284
-    //       this.secondOrderData = response.rows
285
-    //     }
286
-    //   })
287
-    // },
288 391
     // 工单状态
289 392
     getOrderStat() {
290 393
       return new Promise((resolve) => {
@@ -309,12 +412,9 @@ export default {
309 412
       })
310 413
     },
311 414
     handleChange(data) {
312
-      console.log(data)
313 415
       this.searchData.menutype = data[data.length - 1]
314
-      console.log(this.searchData.menutype)
315 416
     },
316 417
     changeOrder(data) {
317
-      console.log(data)
318 418
       if (!data) {
319 419
         return
320 420
       }
@@ -337,5 +437,4 @@ export default {
337 437
 </script>
338 438
 
339 439
 <style rel="stylesheet/scss" lang="scss" scoped>
340
-
341 440
 </style>