|
|
@@ -191,7 +191,7 @@
|
|
|
default: '巡点检'
|
|
|
}
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
defaultProps: {
|
|
|
label: 'showName'
|
|
|
@@ -260,9 +260,9 @@
|
|
|
editLoading: false
|
|
|
};
|
|
|
},
|
|
|
- async created () {},
|
|
|
+ async created() {},
|
|
|
computed: {
|
|
|
- totalCost () {
|
|
|
+ totalCost() {
|
|
|
const cur = this.planDeviceList[this.currentEquItemIndex] || {};
|
|
|
const sparePart = cur?.sparePart || [];
|
|
|
|
|
|
@@ -288,12 +288,12 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- open (row) {
|
|
|
+ open(row) {
|
|
|
this.getInfo(row.id);
|
|
|
this.addPatrolPlanDialog = true;
|
|
|
},
|
|
|
// 编辑详情
|
|
|
- async getInfo (planId) {
|
|
|
+ async getInfo(planId) {
|
|
|
this.editLoading = true;
|
|
|
const res = await getById(planId).catch(() => {
|
|
|
this.editLoading = false;
|
|
|
@@ -307,7 +307,7 @@
|
|
|
},
|
|
|
|
|
|
// 获取计划配置单号
|
|
|
- async getOrderCode () {
|
|
|
+ async getOrderCode() {
|
|
|
if (this.type.includes('巡点检')) {
|
|
|
const data = await getCode('partrol_code');
|
|
|
this.$set(this.addForm, 'orderCode', data);
|
|
|
@@ -317,7 +317,7 @@
|
|
|
this.$set(this.addForm, 'orderCode', code);
|
|
|
}
|
|
|
},
|
|
|
- handleClose () {
|
|
|
+ handleClose() {
|
|
|
this.addPatrolPlanDialog = false;
|
|
|
this.$refs.addFormRef.resetFields();
|
|
|
this.currentEquItemIndex = 0;
|
|
|
@@ -325,7 +325,7 @@
|
|
|
this.addForm = {};
|
|
|
},
|
|
|
// 设备列表树点击
|
|
|
- handleNodeClick (data, node) {
|
|
|
+ handleNodeClick(data, node) {
|
|
|
const { equiLocation, equiLocationCode } = this.getEquiLocation(data);
|
|
|
this.equipmentInfo = {
|
|
|
equiCode: data.code,
|
|
|
@@ -346,7 +346,7 @@
|
|
|
equiLocationCode;
|
|
|
},
|
|
|
// 封装 - 获取设备分类列表
|
|
|
- async _getEquipmentList (planId) {
|
|
|
+ async _getEquipmentList(planId) {
|
|
|
const data = await getNotSendOrderList(planId);
|
|
|
if (!data?.length) {
|
|
|
this.$message.error('所有设备已指派完!');
|
|
|
@@ -377,20 +377,20 @@
|
|
|
});
|
|
|
},
|
|
|
//选择部门(搜索)
|
|
|
- searchDeptNodeClick (id, info) {
|
|
|
+ searchDeptNodeClick(id, info) {
|
|
|
this.addForm.executeGroupName = info?.name;
|
|
|
// 根据部门获取人员
|
|
|
- const params = { executeGroupId: id };
|
|
|
+ const params = { executeGroupId: id ? id : '' };
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.executorRef.getList(params);
|
|
|
});
|
|
|
},
|
|
|
//执行人
|
|
|
- handleExecutorChange (id, info) {
|
|
|
+ handleExecutorChange(id, info) {
|
|
|
this.addForm.executeUserName = info?.name;
|
|
|
},
|
|
|
// 封装 - 获取设备位置名称和code方法
|
|
|
- getEquiLocation (data) {
|
|
|
+ getEquiLocation(data) {
|
|
|
// 设备位置编码
|
|
|
const equiLocationCode = data.position[0].pathIds;
|
|
|
// 设备位置名称
|
|
|
@@ -398,7 +398,7 @@
|
|
|
return { equiLocation, equiLocationCode };
|
|
|
},
|
|
|
// 提交
|
|
|
- submit (isContinue = false) {
|
|
|
+ submit(isContinue = false) {
|
|
|
this.$refs.addFormRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
@@ -410,7 +410,9 @@
|
|
|
|
|
|
// 将newData拼接成一个新数组赋值给后端接收字段
|
|
|
const params = {
|
|
|
- executeGroupId: this.addForm.executeGroupId,
|
|
|
+ executeGroupId: this.addForm.executeGroupId
|
|
|
+ ? this.addForm.executeGroupId
|
|
|
+ : '',
|
|
|
executeGroupName: this.addForm.executeGroupName,
|
|
|
executeUserId: this.addForm.executeUserId,
|
|
|
executeUserName: this.addForm.executeUserName,
|