|
|
|
@ -42,24 +42,26 @@
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
<a-card :bodyStyle="tstyle" :bordered="false">
|
|
|
|
|
<div class="title"><i class="iconfont icon-fuwu"></i><span>货物状态</span></div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<a-tooltip v-for="(serive, sindex) in booGoodsStatusItem" :key="`${serive.systemCode}_${sindex}`">
|
|
|
|
|
<template v-if="serive.finishTime" #title>
|
|
|
|
|
<p>时间:{{ serive.finishTime }}</p>
|
|
|
|
|
<p v-if="serive.remark">备注:{{ serive.remark }}</p>
|
|
|
|
|
<p v-if="serive.extData">显示天数:{{ serive.extData }}</p>
|
|
|
|
|
</template>
|
|
|
|
|
<div
|
|
|
|
|
class="items"
|
|
|
|
|
:class="{ active: locaGoodsStatus.includes(serive.systemCode) }"
|
|
|
|
|
@click="saveGoodsStatus(serive)"
|
|
|
|
|
>
|
|
|
|
|
{{ serive.statusName }}
|
|
|
|
|
<div class="edit" @click.stop="FnOpenEdit(serive)"><a-icon type="edit" /></div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<a-spin :spinning="spinning" :delay="delayTime">
|
|
|
|
|
<div class="title"><i class="iconfont icon-fuwu"></i><span>货物状态</span></div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<a-tooltip v-for="(serive, sindex) in booGoodsStatusItem" :key="`${serive.configId}_${sindex}`">
|
|
|
|
|
<template v-if="serive.finishTime" #title>
|
|
|
|
|
<p>时间:{{ serive.finishTime }}</p>
|
|
|
|
|
<p v-if="serive.remark">备注:{{ serive.remark }}</p>
|
|
|
|
|
<p v-if="serive.extData">显示天数:{{ serive.extData }}</p>
|
|
|
|
|
</template>
|
|
|
|
|
<div
|
|
|
|
|
class="items"
|
|
|
|
|
:class="{ active: locaGoodsStatus.includes(serive.configId) }"
|
|
|
|
|
@click="saveGoodsStatus(serive)"
|
|
|
|
|
>
|
|
|
|
|
{{ serive.statusName }}
|
|
|
|
|
<div class="edit" @click.stop="FnOpenEdit(serive)"><a-icon type="edit" /></div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</a-card>
|
|
|
|
|
<a-modal v-model="GoodsStatusVisible" width="600px" title="编辑" @ok="GoodsStatusHandleOk">
|
|
|
|
|
<a-form :form="StatusVisibleForm">
|
|
|
|
@ -305,6 +307,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
delayTime: 500,
|
|
|
|
|
spinning: false,
|
|
|
|
|
id: this.$route.query.id,
|
|
|
|
|
tstyle: { padding: '0 15px 15px', 'margin-bottom': '10px', background: '#fff' },
|
|
|
|
|
remarkModelvisible: false,
|
|
|
|
@ -365,14 +369,15 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (this.details.goodsStatus) {
|
|
|
|
|
// return this.details.goodsStatus.map((item, index) => {
|
|
|
|
|
// return item.systemCode
|
|
|
|
|
// return item.configId
|
|
|
|
|
// })
|
|
|
|
|
let data = []
|
|
|
|
|
this.details.goodsStatus.forEach(item => {
|
|
|
|
|
if (item.finishTime) {
|
|
|
|
|
data.push(item.systemCode)
|
|
|
|
|
data.push(item.configId)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(data)
|
|
|
|
|
return data
|
|
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
@ -644,8 +649,8 @@ export default {
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (!this.locaGoodsStatus.includes(this.GoodsStatusEditData.systemCode)) {
|
|
|
|
|
this.locaGoodsStatus.push(this.GoodsStatusEditData.systemCode)
|
|
|
|
|
if (!this.locaGoodsStatus.includes(this.GoodsStatusEditData.configId)) {
|
|
|
|
|
this.locaGoodsStatus.push(this.GoodsStatusEditData.configId)
|
|
|
|
|
this.details.goodsStatus.push({ ...AData })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -656,7 +661,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.details.goodsStatus.forEach(item => {
|
|
|
|
|
if (item.finishTime) {
|
|
|
|
|
if (item.systemCode == this.GoodsStatusEditData.systemCode) {
|
|
|
|
|
if (item.configId == this.GoodsStatusEditData.configId) {
|
|
|
|
|
ApiData.item.push(AData)
|
|
|
|
|
} else {
|
|
|
|
|
ApiData.item.push(item)
|
|
|
|
@ -671,7 +676,7 @@ export default {
|
|
|
|
|
// this.booGoodsStatusItem.forEach(item => {
|
|
|
|
|
// let type = true
|
|
|
|
|
// ApiData.item.forEach(item2 => {
|
|
|
|
|
// if (item.systemCode == item2.systemCode) {
|
|
|
|
|
// if (item.configId == item2.configId) {
|
|
|
|
|
// type = false
|
|
|
|
|
// data.push(item2)
|
|
|
|
|
// }
|
|
|
|
@ -716,12 +721,16 @@ export default {
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
saveGoodsStatus(data) {
|
|
|
|
|
console.log(data)
|
|
|
|
|
if (!this.id) {
|
|
|
|
|
this.$message.error('请先保存主单')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (!this.locaGoodsStatus.includes(data.systemCode)) {
|
|
|
|
|
this.locaGoodsStatus.push(data.systemCode)
|
|
|
|
|
if (!this.locaGoodsStatus.includes(data.configId)) {
|
|
|
|
|
console.log(data, 'asdasd', data.configId)
|
|
|
|
|
// this.locaGoodsStatus.push(data.configId)
|
|
|
|
|
console.log(this.details.goodsStatus)
|
|
|
|
|
console.log(this.locaGoodsStatus)
|
|
|
|
|
// this.details.goodsStatus.push({ ...data })
|
|
|
|
|
this.savegoodsStatusItem(data, 'push')
|
|
|
|
|
} else {
|
|
|
|
@ -732,11 +741,11 @@ export default {
|
|
|
|
|
okType: 'danger',
|
|
|
|
|
cancelText: '否',
|
|
|
|
|
onOk() {
|
|
|
|
|
const index = that.locaGoodsStatus.indexOf(data.systemCode)
|
|
|
|
|
const index = that.locaGoodsStatus.indexOf(data.configId)
|
|
|
|
|
|
|
|
|
|
that.locaGoodsStatus.splice(index, 1)
|
|
|
|
|
that.details.goodsStatus.forEach((item, index2) => {
|
|
|
|
|
if (item.systemCode == data.systemCode) {
|
|
|
|
|
if (item.configId == data.configId) {
|
|
|
|
|
that.$emit('inGoodsSave', true)
|
|
|
|
|
that.details.goodsStatus.splice(index2, 1)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -754,6 +763,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
savegoodsStatusItem(data, type) {
|
|
|
|
|
console.log(data)
|
|
|
|
|
let ApiData = {
|
|
|
|
|
bookingId: this.id,
|
|
|
|
|
item: []
|
|
|
|
@ -768,7 +778,7 @@ export default {
|
|
|
|
|
let date = new Date(+new Date() + 8 * 3600 * 1000)
|
|
|
|
|
ApiData.item.push({ ...data, finishTime: date.toISOString() })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.spinning = true
|
|
|
|
|
BookingOrderSaveGoodsStatus(ApiData)
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
@ -779,9 +789,11 @@ export default {
|
|
|
|
|
this.$emit('inGoodsSave', false)
|
|
|
|
|
}, 400)
|
|
|
|
|
}
|
|
|
|
|
this.spinning = false
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
this.spinning = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|