Commit 7ad0efff authored by 高铭波's avatar 高铭波

Merge branch 'dev-1.4.0'

parents 1e8ede19 fc51a653
......@@ -65,10 +65,17 @@
v-show="item.fieldsName != 'actualPaid' || show200"
:id="`item${item.fieldsId}`"
>
<view class="label" v-if="!hiddenTitle.includes(item.formType)">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}}
</view>
<view
class="label"
v-if="!hiddenTitle.includes(item.formType)"
>
<image
class="item-image"
:src="mixingImage"
v-if="item.required"
></image>
{{ item.fieldsTitle }}
</view>
<template v-if="item.fieldsType">
<xh-input
v-if="item.formType === 'input'"
......@@ -210,10 +217,28 @@
@value-change="fieldValueChange"
>
</xh-service-more>
<xh-label v-else-if="item.formType==='label'" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
<xh-label
v-else-if="item.formType === 'label'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
>
</xh-label>
<xh-parts ref="fileChildParts" v-else-if="item.formType==='parts'" :categoryId="categoryId" :brandId="brandId" :order-id="orderId" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="orderStatus === '88' || orderStatus === '86'" @value-change="fieldValueChange">
</xh-parts>
<xh-parts
ref="fileChildParts"
v-else-if="item.formType === 'parts'"
:categoryId="categoryId"
:brandId="brandId"
:order-id="orderId"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="orderStatus === '88' || orderStatus === '86'"
@value-change="fieldValueChange"
>
</xh-parts>
</template>
</u-form-item>
</view>
......@@ -274,11 +299,11 @@ import XhTime from "@/components/createCom/XhTime.vue";
import XhServiceMeasure from "@/components/createCom/XhServiceMeasure.vue";
import XhServiceMore from "../../components/createCom/XhServiceMore";
import XhLabel from "../../components/createCom/XhLabel";
import XhParts from "@/components/createCom/XhParts"
import XhParts from "@/components/createCom/XhParts";
import takePhoto from "@/components/take/index.vue";
import baseFile from "@/components/upload/index";
import Detail from "@/components/order/detail.vue";
import returnPartsVue from '../parts/returnParts.vue';
import returnPartsVue from "../parts/returnParts.vue";
// 表单类型map
const formType = new Map([
......@@ -306,7 +331,7 @@ const formType = new Map([
["date", ["time", "text"]],
["form", ["form", "text"]],
["label", ["label", "text"]],
['parts', ['parts','text']],
["parts", ["parts", "text"]],
]);
/**
......@@ -386,10 +411,10 @@ const actions = (name, pass, type, submit) => {
export default {
data() {
return {
hiddenTitle: ['location', 'form', 'label', 'parts'],
hiddenTitle: ["location", "form", "label", "parts"],
orderId: 0,
categoryId: 0,
brandId: 0,
brandId: 0,
orderServiceType: "",
inGuaranteePeriod: "",
partnerCompanyId: "",
......@@ -437,7 +462,7 @@ export default {
currentItemDate: {},
photoItem: {},
maintainStep: "partnerInspectItem",
orderStatus: ''
orderStatus: "",
// showTab: true,
};
},
......@@ -455,7 +480,7 @@ export default {
XhServiceMeasure,
XhServiceMore,
XhLabel,
XhParts,
XhParts,
Detail,
"take-photo": takePhoto,
},
......@@ -469,12 +494,12 @@ export default {
this.maintainStep = option.maintainStep;
this.orderId = option.orderId;
this.categoryId = option.categoryId;
this.brandId = option.brandId
this.brandId = option.brandId;
this.orderServiceType = decodeURIComponent(option.orderServiceType);
this.inGuaranteePeriod = option.inGuaranteePeriod;
this.partnerCompanyId = option.partnerCompanyId;
this.auditResultsId = option.auditResultsId;
this.orderStatus = option.orderStatus
this.orderStatus = option.orderStatus;
// this.showTab =item.partnerCompanyName == '挚达充电桩'
} else {
this.orderId = 11880091;
......@@ -550,7 +575,7 @@ export default {
},
initData(res) {
this.form = res.data.value || {};
this.initFormData();
const list = res.data.config.sort((a, b) => a.order - b.order);
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName) this.tabIndex = index;
......@@ -586,6 +611,26 @@ export default {
if (this.auditResultsId) this.checkCompleteError();
uni.hideLoading();
},
initFormData() {
this.loadOrderDetail();
},
loadOrderDetail() {
if (!this.$u.test.isEmpty(this.form) && this.form.hasOwnProperty("installComfirmTime")
&& this.$u.test.isEmpty(this.form.installComfirmTime)) {
this.$u.api.orderDetail(null, this.orderId).then((res) => {
if (res.code == 200) {
if (!this.$u.test.isEmpty(res.data.checkInDateTime)) {
this.$set(
this.form,
"installComfirmTime",
this.moment(res.data.checkInDateTime).format("YYYY-MM-DD")
);
}
}
});
}
},
checkCompleteError() {
// 异常单定位错误项
let self = this;
......@@ -610,10 +655,16 @@ export default {
handleSaveData() {
let param = {};
const name = this.list[this.tabIndex].panelFieldsName;
this.list.forEach((panel) => {
param[panel.panelFieldsName] = [];
panel.items.forEach((group) => {
group.items.forEach((ele) => {
if(name === "partnerInspectItem") {
if(!this.form?.installationMethodType) {
this.$set(this.form, "installationMethodType", this.form.installType);
}
}
if (this.form[ele.fieldsName]) {
param[panel.panelFieldsName].push({
fieldsName: ele.fieldsName,
......@@ -627,10 +678,11 @@ export default {
});
return param;
},
saveComplete(){// 保存完工信息
// this.submitParts() // 不调这个接口;没完工不能调提交配件
const param = this.handleSaveData()
this.$u.api.saveCompleteData(param,this.orderId).then((res)=>{
saveComplete() {
// 保存完工信息
// this.submitParts() // 不调这个接口;没完工不能调提交配件
const param = this.handleSaveData();
this.$u.api.saveCompleteData(param, this.orderId).then((res) => {
if (res.code == 200) {
this.$refs.uToast.show({
title: "保存成功",
......@@ -666,17 +718,17 @@ export default {
panelResult.submitted++;
} else if (value && Array.isArray(value) && value.length > 0) {
if (ele.fieldsName === "materialList") {
let hasMate = false
let hasMate = false;
let mateRow = value.find((mate) => {
if(mate.hasOwnProperty("useLength")) {
hasMate = true
return !this.$u.test.isEmpty(mate.useLength)
if (mate.hasOwnProperty("useLength")) {
hasMate = true;
return !this.$u.test.isEmpty(mate.useLength);
}
});
if (!hasMate || !this.$u.test.isEmpty(mateRow)) {
panelResult.submitted++;
}
panelResult.submitted++;
panelResult.submitted++;
} else {
panelResult.submitted++;
}
......@@ -793,26 +845,26 @@ export default {
if (this.oldItemId) this.itemId = this.oldItemId;
});
},
// 提交配件信息
submitParts() {
if (this.form.orderSpareParts) {
const orderSpareParts = JSON.parse(this.form.orderSpareParts)
const lists = orderSpareParts.filter(v => v.quantity > 0)
const params = {
workOrderId: this.orderId,
applyType: '10',
parts: lists ? JSON.stringify(lists) : ''
}
this.$u.api.createParts(params).then(res => {
if (res.code !== 200) {
this.$refs.uToast.show({
title: res.data,
type: 'error',
})
}
})
}
},
// 提交配件信息
submitParts() {
if (this.form.orderSpareParts) {
const orderSpareParts = JSON.parse(this.form.orderSpareParts);
const lists = orderSpareParts.filter((v) => v.quantity > 0);
const params = {
workOrderId: this.orderId,
applyType: "10",
parts: lists ? JSON.stringify(lists) : "",
};
this.$u.api.createParts(params).then((res) => {
if (res.code !== 200) {
this.$refs.uToast.show({
title: res.data,
type: "error",
});
}
});
}
},
// 提交订单
orderFinish() {
const param = this.handleSaveData();
......@@ -828,7 +880,7 @@ export default {
if (this.inGuaranteePeriod === "Y") {
this.$u.api.inOrderFinish(this.orderId).then((res) => {
if (res.code == 200) {
this.submitParts()
this.submitParts();
this.$refs.uToast.show({
title: "提交成功",
type: "success",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment