|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
:data="list"
|
|
|
|
|
:row="row"
|
|
|
|
|
:tbType="tbType"
|
|
|
|
|
:power="power"
|
|
|
|
|
:id="id"
|
|
|
|
|
:details="details"
|
|
|
|
|
:columns="{ data: sColumns, id: colId }"
|
|
|
|
@ -74,7 +75,6 @@
|
|
|
|
|
import { GetFeeCurrencyExchangeList } from '/@/views/fee/exchangeRate/api'
|
|
|
|
|
import { updateColumns } from '/@/hooks/web/common'
|
|
|
|
|
import { useAppStore } from '/@/store/modules/app'
|
|
|
|
|
import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
const appStore = useAppStore()
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
defineComponent({
|
|
|
|
@ -112,6 +112,11 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
isShowBtn: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true
|
|
|
|
|
},
|
|
|
|
|
// 表格权限默认1->正常的费用录入权限, 2->整票提交审核时任何状态可编辑的权限
|
|
|
|
|
power: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: '1'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const emits = defineEmits(['broInsert', 'refreshStatic', 'allBillSubmit', 'refresh'])
|
|
|
|
@ -173,6 +178,19 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
const someCheck = ref(false)
|
|
|
|
|
// 自定义列
|
|
|
|
|
const sColumns = ref([])
|
|
|
|
|
// 判断计费吨的值是毛重还是尺码
|
|
|
|
|
const jfCount = () => {
|
|
|
|
|
const mz = (props.details.kgs || 0) / 1000
|
|
|
|
|
const cm = props.details.cbm || 0
|
|
|
|
|
if (mz > cm) {
|
|
|
|
|
console.log(mz)
|
|
|
|
|
console.log(cm)
|
|
|
|
|
return mz
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
return cm
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 定义表格所有列
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
@ -629,8 +647,12 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
// 如果是箱,带出箱种类的数量
|
|
|
|
|
list.value[changes[0][0]]['unitText'] = dict['defaultUnitName']
|
|
|
|
|
list.value[changes[0][0]]['unit'] = dict['defaultUnit']
|
|
|
|
|
const num = props.details?.ctnInfo?.length || 0
|
|
|
|
|
const num = props.details?.ctnInfo?.length || 1
|
|
|
|
|
list.value[changes[0][0]]['quantity'] = num
|
|
|
|
|
} else if (dict.defaultUnit == 'JF') {
|
|
|
|
|
list.value[changes[0][0]]['unitText'] = dict['defaultUnitName']
|
|
|
|
|
list.value[changes[0][0]]['unit'] = dict['defaultUnit']
|
|
|
|
|
list.value[changes[0][0]]['quantity'] = jfCount()
|
|
|
|
|
} else {
|
|
|
|
|
list.value[changes[0][0]]['unitText'] = dict['defaultUnitName']
|
|
|
|
|
list.value[changes[0][0]]['unit'] = dict['defaultUnit']
|
|
|
|
@ -724,6 +746,8 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
// 箱带出当前主票有多少种箱
|
|
|
|
|
const num = props.details?.ctnInfo?.length || 0
|
|
|
|
|
list.value[changes[0][0]]['quantity'] = num
|
|
|
|
|
} else if (dict.value == 'JF') {
|
|
|
|
|
list.value[changes[0][0]]['quantity'] = jfCount()
|
|
|
|
|
} else {
|
|
|
|
|
list.value[changes[0][0]]['quantity'] = 0
|
|
|
|
|
}
|
|
|
|
@ -813,7 +837,17 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
businessType: 1
|
|
|
|
|
}
|
|
|
|
|
// 如果不存在可保存数据限制保存按钮(后台会报错,这块后台也存在问题,现在前端限制)
|
|
|
|
|
if (postData.items.length == 0) return createMessage.warning('暂无可保存的数据!')
|
|
|
|
|
if (postData.items.length == 0 && props.power == '1') return createMessage.warning('暂无可保存的数据!')
|
|
|
|
|
// 如果是整票审核,将费用状态改成2,并保存
|
|
|
|
|
if (props.power == '2') {
|
|
|
|
|
const allItems = JSON.parse(JSON.stringify(list.value))
|
|
|
|
|
allItems.forEach((res) => {
|
|
|
|
|
if (!res.taxRate) res.taxRate = 0
|
|
|
|
|
res.feeStatus = 2
|
|
|
|
|
res.feeStatusText = '提交审核'
|
|
|
|
|
})
|
|
|
|
|
postData.items = allItems
|
|
|
|
|
}
|
|
|
|
|
loading.value = true
|
|
|
|
|
SubmitFee(postData)
|
|
|
|
|
.then((res) => {
|
|
|
|
@ -1033,7 +1067,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
hotTb.value.hotInstance.updateSettings({
|
|
|
|
|
cells: function (row, col) {
|
|
|
|
|
// 设置费用状态不是录入状态或驳回状态的行为只读
|
|
|
|
|
const props = { readOnly: true }
|
|
|
|
|
const hprops = { readOnly: true }
|
|
|
|
|
// 审核通过(STATUS=0)
|
|
|
|
|
// 录入状态(STATUS=1)
|
|
|
|
|
// 提交审核(STATUS=2)
|
|
|
|
@ -1044,23 +1078,24 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
// 驳回申请(STATUS=7)
|
|
|
|
|
// 部分结算(STATUS=8)
|
|
|
|
|
// 结算完毕(STATUS=9)
|
|
|
|
|
if (!(data[row]?.feeStatus == 6 || data[row]?.feeStatus == 1) && col != 0) {
|
|
|
|
|
if (data[row]?.feeStatus == 0 && col == 3) {
|
|
|
|
|
hprops['className'] = 'hot-green'
|
|
|
|
|
}
|
|
|
|
|
if (data[row]?.feeStatus == 2 && col == 3) {
|
|
|
|
|
hprops['className'] = 'hot-yellow'
|
|
|
|
|
}
|
|
|
|
|
if (data[row]?.feeStatus == 6 && col == 3) {
|
|
|
|
|
hprops['className'] = 'hot-red'
|
|
|
|
|
}
|
|
|
|
|
if ((data[row]?.feeStatus == 4 || data[row]?.feeStatus == 3) && col == 3) {
|
|
|
|
|
hprops['className'] = 'hot-red'
|
|
|
|
|
}
|
|
|
|
|
if (!(data[row]?.feeStatus == 6 || data[row]?.feeStatus == 1) && col != 0 && props.power == '1') {
|
|
|
|
|
// 配置不同状态的行颜色
|
|
|
|
|
if (data[row]?.feeStatus == 0 && col == 3) {
|
|
|
|
|
props['className'] = 'hot-green'
|
|
|
|
|
}
|
|
|
|
|
if (data[row]?.feeStatus == 2 && col == 3) {
|
|
|
|
|
props['className'] = 'hot-yellow'
|
|
|
|
|
}
|
|
|
|
|
if (data[row]?.feeStatus == 7 && col == 3) {
|
|
|
|
|
props['className'] = 'hot-red'
|
|
|
|
|
}
|
|
|
|
|
if ((data[row]?.feeStatus == 4 || data[row]?.feeStatus == 3) && col == 3) {
|
|
|
|
|
props['className'] = 'hot-red'
|
|
|
|
|
}
|
|
|
|
|
return props
|
|
|
|
|
return hprops
|
|
|
|
|
} else {
|
|
|
|
|
return
|
|
|
|
|
delete hprops.readOnly
|
|
|
|
|
return hprops
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|