Browse Source

车辆调度

weieryang 3 years ago
parent
commit
7922bd7c2d

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

@@ -0,0 +1,18 @@
1
+import request from '@/utils/request'
2
+// 工单类型--车辆调度
3
+// 撤回
4
+export function getCarWithdrawWorkOrder(params) {
5
+  return request({
6
+    url: 'T_Car_WorkOrder/Withdraw',
7
+    method: 'get',
8
+    params
9
+  })
10
+}
11
+// 评价
12
+export function getCarEvaluateWorkorder(params) {
13
+  return request({
14
+    url: 'T_Car_WorkOrder/EvaluateWorkorder',
15
+    method: 'get',
16
+    params
17
+  })
18
+}

+ 41 - 3
CallCenterWeb.UI/RMYY/src/components/button/orderList.vue

@@ -171,6 +171,26 @@
171 171
         <el-button type="primary" @click="submitForm('dealWorkForm')">确 定</el-button>
172 172
       </div>
173 173
     </el-dialog>
174
+    <!-- 车辆调度-评价 -->
175
+    <el-dialog :visible.sync="dialogStatus.dialog_cldu_pingjia" title="评价">
176
+      <el-form ref="carEvaluteForm" :model="carEvaluteForm" :rules="rules" label-width="100px">
177
+        <el-form-item label="评价内容">
178
+          <el-input
179
+            :autosize="{ minRows: 4, maxRows: 8}"
180
+            v-model="carEvaluteForm.Evaluation"
181
+            show-word-limit
182
+            maxlength="100"
183
+            type="textarea" />
184
+        </el-form-item>
185
+        <el-form-item label="分值">
186
+          <el-input-number v-model="carEvaluteForm.score" :min="0"/>
187
+        </el-form-item>
188
+      </el-form>
189
+      <div slot="footer" class="dialog-footer">
190
+        <el-button @click="dialogStatus.dialog_cldu_pingjia = false">取 消</el-button>
191
+        <el-button type="primary" @click="submitForm('carEvaluteForm')">确 定</el-button>
192
+      </div>
193
+    </el-dialog>
174 194
   </div>
175 195
 </template>
176 196
 
@@ -189,7 +209,7 @@ import {
189 209
 
190 210
 import {
191 211
   schedulRetractOrder,
192
-  	deleteSchedulingOrder
212
+  deleteSchedulingOrder
193 213
 } from '@/api/orderManagement/orderList'
194 214
 import {
195 215
   getSureWorkOrder,
@@ -205,6 +225,7 @@ import {
205 225
   postDelDispatchWorkOrder,
206 226
   postwithdrawDispatchWorkOrder
207 227
 } from '@/api/comDispatch/addOrEditDispatch'
228
+import { getCarWithdrawWorkOrder, getCarEvaluateWorkorder } from '@/api/orderManagement/vehicle'
208 229
 import {
209 230
   GetPerson
210 231
 } from '@/api/commonAPI'
@@ -217,6 +238,7 @@ export default {
217 238
     return {
218 239
       optionName: '',
219 240
       wocode: '',
241
+      fid: '',
220 242
       dialogStatus: {
221 243
         dialog_zixingjiejue: false,
222 244
         dialog_zhdd_chehui: false,
@@ -237,8 +259,17 @@ export default {
237 259
         dialog_haocai: false,
238 260
         dialog_dispatch_tuihui: false,
239 261
         dialog_schbianji: false,
262
+        dialog_dispatch_daoda: false,
240 263
         dialog_schshanchu: false,
241 264
         dialog_schchehui: false,
265
+        dialog_cldu_chehui: false,
266
+        dialog_cldu_bianji: false,
267
+        dialog_cldu_pingjia: false,
268
+        dialog_cldu_chehui: {
269
+          text: '确定要撤回吗?',
270
+          action: getCarWithdrawWorkOrder,
271
+          type: 'confirm'
272
+        },
242 273
         dialog_yw_shanchu: {
243 274
           text: '确定要删除吗?',
244 275
           action: getDelWorkOrder,
@@ -259,7 +290,6 @@ export default {
259 290
           action: deleteSchedulingOrder,
260 291
           type: 'confirm'
261 292
         },
262
-        dialog_dispatch_daoda: false,
263 293
         dialog_ywzx_jiedan: {
264 294
           text: '确定要接单吗?',
265 295
           action: getSureWorkOrder,
@@ -319,6 +349,10 @@ export default {
319 349
       evaluateText: [
320 350
         '极差', '失望', '一般', '满意', '惊喜'
321 351
       ],
352
+      carEvaluteForm: {
353
+        Evaluation: '',
354
+        score: 0
355
+      },
322 356
       evaluateForm: {
323 357
         Attitude: 0,
324 358
         Quality: 0,
@@ -427,6 +461,7 @@ export default {
427 461
     butOptionMethod(name, code, row) {
428 462
       this.optionName = name
429 463
       this.wocode = code
464
+      this.fid = row.F_ID
430 465
       if (this.dialogStatus[`dialog_${name}`] === false) {
431 466
         this.dialogStatus[`dialog_${name}`] = true
432 467
       } else {
@@ -444,7 +479,7 @@ export default {
444 479
         type: 'warning'
445 480
       }).then(() => {
446 481
         new Promise((resolve) => {
447
-          if (this.optionName == 'ywzx_jiedan' || this.optionName == 'ywzx_tuihui' || this.optionName == 'dispatch_jiedan' || this.optionName == 'schshanchu' || this.optionName == 'yw_shanchu') {
482
+          if (this.optionName == 'ywzx_jiedan' || this.optionName == 'ywzx_tuihui' || this.optionName == 'dispatch_jiedan' || this.optionName == 'schshanchu' || this.optionName == 'yw_shanchu' || this.optionName == 'cldu_chehui') {
448 483
             var params = {
449 484
               WorkOrderCode: this.wocode
450 485
             }
@@ -556,6 +591,9 @@ export default {
556 591
             case 'dealWorkForm':
557 592
               this.postEvent = postDispatchDealWorkOrder
558 593
               break
594
+            case 'carEvaluteForm':
595
+              this.postEvent = getCarEvaluateWorkorder
596
+              break
559 597
             default:
560 598
               break
561 599
           }

+ 1 - 1
CallCenterWeb.UI/RMYY/src/components/context/commonSelect/selectOrderType.vue

@@ -35,7 +35,7 @@ export default {
35 35
       inserted(el, binging) {
36 36
         // console.log(el.id)
37 37
         if ((el.id.split(',')[0] == 'nav2' && el.id.split(',')[1] == '3000') || (el.id.split(',')[0] == 'nav0' && el
38
-          .id.split(',')[1] == '1000') || (el.id.split(',')[0] == 'nav1' && el.id.split(',')[1] == '2000')) {
38
+          .id.split(',')[1] == '1000') || (el.id.split(',')[0] == 'nav1' && el.id.split(',')[1] == '2000') || (el.id.split(',')[0] == 'nav3' && el.id.split(',')[1] == '4000')) {
39 39
           el.click()
40 40
         } else {
41 41
           el.id.split(',')[0] == 'nav0' ? el.click() : null

+ 8 - 0
CallCenterWeb.UI/RMYY/src/utils/global.js

@@ -47,6 +47,10 @@ export const workOrderState = {
47 47
     value: '10'
48 48
   }],
49 49
   stateOptions_4000: [{
50
+    label: '待提交',
51
+    value: '-1'
52
+  },
53
+  {
50 54
     label: '待分配',
51 55
     value: '0'
52 56
   },
@@ -63,6 +67,10 @@ export const workOrderState = {
63 67
     value: '4'
64 68
   },
65 69
   {
70
+    label: '待评价',
71
+    value: '7'
72
+  },
73
+  {
66 74
     label: '已完成',
67 75
     value: '10'
68 76
   }],

+ 3 - 0
CallCenterWeb.UI/RMYY/src/views/callScreen/components/AddOrEditOrder.vue

@@ -75,6 +75,9 @@
75 75
       <!-- 车辆调度 -->
76 76
       <el-col v-if="orderTypeData.F_Type1 === 4000" :span="22">
77 77
         <add-or-edit
78
+          :wid="wid"
79
+          :iswomanage="iswomanage"
80
+          :rtype="rtype"
78 81
           :r2type="r2type"
79 82
           :callid="callid"
80 83
           :order-type-data="orderTypeData"

+ 3 - 0
CallCenterWeb.UI/RMYY/src/views/orderManage/mySubmit/index.vue

@@ -277,6 +277,9 @@ export default {
277 277
       if (this.buttonName === 'ywzx_bianji') {
278 278
         this.btn_ywzxedit(wocode, row.F_Type, row.F_SonType)
279 279
       }
280
+      if (this.buttonName === 'cldu_bianji') {
281
+        this.btn_ywzxedit(wocode, row.F_Type, row.F_SonType)
282
+      }
280 283
     },
281 284
     // 编辑
282 285
     btn_edit(rid) {

+ 336 - 315
CallCenterWeb.UI/RMYY/src/views/vehicleDispatch/vehicleScheduling/vehicleSchedulingList/components/addOrEdit.vue

@@ -3,11 +3,10 @@
3 3
     <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="150px">
4 4
       <el-col :span="24">
5 5
         <el-row v-if="wocode!=''">
6
-          <el-col :span='24'>
6
+          <el-col :span="24">
7 7
             <el-form-item label="工单类型" prop="type">
8
-              <el-select clearable v-model="ruleForm.type" placeholder="请选择工单类型" style="width: 100%;" size="medium">
9
-                <el-option v-for="item in typeList" :key="item.fid" :label="item.fname" :value="item.fid">
10
-                </el-option>
8
+              <el-select v-model="ruleForm.type" clearable placeholder="请选择工单类型" style="width: 100%;" size="medium">
9
+                <el-option v-for="item in typeList" :key="item.fid" :label="item.fname" :value="item.fid"/>
11 10
               </el-select>
12 11
             </el-form-item>
13 12
           </el-col>
@@ -21,7 +20,10 @@
21 20
           <el-col :span="12">
22 21
             <el-form-item label="申请人" prop="needman">
23 22
               <el-select v-model="ruleForm.needman" placeholder="请选择申请人" style="width:100%;" @change="changeRepairman">
24
-                <el-option v-for="item in repairman" :key="item.usercode" :label="item.username"
23
+                <el-option
24
+                  v-for="item in repairman"
25
+                  :key="item.usercode"
26
+                  :label="item.username"
25 27
                   :value="item.usercode" />
26 28
               </el-select>
27 29
             </el-form-item>
@@ -36,8 +38,11 @@
36 38
           <el-col :span="12">
37 39
             <el-form-item label="车辆要求" prop="cartype">
38 40
               <el-select v-model="ruleForm.cartype" style="width: 100%;">
39
-                <el-option v-for="(item,index) in carArr" :key="index" :label="item.F_Name"
40
-                  :value="item.F_DictionaryValueId"></el-option>
41
+                <el-option
42
+                  v-for="(item,index) in carArr"
43
+                  :key="index"
44
+                  :label="item.F_Name"
45
+                  :value="item.F_DictionaryValueId"/>
41 46
               </el-select>
42 47
             </el-form-item>
43 48
           </el-col>
@@ -57,9 +62,13 @@
57 62
         <el-row>
58 63
           <el-col :span="24">
59 64
             <el-form-item label="发车时间" prop="usertime">
60
-              <el-date-picker v-model="ruleForm.usertime" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss"
61
-                format='yyyy-MM-dd HH:mm:ss' type="datetime" placeholder="选择发车时间">
62
-              </el-date-picker>
65
+              <el-date-picker
66
+                v-model="ruleForm.usertime"
67
+                style="width: 100%;"
68
+                value-format="yyyy-MM-dd HH:mm:ss"
69
+                format="yyyy-MM-dd HH:mm:ss"
70
+                type="datetime"
71
+                placeholder="选择发车时间"/>
63 72
             </el-form-item>
64 73
           </el-col>
65 74
         </el-row>
@@ -74,7 +83,7 @@
74 83
         <el-row>
75 84
           <el-col :span="24">
76 85
             <el-form-item label="工单内容" prop="F_Remark">
77
-              <el-input type="textarea" v-model="ruleForm.content" placeholder="请输入工单内容" />
86
+              <el-input v-model="ruleForm.content" type="textarea" placeholder="请输入工单内容" />
78 87
             </el-form-item>
79 88
           </el-col>
80 89
         </el-row>
@@ -88,324 +97,336 @@
88 97
 </template>
89 98
 
90 99
 <script>
91
-  import {
92
-    getList,
93
-    getModelDetail,
94
-    getAddWorkOrder,
95
-    getUpdateWorkOrder
96
-  } from '@/api/vehicleDispatch/vehicleScheduling.js'
97
-  import {
98
-    getOrderTypeList
99
-  } from "@/api/commonAPI.js"
100
-  import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
101
-  import {
102
-    getCartype
103
-  } from "@/api/vehicleDispatch/vehicleManagement";
104
-  import {
105
-    GetPerson
106
-  } from '@/api/commonAPI'
107
-  export default {
108
-    name: "AddOrEdit",
109
-    props: {
110
-      orderTypeData: {
111
-        type: Object,
112
-        default () {
113
-          return {}
114
-        }
115
-      },
116
-      callid: {
117
-        type: String,
118
-        default: ''
119
-      },
120
-      rowid: {
121
-        type: String,
122
-        default: "",
123
-      },
124
-      wocode: {
125
-        type: String,
126
-        default: "",
127
-      },
128
-      layerid: {
129
-        type: String,
130
-        default: "",
131
-      },
100
+import {
101
+  // getList,
102
+  getModelDetail,
103
+  getAddWorkOrder,
104
+  getUpdateWorkOrder
105
+} from '@/api/vehicleDispatch/vehicleScheduling.js'
106
+import {
107
+  getOrderTypeList
108
+} from '@/api/commonAPI.js'
109
+  // import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
110
+import {
111
+  getCartype
112
+} from '@/api/vehicleDispatch/vehicleManagement'
113
+import {
114
+  GetPerson
115
+} from '@/api/commonAPI'
116
+export default {
117
+  name: 'AddOrEdit',
118
+  props: {
119
+    orderTypeData: {
120
+      type: Object,
121
+      default() {
122
+        return {}
123
+      }
132 124
     },
133
-    data() {
134
-      return {
135
-        typeList: [],
136
-        carArr: [],
137
-        repairman: [], // 申请人数据
138
-        sourceList: [{
139
-          value: "电话",
140
-          label: "电话"
141
-        }, {
142
-          value: "电脑",
143
-          label: "电脑"
144
-        }, {
145
-          value: "微信",
146
-          label: "微信"
147
-        }],
148
-        hospitalsParam: {
149
-          id: 0,
150
-          name: ''
151
-        },
152
-        departmentsParam: {
153
-          id: 0,
154
-          name: ''
155
-        },
156
-        repairmanParam: {
157
-          id: 0,
158
-          name: ''
159
-        },
160
-        rules: {
161
-          type: [{
162
-            required: true,
163
-            message: '请选择',
164
-            trigger: 'change'
165
-          }],
166
-          deptid: [{
167
-            required: true,
168
-            message: '请选择',
169
-            trigger: 'change'
170
-          }],
171
-          needman: [{
172
-            required: true,
173
-            message: '请选择',
174
-            trigger: 'change'
175
-          }],
176
-          cartype: [{
177
-            required: true,
178
-            message: '请选择',
179
-            trigger: 'change'
180
-          }],
181
-          // usertime: [{
182
-          //   type: 'string',
183
-          //   required: true,
184
-          //   message: '请选择',
185
-          //   trigger: 'change'
186
-          // }],
187
-          phon: [{
188
-            required: true,
189
-            message: '请输入',
190
-            trigger: 'blur'
191
-          }],
192
-          startplace: [{
193
-            required: true,
194
-            message: '请输入',
195
-            trigger: 'blur'
196
-          }],
197
-          endplace: [{
198
-            required: true,
199
-            message: '请输入',
200
-            trigger: 'blur'
201
-          }],
202
-        },
203
-        ruleForm: {
204
-          F_ID: '',
205
-          startplace: '',
206
-          endplace: '',
207
-          source: '',
208
-          hosid: '', // 院区id
209
-          hosname: '', // 院区id
210
-          deptid: '', // 申请科室id
211
-          deptname: '', // 申请科室名称
212
-          usercode: '', // 申请人编码
213
-          username: '', //	申请人
214
-          needman: '',
215
-          birth: '',
216
-          phon: '',
217
-          type: '',
218
-          cartype: '',
219
-          F_CarMessage: '',
220
-          remark: '',
221
-          content: ''
222
-        },
223
-        deptid: [],
224
-        loading: false,
225
-      };
125
+    callid: {
126
+      type: String,
127
+      default: ''
226 128
     },
227
-    created() {
228
-      this.getTypeOrder()
229
-      this.getCarlist()
230
-      if (this.rowid) {
231
-        this.ruleForm.F_ID = this.rowid;
232
-        this.getDetail('0');
233
-        console.log(this.rowid)
234
-      }
129
+    rowid: {
130
+      type: String,
131
+      default: ''
235 132
     },
236
-    methods: {
237
-      // 获取申请人数据
238
-      getRepairman(id) {
239
-        return new Promise((resolve) => {
240
-          const params = {
241
-            deptid: id // 字典管理的工单标识
242
-          }
243
-          GetPerson(params).then((res) => {
244
-            this.repairman = res.rows
245
-          })
246
-          resolve()
247
-        })
133
+    wid: {
134
+      type: String,
135
+      default: ''
136
+    },
137
+    wocode: {
138
+      type: String,
139
+      default: ''
140
+    },
141
+    layerid: {
142
+      type: String,
143
+      default: ''
144
+    }
145
+  },
146
+  data() {
147
+    return {
148
+      typeList: [],
149
+      carArr: [],
150
+      repairman: [], // 申请人数据
151
+      sourceList: [{
152
+        value: '电话',
153
+        label: '电话'
154
+      }, {
155
+        value: '电脑',
156
+        label: '电脑'
157
+      }, {
158
+        value: '微信',
159
+        label: '微信'
160
+      }],
161
+      hospitalsParam: {
162
+        id: 0,
163
+        name: ''
248 164
       },
249
-      // 申请人
250
-      changeRepairman(data) {
251
-        this.ruleForm.needman = data
165
+      departmentsParam: {
166
+        id: 0,
167
+        name: ''
252 168
       },
253
-      getCarlist() {
254
-        const params = {
255
-          Flag: 'CLLX',
256
-          Name: ''
257
-        }
258
-        getCartype(params).then(res => {
259
-          this.carArr = res.rows
260
-        })
169
+      repairmanParam: {
170
+        id: 0,
171
+        name: ''
261 172
       },
262
-      getTypeOrder() {
173
+      rules: {
174
+        type: [{
175
+          required: true,
176
+          message: '请选择',
177
+          trigger: 'change'
178
+        }],
179
+        deptid: [{
180
+          required: true,
181
+          message: '请选择',
182
+          trigger: 'change'
183
+        }],
184
+        needman: [{
185
+          required: true,
186
+          message: '请选择',
187
+          trigger: 'change'
188
+        }],
189
+        cartype: [{
190
+          required: true,
191
+          message: '请选择',
192
+          trigger: 'change'
193
+        }],
194
+        // usertime: [{
195
+        //   type: 'string',
196
+        //   required: true,
197
+        //   message: '请选择',
198
+        //   trigger: 'change'
199
+        // }],
200
+        phon: [{
201
+          required: true,
202
+          message: '请输入',
203
+          trigger: 'blur'
204
+        }],
205
+        startplace: [{
206
+          required: true,
207
+          message: '请输入',
208
+          trigger: 'blur'
209
+        }],
210
+        endplace: [{
211
+          required: true,
212
+          message: '请输入',
213
+          trigger: 'blur'
214
+        }]
215
+      },
216
+      ruleForm: {
217
+        F_ID: '',
218
+        startplace: '',
219
+        endplace: '',
220
+        source: '',
221
+        hosid: '', // 院区id
222
+        hosname: '', // 院区id
223
+        deptid: '', // 申请科室id
224
+        deptname: '', // 申请科室名称
225
+        usercode: '', // 申请人编码
226
+        username: '', //	申请人
227
+        needman: '',
228
+        birth: '',
229
+        phon: '',
230
+        type: '',
231
+        cartype: '',
232
+        F_CarMessage: '',
233
+        remark: '',
234
+        content: ''
235
+      },
236
+      deptid: [],
237
+      loading: false
238
+    }
239
+  },
240
+  created() {
241
+    this.getTypeOrder()
242
+    this.getCarlist()
243
+    // if (this.rowid) {
244
+    //   this.ruleForm.F_ID = this.rowid
245
+    //   this.getDetail('0')
246
+    //   console.log(this.rowid)
247
+    // }
248
+    if (this.wid) {
249
+      this.wocode = this.wid
250
+      this.getDetail('0')
251
+      console.log('9999')
252
+    }
253
+  },
254
+  methods: {
255
+    // 获取申请人数据
256
+    getRepairman(id) {
257
+      return new Promise((resolve) => {
263 258
         const params = {
264
-          pid: 2,
265
-          typeid: 4000
259
+          deptid: id // 字典管理的工单标识
266 260
         }
267
-        getOrderTypeList(params.pid, params.typeid).then(res => {
268
-          this.typeList = res.rows
261
+        GetPerson(params).then((res) => {
262
+          this.repairman = res.rows
269 263
         })
270
-      },
271
-      getDeptid(data) {
272
-        this.ruleForm.hosid = data[0]
273
-        this.ruleForm.deptid = data[data.length - 1]
274
-        this.deptid = data
275
-        this.getRepairman(data[data.length - 1])
276
-      },
277
-      submitForm() {
278
-        this.$refs.ruleForm.validate((valid) => {
279
-          if (valid) {
280
-            // 添加
281
-            if (!this.rowid) {
282
-              const datas = {
283
-                callid: this.callid,
284
-                type: this.orderTypeData.type2Arr[this.orderTypeData.type2Arr.length - 1],
285
-                hosid: this.ruleForm.hosid, //	院区id
286
-                detpid: this.ruleForm.deptid, //	申请科室id
287
-                startplace: this.ruleForm.startplace,
288
-                endplace: this.ruleForm.endplace,
289
-                needman: this.ruleForm.needman, //	申请人
290
-                phon: this.ruleForm.phon,
291
-                cartype: this.ruleForm.cartype,
292
-                usertime: this.ruleForm.usertime,
293
-                birth: this.ruleForm.birth,
294
-                content: this.ruleForm.content, //	备注
295
-              };
296
-              getAddWorkOrder(datas)
297
-                .then((response) => {
298
-                  this.loading = false;
299
-                  if (response.state.toLowerCase() === "success") {
300
-                    this.$parent.$layer.close(this.layerid);
301
-                    this.$parent.getList(); // 重新加载父级数据
302
-                    this.$message({
303
-                      message: '恭喜你,添加工单成功!',
304
-                      type: 'success',
305
-                      duration: 1000
306
-                    })
307
-                  }
308
-                })
309
-                .catch(() => {
310
-                  this.loading = false;
311
-                });
312
-            } else {
313
-              // 编辑
314
-              const datas = {
315
-                WorkOrderCode: this.wocode,
316
-                type: this.ruleForm.type,
317
-                hosid: this.ruleForm.hosid, //	院区id
318
-                detpid: this.ruleForm.deptid, //	申请科室id
319
-                startplace: this.ruleForm.startplace,
320
-                endplace: this.ruleForm.endplace,
321
-                needman: this.ruleForm.needman, //	申请人
322
-                phon: this.ruleForm.phon,
323
-                cartype: this.ruleForm.cartype,
324
-                usertime: this.ruleForm.usertime,
325
-                birth: this.ruleForm.birth,
326
-                content: this.ruleForm.content, //	备注
327
-              };
328
-              getUpdateWorkOrder(datas)
329
-                .then((response) => {
330
-                  if (response.state.toLowerCase() === "success") {
331
-                    this.$parent.$layer.close(this.layerid);
332
-                    this.$parent.getList(); // 重新加载父级数据
333
-                    this.$message({
334
-                      message: '恭喜你,编辑工单成功!',
335
-                      type: 'success',
336
-                      duration: 1000
337
-                    })
338
-                  }
339
-                })
340
-                .catch(() => {});
264
+        resolve()
265
+      })
266
+    },
267
+    // 申请人
268
+    changeRepairman(data) {
269
+      this.ruleForm.needman = data
270
+    },
271
+    getCarlist() {
272
+      const params = {
273
+        Flag: 'CLLX',
274
+        Name: ''
275
+      }
276
+      getCartype(params).then(res => {
277
+        this.carArr = res.rows
278
+      })
279
+    },
280
+    getTypeOrder() {
281
+      const params = {
282
+        pid: 2,
283
+        typeid: 4000
284
+      }
285
+      getOrderTypeList(params.pid, params.typeid).then(res => {
286
+        this.typeList = res.rows
287
+      })
288
+    },
289
+    getDeptid(data) {
290
+      this.ruleForm.hosid = data[0]
291
+      this.ruleForm.deptid = data[data.length - 1]
292
+      this.deptid = data
293
+      this.getRepairman(data[data.length - 1])
294
+    },
295
+    submitForm() {
296
+      this.$refs.ruleForm.validate((valid) => {
297
+        if (valid) {
298
+          // 添加
299
+          if (!this.wid) {
300
+            const datas = {
301
+              callid: this.callid,
302
+              type: this.orderTypeData.type2Arr[this.orderTypeData.type2Arr.length - 1],
303
+              hosid: this.ruleForm.hosid, //	院区id
304
+              detpid: this.ruleForm.deptid, //	申请科室id
305
+              startplace: this.ruleForm.startplace,
306
+              endplace: this.ruleForm.endplace,
307
+              needman: this.ruleForm.needman, //	申请人
308
+              phon: this.ruleForm.phon,
309
+              cartype: this.ruleForm.cartype,
310
+              usertime: this.ruleForm.usertime,
311
+              birth: this.ruleForm.birth,
312
+              content: this.ruleForm.content //	备注
341 313
             }
314
+            getAddWorkOrder(datas)
315
+              .then((response) => {
316
+                this.loading = false
317
+                if (response.state.toLowerCase() === 'success') {
318
+                  this.$parent.$layer.closeAll()
319
+                  // this.$parent.$layer.close(this.layerid)
320
+                  this.$parent.$parent.getList() // 重新加载父级数据
321
+                  this.$message({
322
+                    message: '恭喜你,添加工单成功!',
323
+                    type: 'success',
324
+                    duration: 1000
325
+                  })
326
+                }
327
+              })
328
+              .catch(() => {
329
+                this.loading = false
330
+              })
342 331
           } else {
343
-            this.$message.error("请输入有效的必填项信息!");
344
-            return false;
332
+            // 编辑
333
+            const datas = {
334
+              WorkOrderCode: this.wocode,
335
+              type: this.type,
336
+              hosid: this.ruleForm.hosid, //	院区id
337
+              detpid: this.ruleForm.deptid, //	申请科室id
338
+              startplace: this.ruleForm.startplace,
339
+              endplace: this.ruleForm.endplace,
340
+              needman: this.ruleForm.needman, //	申请人
341
+              phon: this.ruleForm.phon,
342
+              cartype: this.ruleForm.cartype,
343
+              usertime: this.ruleForm.usertime,
344
+              birth: this.ruleForm.birth,
345
+              content: this.ruleForm.content //	备注
346
+            }
347
+            getUpdateWorkOrder(datas)
348
+              .then((response) => {
349
+                if (response.state.toLowerCase() === 'success') {
350
+                  this.$parent.$layer.closeAll()
351
+                  // this.$parent.$layer.close(this.layerid)
352
+                  this.$parent.$parent.getList() // 重新加载父级数据
353
+                  this.$message({
354
+                    message: '恭喜你,编辑工单成功!',
355
+                    type: 'success',
356
+                    duration: 1000
357
+                  })
358
+                }
359
+              })
360
+              .catch(() => {})
345 361
           }
346
-        });
347
-      },
348
-      resetForm() {
349
-        this.$refs.ruleForm.resetFields();
350
-      },
351
-
352
-      // 获取详情
353
-      getDetail(num) {
354
-        const params = {
355
-          orderid: this.rowid,
356
-          WorkOrderCode: this.wocode,
357
-          type: num
362
+        } else {
363
+          this.$message.error('请输入有效的必填项信息!')
364
+          return false
358 365
         }
359
-        getModelDetail(params).then((response) => {
360
-          if (response.state.toLowerCase() === "success") {
361
-            const res = response.model;
362
-            this.getRepairman(res.F_ProposerDeptId)
363
-            this.ruleForm.F_ID = res.F_ID
364
-            this.ruleForm.type = res.F_Type
365
-            this.hospitalsParam.id = res.F_HosId
366
-            this.hospitalsParam.name = res.HosName
367
-            this.departmentsParam.id = res.F_ProposerDeptId
368
-            this.departmentsParam.name = res.F_ProposerDeptName
369
-            this.repairmanParam.id = res.F_ProposerCode
370
-            this.repairmanParam.name = res.F_ProposerName
371
-            this.ruleForm.username = res.F_ProposerName
372
-            this.ruleForm.hosid = res.F_HosId
373
-            this.ruleForm.hosname = res.HosName
374
-            this.ruleForm.deptid = res.F_ProposerDeptId
375
-            this.ruleForm.deptname = res.F_ProposerDeptName
376
-            this.ruleForm.usercode = res.F_ProposerCode
377
-            this.ruleForm.username = res.F_ProposerName
378
-            this.ruleForm.phon = res.F_Phon
379
-            this.ruleForm.cartype = res.F_CarType
380
-            this.ruleForm.startplace = res.F_DepartPlace
381
-            this.ruleForm.endplace = res.F_Destination
382
-            this.ruleForm.F_CarMessage = res.F_CarMessage
383
-            this.ruleForm.remark = res.F_Remark
384
-            this.ruleForm.usertime = res.F_UseTime
385
-            this.ruleForm.birth = res.F_Birth
386
-            this.ruleForm.content = res.F_Content
387
-            this.deptid = this.$store.getters.deptmap[parseInt(res.F_ProposerDeptId)].ids
388
-            this.ruleForm.needman = res.F_ProposerCode
389
-          }
390
-        });
391
-      },
392
-      // 科室下拉改变事件
393
-      // getDepartments(data) {
394
-      //   this.ruleForm.deptid = data.value
395
-      //   this.ruleForm.deptname = data.name
396
-      // },
397
-      // 院区下拉改变事件
398
-      // getHospitals(data) {
399
-      //   this.ruleForm.hosid = data.value
400
-      //   this.ruleForm.hosname = data.name
401
-      // },
402
-      //申请人下拉改变事件
403
-      // getRepairman(data) {
404
-      //   this.ruleForm.usercode = data.value
405
-      //   this.ruleForm.username = data.name
406
-      // },
366
+      })
367
+    },
368
+    resetForm() {
369
+      this.$refs.ruleForm.resetFields()
407 370
     },
408
-  };
371
+
372
+    // 获取详情
373
+    getDetail(num) {
374
+      const params = {
375
+        // orderid: this.rowid,
376
+        WorkOrderCode: this.wocode,
377
+        type: num
378
+      }
379
+      getModelDetail(params).then((response) => {
380
+        if (response.state.toLowerCase() === 'success') {
381
+          const res = response.model
382
+          this.getRepairman(res.F_ProposerDeptId)
383
+          this.ruleForm.F_ID = res.F_ID
384
+          this.ruleForm.type = res.F_Type
385
+          this.type = res.F_Type
386
+          this.hospitalsParam.id = res.F_HosId
387
+          this.hospitalsParam.name = res.HosName
388
+          this.departmentsParam.id = res.F_ProposerDeptId
389
+          this.departmentsParam.name = res.F_ProposerDeptName
390
+          this.repairmanParam.id = res.F_ProposerCode
391
+          this.repairmanParam.name = res.F_ProposerName
392
+          this.ruleForm.username = res.F_ProposerName
393
+          this.ruleForm.hosid = res.F_HosId
394
+          this.ruleForm.hosname = res.HosName
395
+          this.ruleForm.deptid = res.F_ProposerDeptId
396
+          this.ruleForm.deptname = res.F_ProposerDeptName
397
+          this.ruleForm.usercode = res.F_ProposerCode
398
+          this.ruleForm.username = res.F_ProposerName
399
+          this.ruleForm.phon = res.F_Phon
400
+          this.ruleForm.cartype = res.F_CarType
401
+          this.ruleForm.startplace = res.F_DepartPlace
402
+          this.ruleForm.endplace = res.F_Destination
403
+          this.ruleForm.F_CarMessage = res.F_CarMessage
404
+          this.ruleForm.remark = res.F_Remark
405
+          this.ruleForm.usertime = res.F_UseTime
406
+          this.ruleForm.birth = res.F_Birth
407
+          this.ruleForm.content = res.F_Content
408
+          this.deptid = this.$store.getters.deptmap[parseInt(res.F_ProposerDeptId)].ids
409
+          this.ruleForm.needman = res.F_ProposerCode
410
+        }
411
+      })
412
+    }
413
+    // 科室下拉改变事件
414
+    // getDepartments(data) {
415
+    //   this.ruleForm.deptid = data.value
416
+    //   this.ruleForm.deptname = data.name
417
+    // },
418
+    // 院区下拉改变事件
419
+    // getHospitals(data) {
420
+    //   this.ruleForm.hosid = data.value
421
+    //   this.ruleForm.hosname = data.name
422
+    // },
423
+    // 申请人下拉改变事件
424
+    // getRepairman(data) {
425
+    //   this.ruleForm.usercode = data.value
426
+    //   this.ruleForm.username = data.name
427
+    // },
428
+  }
429
+}
409 430
 </script>
410 431
 
411 432
 <style rel="stylesheet/scss" lang="scss" scoped>