Commit fc3a64d9 authored by Facius's avatar Facius

Merge branch 'dev-1.4.3' into test

parents 60a5fd79 ef4f9e56
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
:itemIndex="itemIndex" :itemIndex="itemIndex"
:item="item" :item="item"
:value="form[item.fieldsName] || ''" :value="form[item.fieldsName] || ''"
:disabled=" exception || readOnly " :disabled="exception || readOnly"
@value-change="fieldValueChange" @value-change="fieldValueChange"
> >
</xh-parts> </xh-parts>
...@@ -545,11 +545,13 @@ export default { ...@@ -545,11 +545,13 @@ export default {
//console.log(this.form.name, 'form.name') //console.log(this.form.name, 'form.name')
}, },
computed: { computed: {
exception() { exception() {
return this.orderStatus == '86' return this.orderStatus == '86'
}, },
readOnly() { readOnly() {
return [80, 81, 85, 87, 89, 88, 110].indexOf(Number(this.orderStatus)) != -1 return (
[80, 81, 85, 87, 89, 88, 110].indexOf(Number(this.orderStatus)) != -1
)
}, },
tabList() { tabList() {
// 没有数据的时候tab要有占位数据,不然有页面有晃动 // 没有数据的时候tab要有占位数据,不然有页面有晃动
...@@ -648,12 +650,12 @@ export default { ...@@ -648,12 +650,12 @@ export default {
// this.showTab = this.list.length > 1 // this.showTab = this.list.length > 1
// 异常单处理 // 异常单处理
if (this.exception){ if (this.exception) {
if (this.auditResults.length === 0) { if (this.auditResults.length === 0) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '未找到不通过项', title: '未找到不通过项',
type: 'error', type: 'error',
back: true back: true,
}) })
} }
this.checkCompleteError(list) this.checkCompleteError(list)
...@@ -943,23 +945,30 @@ export default { ...@@ -943,23 +945,30 @@ export default {
}, },
// 提交配件信息 // 提交配件信息
submitParts() { submitParts() {
if (this.form.orderSpareParts) { return new Promise((resolve, reject) => {
const orderSpareParts = JSON.parse(this.form.orderSpareParts) if (this.form.orderSpareParts) {
const lists = orderSpareParts.filter((v) => v.quantity > 0) const orderSpareParts = JSON.parse(this.form.orderSpareParts)
const params = { const lists = orderSpareParts.filter((v) => v.quantity > 0)
workOrderId: this.orderId, const params = {
applyType: '10', workOrderId: this.orderId,
parts: lists ? JSON.stringify(lists) : '', 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',
})
} }
}) this.$u.api.createParts(params).then((res) => {
} if (res.code !== 200) {
this.$refs.uToast.show({
title: res.data,
type: 'error',
})
resolve(false)
}
resolve(true)
})
} else {
resolve(true)
}
})
}, },
// 提交订单 // 提交订单
orderFinish() { orderFinish() {
...@@ -970,15 +979,18 @@ export default { ...@@ -970,15 +979,18 @@ export default {
mobile: this.vuex_user.mobile, mobile: this.vuex_user.mobile,
orderId: Number(this.orderId), orderId: Number(this.orderId),
}) })
this.$u.api.saveCompleteData(param, this.orderId).then((res) => { this.$u.api.saveCompleteData(param, this.orderId).then(async (res) => {
if (res.code == 200) { if (res.code == 200) {
//完工项信息保存成功再次完工工单 //完工项信息保存成功再次完工工单
if (!this.exception) { // 核销配件
const submitPart = await this.submitParts()
if (!submitPart) return
}
if (this.inGuaranteePeriod === 'Y') { if (this.inGuaranteePeriod === 'Y') {
this.$u.api.inOrderFinish(this.orderId).then((res) => { this.$u.api.inOrderFinish(this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (!this.exception) {
this.submitParts()
}
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '提交成功', title: '提交成功',
type: 'success', 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