diff --git a/src/views/main/BookingLedger/detail/modules/rightContent.vue b/src/views/main/BookingLedger/detail/modules/rightContent.vue index 5d9f1eb..73258dc 100644 --- a/src/views/main/BookingLedger/detail/modules/rightContent.vue +++ b/src/views/main/BookingLedger/detail/modules/rightContent.vue @@ -3,7 +3,11 @@
注意事项 - +
@@ -22,7 +26,7 @@
- 校验失败 再次校验 + 校验失败 再次校验
@@ -35,16 +39,18 @@
服务项目
-
-
- {{ serive.name }} + +
+
+ {{ serive.projectName }} +
-
+
船舶动态 @@ -119,47 +125,57 @@ -
货物状态
+
货物状态 + +
- - +
- {{ serive.statusName }} -
+ v-for="(serive, sindex) in booGoodsStatusItem" + :class="{ isBr: changeGoods && serive.isBr }" + :key="`${serive.configId}_${sindex}`"> + + +
+
+ {{ serive.showName }} +
+
+ +
+
+
+ + +
+
+
{{ serive.showName }}
+
+ +
+
+
+
- +
+
- - - - - - - - - - - - - - - - - - - - - -
备注 @@ -285,7 +301,34 @@
- + + + + + + + + + + + + + + + + + + + + + + + + {{ roleData.ruleNotice }} - - + + 新增 当前状态:{{ ruleLog.length > 0 ? ruleLog[0].statusName : '' }} - - + + 修改 @@ -386,25 +423,15 @@ > - +
@@ -423,7 +450,13 @@ import { refreshSailingDate, GetRuleOpinionLog, SubmitRule0pinion, - SaveDataInList + SaveDataInList, + GetSeryiceProjectList, + CancelSeryiceProject, + SaveServiceProject, + GetServiceStatusList, + SaveServiceStatus, + CancelServiceStatus } from '@/api/modular/main/BookingLedger' export default { @@ -457,7 +490,9 @@ export default { ruleLog: [], spinningRule: false, StatusVisibleFlag: true, + goodStatusLoading: false, id: this.id, + seriveLoading: false, ruleForm: this.$form.createForm(this), isCopy: this.$route.query.isCopy, tstyle: { padding: '0 15px 15px', 'margin-bottom': '10px', background: '#fff' }, @@ -479,7 +514,9 @@ export default { bookingServiceItem: [], atdLoading: false, booGoodsStatusItem: [], + time: null, bookingAttachType: [], + changeGoods: true, attachName: '', attachCode: '', editRemarkVal: null, @@ -522,7 +559,7 @@ export default { if (this.details.goodsStatus) { const data = [] this.details.goodsStatus.forEach(item => { - if (item.finishTime || item.remark) { + if (item.setActDate || item.remark) { data.push(item.configId) } }) @@ -683,32 +720,69 @@ export default { }, init() { this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type') - this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item') - BookingOrderGetGoodsStatusList({ bookingId: this.id }).then(res => { - this.booGoodsStatusItem = res.data - this.$emit('handleComplete') - if (this.$route.query.isCopy) { - this.booGoodsStatusItem.forEach(item => { - delete item.isPublic - delete item.finishUserId - delete item.finishTime - delete item.finishUser - delete item.remark - delete item.extData - }) - if (this.details.goodsStatus) { - this.details.goodsStatus.forEach(item => { - delete item.isPublic - delete item.finishUserId - delete item.finishTime - delete item.finishUser - delete item.remark - delete item.extData - }) + this.getServiceItemList(1) + this.getStatusServiceList(1) + }, + getStatusServiceList(type, code) { + const data = { + bookingId: this.$route.query.id, + queryType: 2 + } + if (type == 2) { + this.booGoodsStatusItem.forEach(item => { + if (item.statusSKUCode == code) { + item.isYield = !item.isYield + } + }) + } + this.spinning = true + GetServiceStatusList(data).then(res => { + if (res.data.succ) { + // res.data.ext.forEach((item, index) => { + // item.isBr = false + // console.log(item.isBr, index) + // if (item.isEnd) { + // console.log(index) + // res.data.ext.splice(index + 1, 0, { isBr: true }) + // } + // }) + for (let i = 0; i < res.data.ext.length; i++) { + if (res.data.ext[i].isEnd) { + res.data.ext.splice(i + 1, 0, { isBr: true }) + } } + this.booGoodsStatusItem = res.data.ext + } else { + this.$message.error(res.message) } + this.spinning = false }) }, + getServiceItemList(type, code) { + if (type == 1) { + this.seriveLoading = true + const data = { + bookingId: this.$route.query.id, + queryType: 0 + } + GetSeryiceProjectList(data).then(res => { + if (res.data.succ) { + this.bookingServiceItem = res.data.ext + } else { + this.$message.error(res.msg) + } + this.seriveLoading = false + }) + } else { + // this.bookingServiceItem.forEach(item => { + // if (item.projectCode == code) { + // item.isYield = !item.isYield + // } + // }) + this.spinning = true + this.getStatusServiceList(1) + } + }, checkFun() { this.$message.loading({ content: '校验中...' }) ExcuteRulesOceanBooking(this.id) @@ -890,39 +964,64 @@ export default { this.details.log[index].showMore = !this.details.log[index].showMore this.$forceUpdate() }, - + stopTimer() { + window.clearTimeout(this.time); +}, saveService(data) { + var date = new Date(); + console.log(date.valueOf()) if (!this.id) { this.$message.error('请先保存主单') return false } - if (!this.locaService.includes(data.code)) { - this.locaService.push(data.code) - this.details.item.push({ - code: data.code, - value: data.name + const obj = { + bookingId: this.$route.query.id, + projectCodes: [data.projectCode] + } + // this.seriveLoading = true + if (!data.isYield) { + this.bookingServiceItem.forEach(item => { + if (item.projectCode == data.projectCode) { + item.isYield = !item.isYield + } + }) + SaveServiceProject(obj).then(res => { + if (res.data.succ) { + if (this.time !== null) { + this.stopTimer() + } + this.time = setTimeout(() => { + this.spinning = true + this.getServiceItemList(2, data.projectCode) + }, 500) + } else { + this.$message.error(res.message) + this.spinning = false + this.getServiceItemList(1) + } }) } else { - const index = this.locaService.indexOf(data.code) - this.locaService.splice(index, 1) - this.details.item.splice(index, 1) - } - - this.saveServiceItem() - }, - saveServiceItem() { - SaveServiceItem({ - bookingId: this.id, - item: this.details.item - }) - .then(res => { - if (res.success) { - console.log('== 服务项目设置成功 ==') + this.bookingServiceItem.forEach(item => { + if (item.projectCode == data.projectCode) { + item.isYield = !item.isYield } }) - .catch(err => { - console.log(err) + CancelSeryiceProject(obj).then(res => { + if (res.data.succ) { + if (this.time !== null) { + this.stopTimer() + } + this.time = setTimeout(() => { + this.spinning = true + this.getServiceItemList(2, data.projectCode) + }, 500) + } else { + this.$message.error(res.message) + this.spinning = false + this.getServiceItemList(1) + } }) + } }, GoodsStatusHandleOk() { const { @@ -937,79 +1036,67 @@ export default { } } - let date = '' - if (values.finishTime) { - if (values.finishTime._d) { - date = new Date(+new Date(values.finishTime._d) + 8 * 3600 * 1000) - } else { - if (values.finishTime.split('"').length == 3) { - date = new Date(+new Date(values.finishTime.split('"')[1])) - } else { - date = new Date(+new Date(values.finishTime) + 8 * 3600 * 1000) - } - } - } const data = { - finishTime: date ? date.toISOString() : '', - remark: values.remark, - extData: values.extData - } - - const AData = { ...this.GoodsStatusEditData, ...data } - if (!this.id) { - this.$message.error('请先保存主单') - return false + bookingId: this.$route.query.id, + statusCodes: [{ + setActDate: values.setActDate, + actRemark: values.actRemark, + setActVal: values.setActVal, + statusCode: this.GoodsStatusEditData.statusSKUCode + }] } - if (!this.locaGoodsStatus.includes(this.GoodsStatusEditData.configId)) { - this.locaGoodsStatus.push(this.GoodsStatusEditData.configId) - this.details.goodsStatus.push({ ...AData }) - } - - const ApiData = { - bookingId: this.id, - item: [] - } - console.log(this.details.goodsStatus) - this.details.goodsStatus.forEach(item => { - if (item.finishTime || item.remark) { - if (item.configId == this.GoodsStatusEditData.configId) { - ApiData.item.push(AData) - } else { - ApiData.item.push(item) - } + this.goodStatusLoading = true + SaveServiceStatus(data).then(res => { + if (res.data.succ) { + this.GoodsStatusVisible = false + this.getStatusServiceList(1) + } else { + this.$message.error(res.data.msg) } + this.goodStatusLoading = false }) - BookingOrderSaveGoodsStatus(ApiData) - .then(res => { - if (res.success) { - // let data = [] - // this.booGoodsStatusItem.forEach(item => { - // let type = true - // ApiData.item.forEach(item2 => { - // if (item.configId == item2.configId) { - // type = false - // data.push(item2) - // } - // }) - // if (type) { - // data.push(item) - // } - // }) - this.$nextTick(() => { - this.booGoodsStatusItem = res.data - this.$emit('inGoodsSave', true) - this.details.goodsStatus = res.data - setTimeout(() => { - this.$emit('inGoodsSave', false) - }, 400) - }) - this.$message.success('货物状态设置成功') - this.GoodsStatusVisible = false - } - }) - .catch(err => { - console.log(err) - }) + // const AData = { ...this.GoodsStatusEditData, ...data } + // if (!this.id) { + // this.$message.error('请先保存主单') + // return false + // } + // if (!this.locaGoodsStatus.includes(this.GoodsStatusEditData.configId)) { + // this.locaGoodsStatus.push(this.GoodsStatusEditData.configId) + // this.details.goodsStatus.push({ ...AData }) + // } + + // const ApiData = { + // bookingId: this.id, + // item: [] + // } + // console.log(this.details.goodsStatus) + // this.details.goodsStatus.forEach(item => { + // if (item.setActDate || item.remark) { + // if (item.configId == this.GoodsStatusEditData.configId) { + // ApiData.item.push(AData) + // } else { + // ApiData.item.push(item) + // } + // } + // }) + // BookingOrderSaveGoodsStatus(ApiData) + // .then(res => { + // if (res.success) { + // this.$nextTick(() => { + // this.booGoodsStatusItem = res.data + // this.$emit('inGoodsSave', true) + // this.details.goodsStatus = res.data + // setTimeout(() => { + // this.$emit('inGoodsSave', false) + // }, 400) + // }) + // this.$message.success('货物状态设置成功') + // this.GoodsStatusVisible = false + // } + // }) + // .catch(err => { + // console.log(err) + // }) } else { console.log(errors, values) } @@ -1026,12 +1113,11 @@ export default { this.GoodsStatusVisible = true this.$nextTick(() => { this.StatusVisibleForm.setFieldsValue({ - finishTime: data.finishTime ? data.finishTime : '', - remark: data.remark ? data.remark : '', - extData: data.extData ? data.extData : '' + setActDate: data.actDate ? data.actDate : '', + actRemark: data.actRemark ? data.actRemark : '', + setActVal: data.actVal ? data.actVal : '' }) }) - console.log(this.GoodsStatusEditData) }, 100) }, saveGoodsStatus(data) { @@ -1039,38 +1125,76 @@ export default { this.$message.error('请先保存') return false } - if (!this.locaGoodsStatus.includes(data.configId) || !data.finishTime) { - // this.locaGoodsStatus.push(data.configId) - // this.details.goodsStatus.push({ ...data }) - this.savegoodsStatusItem(data, 'push') + const obj = { + bookingId: this.$route.query.id, + statusCodes: [ + { statusCode: data.statusSKUCode } + ] + } + // this.spinning = true + this.$store.commit('SET_SAVENEEDNUMBER', this.$route.query.id) + if (!data.isYield) { + this.booGoodsStatusItem.forEach(item => { + if (item.statusSKUCode == data.statusSKUCode) { + item.isYield = !item.isYield + } + }) + SaveServiceStatus(obj).then(res => { + if (res.data.succ) { + } else { + this.$message.error(res.data.msg) + this.getStatusServiceList(1) + } + this.spinning = false + }) } else { - const that = this - this.$confirm({ - title: '是否取消', - okText: '是', - okType: 'danger', - cancelText: '否', - onOk() { - const index = that.locaGoodsStatus.indexOf(data.configId) - - that.locaGoodsStatus.splice(index, 1) - that.details.goodsStatus.forEach((item, index2) => { - if (item.configId == data.configId) { - that.$emit('inGoodsSave', true) - that.details.goodsStatus.splice(index2, 1) - setTimeout(() => { - that.$emit('inGoodsSave', false) - }, 1200) - } - }) - - that.savegoodsStatusItem(data, 'splice') - }, - onCancel() { - return false + this.booGoodsStatusItem.forEach(item => { + if (item.statusSKUCode == data.statusSKUCode) { + item.isYield = !item.isYield + } + }) + CancelServiceStatus(obj).then(res => { + if (res.data.succ) { + } else { + this.$message.error(res.data.msg) + this.getStatusServiceList(1) } + this.spinning = false }) } + + // if (!this.locaGoodsStatus.includes(data.configId) || !data.setActDate) { + // // this.locaGoodsStatus.push(data.configId) + // // this.details.goodsStatus.push({ ...data }) + // this.savegoodsStatusItem(data, 'push') + // } else { + // const that = this + // this.$confirm({ + // title: '是否取消', + // okText: '是', + // okType: 'danger', + // cancelText: '否', + // onOk() { + // const index = that.locaGoodsStatus.indexOf(data.configId) + + // that.locaGoodsStatus.splice(index, 1) + // that.details.goodsStatus.forEach((item, index2) => { + // if (item.configId == data.configId) { + // that.$emit('inGoodsSave', true) + // that.details.goodsStatus.splice(index2, 1) + // setTimeout(() => { + // that.$emit('inGoodsSave', false) + // }, 1200) + // } + // }) + + // that.savegoodsStatusItem(data, 'splice') + // }, + // onCancel() { + // return false + // } + // }) + // } }, savegoodsStatusItem(data, type) { const ApiData = { @@ -1078,20 +1202,20 @@ export default { item: [] } this.details.goodsStatus.forEach(item => { - if (item.finishTime || item.remark) { + if (item.setActDate || item.remark) { ApiData.item.push(item) } }) if (type === 'push' && !data.remark) { const date = new Date(+new Date() + 8 * 3600 * 1000) - ApiData.item.push({ ...data, finishTime: date.toISOString() }) + ApiData.item.push({ ...data, setActDate: date.toISOString() }) } if (type === 'push' && data.remark) { const date = new Date(+new Date() + 8 * 3600 * 1000) ApiData.item.forEach(ite => { if (ite.systemCode === data.systemCode) { - ite.finishTime = date.toISOString() + ite.setActDate = date.toISOString() } }) } @@ -1123,6 +1247,7 @@ export default { .active1 { border: 1px solid #13c2c2 !important; + padding: 0 8px !important; } .rule-icon { @@ -1148,4 +1273,100 @@ export default { font-weight: 400; } } + +.box-list { + display: flex; + flex-wrap: wrap; +} + +.goods-box { + display: flex; + align-items: center; + padding: 2px; + position: relative; + cursor: pointer; + align-items: flex-start; + margin-top: 5px; + + &:hover { + .goods-content { + // border: 1px dashed rgb(19, 194, 194); + // background-color: rgb(237, 251, 251); + } + + .box-edit { + display: block; + } + } + + .goods-content { + // display: flex; + border: 1px dashed white; + font-size: 14px; + font-weight: bold; + + &.active { + color: rgb(48, 172, 214); + } + } + + .serve-icon { + font-size: 22px; + display: block; + margin: 0 auto; + margin-bottom: 5px; + } + + .round { + width: 22px; + height: 22px; + line-height: 15px; + border-radius: 50%; + // margin-right: 3px; + margin: 0 auto; + font-size: 15px; + text-align: center; + border: 2px solid rgb(146, 146, 146); + margin-bottom: 5px; + + &.active { + border: 1px solid rgb(48, 172, 214); + } + } + + .box-edit { + width: 17px; + height: 17px; + border-radius: 0 3px 0 0; + // background: #c9c9c9; + display: none; + position: absolute; + left: 0px; + top: -1px; + text-align: center; + line-height: 17px; + } +} + +.showName { + width: 48px; + font-size: 12px; + text-align: center; +} + +.box-line { + height: 1px; + width: 10px; + background: rgb(179, 175, 175); + // margin-left: 3px; + margin-top: 10px; + + &.active { + border: 1px solid rgb(48, 172, 214); + } +} + +.isBr { + width: 100%; +} diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 1d2d219..b235822 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -607,12 +607,13 @@ {{ formatSheet.total }}
+

-
+
-

提单号:(本地数据)

+

提单号

{{ formatSheet.mBlNo }}

@@ -621,45 +622,132 @@ v-for="(item, index) in formatSheet.showDetailList" :key="index" style="display: flex;margin-top: 15px;" - v-show="item.pCode != 'ContaList'"> + v-show="item.pCode != 'ContaList' && item.isDiff">

-

{{ item.fieldName }}:

+

{{ item.fieldName }}:

-

{{ item.reqVal }} - (本地) -

- - (格式单) +
+ + 本地 +
{{ item.reqVal }}
+
+
+ + 格式单 +
+
-

箱信息:(本地数据)

+

箱信息

+
箱号:{{ formatSheet.primaryKey }}
-
箱号:{{ item.reqVal }}

-

{{ item.fieldName }}:

+

{{ item.fieldName }}:

-

{{ item.reqVal }} - (本地) +

+ + 本地 +
{{ item.reqVal }}
+
+
+ + 格式单 +
+
+
+
+
+
+
+
+
+
+

提单号

+
+

{{ formatSheet.mBlNo }}

+
+
+
+

+ +

+

+ +

+

{{ item.fieldName }}:

+
+
+ + 本地 +
{{ item.reqVal }}
+
+
+ + 格式单 +
+
+
+
+
+
+
+
+
+

箱信息

+
+ +
+
+
+
箱号:{{ item.primaryKey }}
+
+

+ +

+

+

- - (格式单) +

{{ item.fieldName }}:

+
+
+ + 本地 +
{{ item.reqVal }}
+
+
+ + 格式单 +
+
+
+
+
@@ -1168,7 +1256,8 @@ export default { bcObj: {}, txxpLoading: false, txxpFlag: false, - formatPdf: '' + formatPdf: '', + formatFlag: false } }, computed: { @@ -2465,6 +2554,11 @@ export default { this.formatSheet = res.data.extra this.formatSheet.total = res.data.total this.formatSheetVisible = true + this.formatSheet.showDetailList.forEach(item => { + if (item.pCode === 'ContaList') { + this.formatSheet.primaryKey = item.primaryKey + } + }) } else { this.$message.success(res.data.msg) }