diff --git a/src/api/repairRelation.ts b/src/api/repairRelation.ts
new file mode 100644
index 0000000..e567980
--- /dev/null
+++ b/src/api/repairRelation.ts
@@ -0,0 +1,13 @@
+import http from './http'
+
+
+// 维修工单点检项关系查询
+export function getRepairRelationNoPage(params) {
+ return http.get('/inspection/repair-relation/noPage',{params})
+}
+
+// 删除点检项和报修工单关系
+export function deleteBatchByIds(ids: number[]) {
+ return http.delete(`/inspection/repair-relation/deleteBatchByIds?ids=` + ids)
+}
+
diff --git a/src/pages.json b/src/pages.json
index 9be7f9d..3d4d2e9 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -272,6 +272,13 @@
{
"navigationBarTitleText" : ""
}
+ },
+ {
+ "path" : "pages/repairOrder/customModal",
+ "style" :
+ {
+ "navigationBarTitleText" : ""
+ }
}
],
"tabBar": {
diff --git a/src/pages/overhaulOrder/addForm.vue b/src/pages/overhaulOrder/addForm.vue
index d87c002..71d85a0 100644
--- a/src/pages/overhaulOrder/addForm.vue
+++ b/src/pages/overhaulOrder/addForm.vue
@@ -46,6 +46,16 @@
+
+
+
+ {{form.sourceTypeName}}
+
+
+ {{`请选择工单来源`}}
+
+
+
@@ -81,7 +91,7 @@
{{item.name}}
-
+
@@ -93,14 +103,14 @@
预估分钟:
{{item.estimatedMinutes}}分钟
-
- 实际分钟:
- {{item.actualMinutes}}分钟
-
责任人:
{{item.chargePeoplesName}}
+
@@ -190,6 +200,7 @@
import * as repairOrderApi from "@/api/repairOrder"
import * as deviceApi from "@/api/device"
import * as deptApi from "@/api/dept"
+ import * as repairRelationApi from "@/api/repairRelation"
const { proxy } = getCurrentInstance()
const loading = ref(false)
@@ -205,7 +216,9 @@
deviceNumber: '',
faultTypeName: '',
maintenance:'',
- subList: []
+ subList: [],
+ sourceType: '',
+ sourceTypeName: ''
})
@@ -222,6 +235,7 @@
const isShowSelecUser = ref(false)
const chooseUserInfo = ref(null)
const serviceList = ref([])
+ const sourceType = ref()
const list = ref([{
name: '检修内容'
}])
@@ -248,6 +262,24 @@
proxy.$modal.showToast('请选择维修人员')
return;
}
+
+ for (let item of serviceList.value) {
+ if (item.name_hide_delete) {
+ if (!item.peoples) {
+ proxy.$modal.showToast('*'+item.name+'*的检修项的【预估人数】不能为空');
+ return; // 中断方法执行
+ }
+ if (!item.estimatedMinutes) {
+ proxy.$modal.showToast('*'+item.name+'*的检修项的【预估分钟】不能为空');
+ return; // 中断方法执行
+ }
+ if (!item.chargePeoples) {
+ proxy.$modal.showToast('*'+item.name+'*的检修项的【责任人】不能为空');
+ return; // 中断方法执行
+ }
+ }
+ }
+
const data = {
id: form.value && form.value.id ? form.value.id : '',
describes: form.value.describes,
@@ -325,7 +357,10 @@
deviceNumber:'',
faultTypeName:'',
maintenance:'',
- subList: []
+ subList: [],
+ sourceType: '',
+ sourceTypeName: ''
+
}
isDisabled.value = false
}
@@ -444,6 +479,7 @@
isDisabled.value = form.value.maintenanceNumber || form.value.id ? true : false
};
faultType.value = await dictApi.getDict('fault_type')
+ sourceType.value = await dictApi.getDict('order_source_type')
uni.$on('chooseOrder', data => {
if (data) {
form.value.maintenanceNumber = data.number
@@ -453,6 +489,7 @@
form.value.factoryAreaName = data.factoryAreaName
form.value.factoryAreaNumber = data.factoryAreaNumber
form.value.subList= data.subList
+ form.value.sourceType=data.sourceType
isDisabled.value = true
} else {
form.value.maintenanceNumber = ''
@@ -462,16 +499,27 @@
form.value.factoryAreaName = ''
form.value.factoryAreaNumber = ''
form.value.subList= []
+ form.value.sourceType='0'
isDisabled.value = false
}
-
+ form.value.sourceTypeName = sourceType.value.find(item=>item.value == form.value.sourceType).label
+ if(form.value.sourceType == '1'){
+ repairRelationApi.getRepairRelationNoPage({repairNumber:form.value.maintenanceNumber}).then(response=>{
+ serviceList.value = response.data.map(item=>{
+ return {
+ name: item.spotInspectionName,
+ name_hide_delete: true,
+ }
+ })
+ })
+ }
})
// 从其他页面返回时,处理回写数据
uni.$on('handleSubmitForm', (formData) => {
// 更新 serviceList
- if (formData.id) {
+ if (formData.name_hide_delete) {
// 更新已有项目
- const index = serviceList.value.findIndex(item => item.id === formData.id);
+ const index = serviceList.value.findIndex(item => item.name === formData.name);
if (index !== -1) {
serviceList.value.splice(index, 1, formData);
}
@@ -606,6 +654,7 @@
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
+ padding: 3rpx 30rpx;
uni-view {
display: inline-block;
}
@@ -768,7 +817,6 @@
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
display: flex;
-
.title-txt {
color: #409eff;
font-size: 30rpx;
diff --git a/src/pages/overhaulOrder/addSubItem.vue b/src/pages/overhaulOrder/addSubItem.vue
index 392e45e..a64e648 100644
--- a/src/pages/overhaulOrder/addSubItem.vue
+++ b/src/pages/overhaulOrder/addSubItem.vue
@@ -11,10 +11,7 @@
-
-
-
-
+
{{selectFormatCheck(form.chargePeoples,selecUserList)}}
@@ -25,6 +22,9 @@
+
-
+