修改问题

master
sunzehua 1 year ago
parent a43359fd8f
commit da0ae3a235

@ -85,3 +85,19 @@ export function GetTemplateShareList (parameter) {
params: parameter
})
}
export function ShareToAll (parameter) {
return axios({
url: '/BookingTemplate/ShareToAll',
method: 'post',
params: parameter
})
}
export function CancelShare (parameter) {
return axios({
url: '/BookingTemplate/CancelShare',
method: 'post',
params: parameter
})
}

@ -48,7 +48,7 @@ export default {
onEdit(targetKey, action) {
const _that = this
if (targetKey.includes('BookingDetail')) {
console.log(Object.keys(this.needSavePages).includes(targetKey), this.needSavePages[targetKey].details,this.needSavePages[targetKey].hbList)
console.log(Object.keys(this.needSavePages).includes(targetKey), this.needSavePages[targetKey].details, this.needSavePages[targetKey].hbList)
if (
Object.keys(this.needSavePages).includes(targetKey) &&
(this.needSavePages[targetKey].details || this.needSavePages[targetKey].hbList)
@ -75,6 +75,9 @@ export default {
console.log(this.needSavePages)
}
} else {
if (targetKey === '/bookingLedger') {
this.$store.commit('SET_FIRSTFLAG', true)
}
this[action](targetKey)
}
},

@ -27,6 +27,7 @@ const getters = {
blfrtList: state => state.booking.blfrtList,
ctnallList: state => state.booking.ctnallList,
copyPages: state => state.booking.copyPages,
saveNeedNumber: state => state.booking.saveNeedNumber,
lineList: state => state.booking.lineList,
bookingInitData: state => state.booking.bookingInitData,
sourceList: state => state.booking.sourceList,

@ -19,6 +19,7 @@ const booking = {
dpTreeList: [],
copyPages: { number: 0, path: '' },
yardList: [],
saveNeedNumber: '',
saveFlag: false,
packageList: [],
issuetypeList: [],
@ -103,6 +104,9 @@ const booking = {
},
SET_SAVEFLAG: (state, type) => {
state.saveFlag = type
},
SET_SAVENEEDNUMBER: (state, id) => {
state.saveNeedNumber = id
}
},

@ -1318,6 +1318,7 @@ export default {
}, 5000);
this.$message.destroy()
that.$message.success('保存成功')
if (that.isAdd || this.isCopy) {
this.isCopy = false
this.isAdd = false
@ -1387,6 +1388,7 @@ export default {
})
}
that.setInBookingDetailsSave(false)
that.$store.commit('SET_SAVENEEDNUMBER', res.data.mblno)
that.$forceUpdate()
} else {
that.setInBookingDetailsSave(false)

@ -261,7 +261,7 @@
</a-form-model-item>
</a-col>
</template>
<template v-if="['VOLTA', 'WHL', 'CSL', 'MSC'].includes(details.carrierid)">
<template v-if="['VOLTA', 'WHL', 'CSL', 'MSC','VOL'].includes(details.carrierid)">
<a-col :xs="12" :sm="12" :md="12" :lg="{span: '4-8'}" :xl="{span: '4-8'}">
<a-form-model-item
class="from-label"

@ -786,15 +786,6 @@ export default {
}
}
if (column.field === 'kgs' || column.field === 'tareweight') {
// let nowIndex = 0
// this.tableData.map((item, index) => {
// if (item.rowKey === row.rowKey) {
// nowIndex = index
// }
// })
// this.tableData[nowIndex]['weighkgs'] = Number(this.tableData[nowIndex].kgs) + Number(this.tableData[nowIndex].tareweight)
// row['weighkgs'] = Number(row['kgs']) + Number(row['tareweight'])
// debugger
row['weighkgs'] = this.calc(Number(row['kgs']), Number(row['tareweight']), '+')
const kgsVal = row['weighkgs'] + ''
const kgsIndex = kgsVal.includes('.') ? kgsVal.indexOf('.') + 1 : false
@ -908,10 +899,170 @@ export default {
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforePaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
const changeValue = data[0][selectionRangeKeys.endColKey]
if (this.inTableLoad) {
return false
}
if (
['pkgs', 'kgs', 'cbm', 'tareweight'].includes(selectionRangeKeys.endColKey) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
) {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
})
this.$message.error(`输入的${this.enmuErrorLabel(selectionRangeKeys.endColKey)}不符合规则`)
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
return false
}
if (selectionRangeKeys.endColKey === 'cntrno') {
const res = this.checkCntrno(changeValue)
if (res !== '') {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
})
this.$message.error(res)
// row['cntrno'] = ''
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
}
}
},
afterPaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
let changeValue = data[0][selectionRangeKeys.endColKey]
const index = selectionRangeIndexes.startRowIndex
if (this.inTableLoad) {
return false
}
if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(selectionRangeKeys.endColKey)) {
changeValue = changeValue + ''
const valIndex = changeValue.includes('.') ? changeValue.indexOf('.') + 1 : false
const valCount = changeValue.length - valIndex
if (valIndex && valCount > 5) {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
})
this.$message.error('仅支持小数点后五位')
this.tableData[index][selectionRangeKeys.endColKey] = changeValue.substr(0, valIndex + 5)
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
} else {
const arrayNum = changeValue.split('.')
if (!/\./.test(changeValue)) {
this.tableData[index][selectionRangeKeys.endColKey] = changeValue + '.00'
} else if (arrayNum[1].length < 2) {
this.tableData[index][selectionRangeKeys.endColKey] = changeValue + '0'
}
}
}
if (selectionRangeKeys.endColKey === 'pkgs') {
if (!/(^[1-9]\d*$)/.test(changeValue)) {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
})
this.$message.error('件数请输入整数')
const cNum = changeValue.indexOf('.')
this.tableData[index][selectionRangeKeys.endColKey] = changeValue.substr(0, cNum)
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
} else {
}
let num = 0
this.tableData.map((item, index) => {
if (item.pkgs) {
num += Number(item.pkgs)
}
})
this.totalPkgs = num
}
if (selectionRangeKeys.endColKey === 'kgs') {
let num = 0
this.tableData.map((item, index) => {
num = (num * 10000 + Number(item.kgs) * 10000) / 10000
// num += Number(item.kgs)
})
num += ''
const pNum = num.split('.')
if (!/\./.test(num)) {
this.totalKgs = num + '.00'
} else if (pNum[1].length < 2) {
this.totalKgs = num + '0'
} else {
this.totalKgs = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
// this.totalKgs = num
}
}
if (selectionRangeKeys.endColKey === 'cbm') {
let num = 0
this.tableData.map((item, index) => {
// num += Number(item.cbm)
num = (num * 10000 + Number(item.cbm) * 10000) / 10000
})
num += ''
const pNum = num.split('.')
if (!/\./.test(num)) {
this.totalCbm = num + '.00'
} else if (pNum[1].length < 2) {
this.totalCbm = num + '0'
} else {
// this.totalCbm = num
this.totalCbm = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
}
}
if (selectionRangeKeys.endColKey === 'kgs' || selectionRangeKeys.endColKey === 'tareweight') {
this.tableData[index]['weighkgs'] = this.calc(Number(this.tableData[index]['kgs']), Number(this.tableData[index]['tareweight']), '+')
const kgsVal = this.tableData[index]['weighkgs'] + ''
const kgsIndex = kgsVal.includes('.') ? kgsVal.indexOf('.') + 1 : false
const kgsCount = kgsVal.includes('.') ? kgsVal.length - kgsIndex : false
if (kgsCount > 4) {
this.tableData[index]['weighkgs'] = kgsVal.substr(0, kgsIndex + 5)
} else if (!kgsIndex) {
this.tableData[index]['weighkgs'] = kgsVal + '.00'
} else {
const arrayNum = kgsVal.split('.')
if (!/\./.test(kgsVal)) {
this.tableData[index]['weighkgs'] = kgsVal + '.00'
} else if (arrayNum[1].length < 2) {
this.tableData[index]['weighkgs'] = kgsVal + '0'
}
}
}
},
beforeCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
@ -1142,7 +1293,6 @@ export default {
this.$refs['tableRef'].setCellSelection({ rowKey, colKey })
},
init() {
this.inTableLoad = true
if (Object.keys(this.details).length > 0) {
const arr = []
const totalCtnall = {}
@ -1200,9 +1350,6 @@ export default {
this.totalKgs = 0
this.totalCbm = 0
}
setTimeout(() => {
this.inTableLoad = false
}, 1200)
},
filterOption1(input, option) {
return (

@ -55,7 +55,7 @@
<button @click="checkFun"><span class="iconfont icon-jinggao"></span>校验</button>
</div>
<div class="btn-list single-view-1" :class="{ inLoad: inChildLoading }">
<div class="btn-list single-view-1" :class="{ inLoad: inChildLoading || !changeFlag }">
<button @click="changePage('prev')"><span class="iconfont icon-shang"></span>上一票</button>
<button @click="changePage('next')">
<span class="iconfont icon-xia" :style="{ fontSize: '17px' }"></span>下一票
@ -753,6 +753,7 @@ export default {
return {
id: this.$route.query.id,
modelType: '',
changeFlag: true,
bookingModelvisible: false,
bookingModelconfirm: false,
bookingModelFrom: {
@ -1546,15 +1547,21 @@ export default {
},
changePage(type) {
if (this.inChildLoading) {
this.$message.error('加载中,请稍后')
return false
}
// if (this.inChildLoading) {
// this.$message.error('')
// return false
// }
if (!this.$route.query.id) {
this.$message.error('请先保存订单')
return false
}
this.$emit('changePage', type)
if (this.changeFlag) {
this.$emit('changePage', type)
this.changeFlag = false
setTimeout(() => {
this.changeFlag = true
}, 4000);
}
},
copyBooking() {
this.$emit('copy')

@ -112,8 +112,11 @@
button:hover {
color: @primary-color;
}
&.inLoad {
opacity: .5;
&.inLoad button{
cursor: not-allowed !important;
}
&.inLoad button:hover{
color: black !important;
}
}
.single-view-4 {

@ -911,34 +911,10 @@ export default {
}
},
computed: {
...mapGetters(['bookingList', 'bookingGridOptions', 'firstFlag'])
...mapGetters(['bookingList', 'bookingGridOptions', 'firstFlag', 'saveNeedNumber'])
},
beforeRouteLeave(to, from, next) {
// const copyArr = JSON.parse(JSON.stringify(this.gridOptions.data))
// const first = copyArr.splice(0, 20)
this.setBookingGridOptions(this.gridOptions)
this.$store.commit('SET_FIRSTFLAG', true)
// this.gridOptions = {
// border: false,
// resizable: true,
// showOverflow: true,
// loading: false,
// stripe: true,
// round: true,
// autoResize: true,
// align: 'left',
// columnConfig: { resizable: true },
// importConfig: {},
// exportConfig: {},
// pagerConfig: {
// total: 0,
// currentPage: 1,
// pageSize: 10,
// pageSizes: [10, 20, 50, 100, 200, 500]
// },
// columns: this.gridOptions.columns,
// data: first
// }
next()
},
beforeRouteEnter(to, from, next) {
@ -950,9 +926,65 @@ export default {
'$route': {
deep: true,
handler(nD, oD) {
console.log(nD)
if (nD.name === 'booking_ledger') {
this.getList(this.searchData)
// PageDataByBooking({ mblno: this.saveNeedNumber }).then(res => {
// let index = 0
// const item = res.data.items[0]
// this.gridOptions.data.forEach((ite, inde) => {
// if (ite.mblno === this.saveNeedNumber) {
// index = inde
// }
// })
// const bookstatus = [
// { staCode: 'sta_cangdan', isChecked: false },
// { staCode: 'sta_haifang', isChecked: false },
// { staCode: 'sta_zhuangzai', isChecked: false },
// { staCode: 'sta_mafang', isChecked: false },
// { staCode: 'sta_zhuangchuan', isChecked: false },
// { staCode: 'sta_atd', isChecked: false }
// ]
// if (item.bookstatus.length > 0) {
// bookstatus.map((book, bindex) => {
// item.bookstatus.map((ite, index) => {
// if (ite.staCode === book.staCode) {
// bookstatus[bindex] = ite
// bookstatus[bindex].isChecked = true
// }
// })
// })
// }
// if (item.bsstatusname) {
// const arr = JSON.parse(localStorage.getItem('pro__DICT_TYPE_TREE_DATA'))
// if (arr) {
// let arrColor = ''
// arr.value.forEach(ite => {
// if (ite.code == 'booking_goods_status') {
// arrColor = ite
// }
// })
// if (arrColor) {
// arrColor.children.forEach(ite => {
// if (ite.name == item.bsstatusname) {
// item.bsstatusnameColor = ite.remark
// }
// })
// }
// }
// }
// item.bookstatus = bookstatus
// item.refshYzitemLoad = false
// let hasGoods = 0
// item.goodsStatusList.map((gitem, gindex) => {
// if (gitem.finishTime || gitem.remark) {
// hasGoods++
// }
// })
// item.hasGoods = hasGoods
// this.$set(this.gridOptions.data, index, item)
// this.$refs.xGrid.reloadData(this.gridOptions.data)
// console.log(this.gridOptions.data)
// })
}
}
}

@ -56,6 +56,7 @@
:align="item.align">
<template #default="{ row }">
<span v-if="item.title == '类型'">{{ FnRType(row[item.dataIndex]) }}</span>
<span v-if="item.title == '是否分享'">{{ row[item.dataIndex]?'':'' }}</span>
<span v-else>{{ row[item.dataIndex] }}</span>
</template>
</vxe-column>
@ -93,36 +94,16 @@
</vxe-pager>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
<a-modal title="分享模版" :width="900" :visible="visible" @ok="handleSubmit" @cancel="visible = false">
<a-form :confirmLoading="confirmLoading" :label-col="{ span: 5 }" @submit="handleSubmit" :wrapper-col="{ span: 12 }" :form="form">
<a-form-item label="分享人">
<a-select
v-decorator="['userIds']"
mode="multiple"
:notFoundContent="'暂无数据'"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
show-search
@change="handleChange"
@search="debounce(handleSearch, 300, $event)">
<a-select-option :title="item.name" v-for="item in selectList" :key="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="备注">
<a-textarea v-decorator="['remark']" placeholder="请输入备注" :rows="4" />
</a-form-item>
</a-form>
<a-modal title="分享模版" :width="500" :visible="visible" @ok="visible = false" @cancel="visible = false">
<a-button type="primary" @click="handleShareAll"></a-button>
<a-button type="danger" @click="handleCancel"></a-button>
</a-modal>
</a-card>
</div>
</template>
<script>
import { STable } from '@/components'
import { BookingTemplatePage, BookingTemplateDelete, SaveTemplateShare, GetTemplateShareList } from '@/api/modular/main/BookingTemplateManage'
import { BookingTemplatePage, BookingTemplateDelete, ShareToAll, CancelShare } from '@/api/modular/main/BookingTemplateManage'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
@ -155,6 +136,11 @@ export default {
align: 'center',
dataIndex: 'type'
},
{
title: '是否分享',
align: 'center',
dataIndex: 'isShared'
},
{
title: '创建人',
align: 'center',
@ -193,37 +179,29 @@ export default {
...mapGetters(['bookingInitData'])
},
methods: {
handleSubmit(e) {
e.preventDefault();
this.form.validateFields((err, values) => {
if (!err) {
const arr = []
this.selectUserId.forEach((item, index) => {
const data = {
'id': 0,
'templateId': this.row.id,
'shareToId': item,
'shareToName': this.selectUserName[index].componentOptions.propsData.title,
'remark': values.remark
}
arr.push(data)
})
this.confirmLoading = true
SaveTemplateShare(arr).then(res => {
if (res.success) {
this.confirmLoading = false
this.$message.success('操作成功')
this.visible = false
this.selectUserId = []
this.selectUserName = []
this.form.resetFields()
} else {
this.$message.error(res.message)
this.confirmLoading = false
}
})
handleCancel() {
const data = {
tempId: this.row.id
}
CancelShare(data).then(res => {
if (res.success) {
this.$message.success('取消成功')
this.visible = false
this.FnGetData()
}
})
},
handleShareAll() {
const data = {
tempId: this.row.id
}
ShareToAll(data).then(res => {
if (res.success) {
this.$message.success('分享成功')
this.visible = false
this.FnGetData()
}
});
})
},
handleChange(value, option) {
this.selectUserId = value
@ -238,24 +216,6 @@ export default {
handleOpen(row) {
this.visible = true
this.row = row
this.form = this.$form.createForm(this)
this.selectList = this.bookingInitData.opInitList
const data = {
id: row.id
}
GetTemplateShareList(data).then(res => {
if (res.success) {
const arrId = []
const arrName = []
res.data.forEach(item => {
arrId.push(item.shareToId)
arrName.push(item.shareToName)
})
this.selectUserId = arrId
this.selectUserName = arrName
this.form.setFieldsValue({ 'userIds': arrId, 'remark': res.data[0] ? res.data[0].remark : '' })
}
})
},
handleSearch(e) {
this.inEdit = true

Loading…
Cancel
Save