|
@@ -1,5 +1,6 @@
|
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
|
import { orderBaseDetail, orderBaseProductList } from '@/api/workOrderPool.js'
|
|
|
+
|
|
|
var initdata_ = {
|
|
|
// 基础信息--------------------
|
|
|
// 维保项目
|
|
@@ -117,87 +118,105 @@ export default {
|
|
|
btnRestrict() {
|
|
|
// 1,保存 2,过程反馈 3,设为异常 4,加急 5,不加急 6,取消工单 7,回访 8,新建工单 9,工单驳回 10,激活工单
|
|
|
var btns = []
|
|
|
- if (this.orderInfo) {
|
|
|
- if (this?.orderInfo?.isImport) {
|
|
|
- return []
|
|
|
- }
|
|
|
|
|
|
- btns =
|
|
|
- {
|
|
|
- // 待预约
|
|
|
- DYY: [20],
|
|
|
- // 待商户派工
|
|
|
- DSHPG: [1, 2, 4, 5, 6, 20],
|
|
|
- // 待网点派工
|
|
|
- DWDPG: [1, 2, 4, 5, 6, 20],
|
|
|
- // 待接单
|
|
|
- DJD: [1, 2, 4, 5, 6, 20],
|
|
|
- // 服务中
|
|
|
- FWZ: [1, 2, 3, 4, 5, 6, 20],
|
|
|
- // 异常单
|
|
|
- YCD: [1, 2, 6, 20],
|
|
|
- // 已完工待结算
|
|
|
- YWG: [7, 8, 9, 20],
|
|
|
- // 已结算
|
|
|
- YJS: [20],
|
|
|
- // 已取消
|
|
|
- YQX: [10, 20],
|
|
|
- // 待抢单
|
|
|
- DQD: [1, 2, 4, 5, 6, 20]
|
|
|
- }[this.orderInfo.orderStatus] || []
|
|
|
+ if (["DYY"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 待预约
|
|
|
+ btns = [20]
|
|
|
+ } else if (["DQD"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 待抢单
|
|
|
+ btns = [1, 2, 4, 5, 6, 20]
|
|
|
+ } else if (["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 待商户派工
|
|
|
+ btns = [1, 2, 4, 5, 6, 20]
|
|
|
+ } else if (["DWDPG", "DWDPD", "WDBH"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 待网点派工
|
|
|
+ btns = [1, 2, 4, 5, 6, 20]
|
|
|
+ } else if (["DJD", "DSM", "YZP"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 待接单
|
|
|
+ btns = [1, 2, 4, 5, 6, 20]
|
|
|
+ } else if (["FWZ", "GCSZT", "BFWG"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 服务中
|
|
|
+ btns = [1, 2, 3, 4, 5, 6, 20]
|
|
|
+ } else if (["YCD"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 异常单
|
|
|
+ btns = [1, 2, 6, 20]
|
|
|
+ } else if (["YWG", "GCSZX", "WDWG", "YWGO"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 已完工待结算
|
|
|
+ btns = [7, 8, 9, 20]
|
|
|
+ } else if (["YJS", "LRCD"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 已结算
|
|
|
+ btns = [20]
|
|
|
+ } else if (["YQX", "FWZT", "YCGB", "FWQX"].includes(this?.orderInfo?.orderStatus)) {
|
|
|
+ // 已取消
|
|
|
+ btns = [10, 20]
|
|
|
}
|
|
|
-
|
|
|
// 已经加急
|
|
|
if ((this.orderInfo.orderFlags || []).find(item => item.tag == 'JIA_JI')) {
|
|
|
btns = btns.filter(item => !new Set([4]).has(item))
|
|
|
} else {
|
|
|
btns = btns.filter(item => !new Set([5]).has(item))
|
|
|
}
|
|
|
-
|
|
|
// 已经异常
|
|
|
if ((this.orderInfo.orderFlags || []).find(item => item.tag == 'YI_CHANGE')) {
|
|
|
btns = btns.filter(item => !new Set([3]).has(item))
|
|
|
}
|
|
|
-
|
|
|
return btns
|
|
|
},
|
|
|
// 处理每个字段是否可编辑
|
|
|
formOptions() {
|
|
|
- var finish = !!~['YWG', 'YJS', 'YQX'].indexOf(this.orderInfo.orderStatus)
|
|
|
+ // 已完工, 已结算, 已取消
|
|
|
+ var finish = (
|
|
|
+ ["YWG", "GCSZX", "WDWG", "YWGO"].includes(this?.orderInfo?.orderStatus) ||
|
|
|
+ ["YJS", "LRCD"].includes(this?.orderInfo?.orderStatus) ||
|
|
|
+ ["YQX", "FWZT", "YCGB", "FWQX"].includes(this?.orderInfo?.orderStatus)
|
|
|
+ );
|
|
|
+
|
|
|
+ // 待商户派工, 待网点派工, 待接单, 待预约
|
|
|
+ var isQD = (
|
|
|
+ ["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(this?.orderInfo?.orderStatus) ||
|
|
|
+ ["DWDPG", "DWDPD", "WDBH"].includes(this?.orderInfo?.orderStatus) ||
|
|
|
+ ["DJD", "DSM", "YZP"].includes(this?.orderInfo?.orderStatus) ||
|
|
|
+ ["DQD"].includes(this?.orderInfo?.orderStatus) ||
|
|
|
+ undefined === this?.orderInfo?.orderStatus
|
|
|
+ )
|
|
|
+
|
|
|
+ // 非新创建
|
|
|
+ var notNewOrder = !!this.id
|
|
|
+
|
|
|
return {
|
|
|
// 基础信息--------------------
|
|
|
// 维保项目
|
|
|
rpProjectRepairId: {
|
|
|
- isEdit: this.id ? false : true,
|
|
|
+ isEdit: notNewOrder,
|
|
|
isShow: this.workOrderType == 4,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 工程项目
|
|
|
projectNo: {
|
|
|
- isEdit: this.id ? false : true,
|
|
|
+ isEdit: notNewOrder,
|
|
|
isShow: this.workOrderType == 2,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
projectName: {
|
|
|
- isEdit: this.id ? false : true,
|
|
|
+ isEdit: notNewOrder,
|
|
|
isShow: this.workOrderType == 2,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 客户名称
|
|
|
userName: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
+ isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 联系人
|
|
|
linkName: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
+ isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 客户电话
|
|
|
userMobile: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
+ isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
isShow: true,
|
|
|
isRules: [...mobileRequired]
|
|
|
},
|
|
@@ -209,31 +228,31 @@ export default {
|
|
|
},
|
|
|
// gps地址
|
|
|
gpsAddress: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
+ isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 详细地址
|
|
|
address: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
+ isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
|
|
|
isShow: true,
|
|
|
isRules: []
|
|
|
},
|
|
|
// 服务信息--------------------------------
|
|
|
// 工单类型
|
|
|
orderSmallType: {
|
|
|
- isEdit: this.id ? false : true,
|
|
|
+ isEdit: notNewOrder,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
orderChannelId: {
|
|
|
- isEdit: this.id ? false : true,
|
|
|
+ isEdit: notNewOrder,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 预约上门日期
|
|
|
appointmentTime: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: []
|
|
|
},
|
|
@@ -243,49 +262,47 @@ export default {
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
saleCompany: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: []
|
|
|
},
|
|
|
source: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: []
|
|
|
},
|
|
|
// 产品信息------------------------
|
|
|
orderProducts: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish && !this.orderInfo.isCj,
|
|
|
+ isEdit: !finish && !this.orderInfo.isCj,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
// 其它信息------------------------
|
|
|
// 备注
|
|
|
remark: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: []
|
|
|
},
|
|
|
// 派单信息-----------------------------
|
|
|
// 服务商网点
|
|
|
websitId: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
isQd: {
|
|
|
- isEdit: this?.orderInfo?.isImport
|
|
|
- ? false
|
|
|
- : !!~['DSHPG', 'DWDPG', 'DJD', 'DQD', undefined].indexOf(this.orderInfo.orderStatus),
|
|
|
+ isEdit: isQD,
|
|
|
isShow: true,
|
|
|
isRules: [...required]
|
|
|
},
|
|
|
workerId: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
|
|
|
},
|
|
|
orderWorkers: {
|
|
|
- isEdit: this?.orderInfo?.isImport ? false : !finish,
|
|
|
+ isEdit: !finish,
|
|
|
isShow: true,
|
|
|
isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
|
|
|
}
|