切换组织机构

feature-JimuReport-1106-yjl
lijingjia 1 month ago
parent c58e9514f2
commit 07611c9917

@ -125,6 +125,7 @@
刷新
</a-button>
<!-- <HColSet
:code="tbType == 'receive' ? 'ds_receive_fee' : 'ds_pay_fee'"
:columns="columns"
/> -->
</div>

@ -67,6 +67,7 @@
import { getDictOption } from '/@/utils/dictUtil'
//
import { GetFeeCurrencyExchangeList } from '/@/views/fee/exchangeRate/api'
import { updateColumns } from '/@/hooks/web/common'
const { createMessage } = useMessage()
defineComponent({
HotTable,
@ -119,7 +120,7 @@
return item.ctn
})
b = a.map(item => {
return { label: item.ctn, value: item.ctnCode, name: item.ctn }
return { label: item.ctn, value: item.ctnCode, name: item.ctn, isCtn: true }
})
}
unitDict.value = [...b, ...res]
@ -160,7 +161,7 @@
//
const someCheck = ref(false)
//
const columns = [
const columns = ref([
{
data: 'selected',
type: 'checkbox',
@ -476,7 +477,7 @@
data: 'auditDate',
readOnly: true,
},
]
])
//
const settings = {
height: props.height,
@ -510,7 +511,7 @@
// }
}
},
columns: columns,
columns: columns.value,
// ()
licenseKey: 'non-commercial-and-evaluation',
//
@ -596,10 +597,12 @@
return list.value[changes[0][0]]['unitText'].includes(item.name)
})
if (uItem) dict = uItem[0]
if (dict && dict?.value) {
GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
if (dict && dict?.value && dict.isCtn) {
GetUnitSelectInfo({ code: dict?.name, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['quantity'] = res.data.quantity
})
} else {
list.value[changes[0][0]]['quantity'] = 0
}
}
//
@ -658,9 +661,13 @@
if (item) dict = item[0]
list.value[changes[0][0]]['unit'] = dict?.value
list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[0]
GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['quantity'] = res.data.quantity
})
if (dict && dict?.value && dict.isCtn) {
GetUnitSelectInfo({ code: dict?.name, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['quantity'] = res.data.quantity
})
} else {
list.value[changes[0][0]]['quantity'] = 0
}
//
// const text = list.value[changes[0][0]]['unitText']
// if (text == '') {
@ -1069,6 +1076,16 @@
}
}
})
columns.value = []
hot.updateSettings({
columns: []
})
const ucols = updateColumns(props.tbType == 'receive' ? 'ds_receive_fee' : 'ds_pay_fee', columns.value)
console.log(ucols)
if (ucols && ucols.length) {
columns.value = ucols
console.log(ucols)
}
//
if (props.isShowBtn) init()
})

@ -0,0 +1,20 @@
// @ts-ignore
import { request } from '/@/utils/request'
enum Api {
edit = '/mainApi/CustomColumnSet/EditCustomColumnSet',
info = '/mainApi/CustomColumnSet/GetCustomColumnSetInfoByCode'
}
export function EditCustomColumnSet(data) {
return request({
url: Api.edit,
method: 'post',
data
})
}
export function GetCustomColumnSetInfo(params) {
return request({
url: Api.info,
method: 'get',
params
})
}

@ -39,21 +39,37 @@
//
import TableColDrag from './components/tableColDrag.vue'
import TableColSet from './components/tableColSet.vue'
import { EditCustomColumnSet } from './api'
const { t } = useI18n()
const props = defineProps({
//
columns: {
type: Array,
default: () => {
return []
}
},
//
code: {
type: String,
default: null
}
})
const visible = ref(false)
const init = () => {
visible.value = true
}
const colData = ref([])
// onMounted(() => {
// colData.value = props.columns
// })
const handleOk = () => {
const content = JSON.stringify(props.columns)
EditCustomColumnSet({
customTableCode: props.code,
templateName: props.code,
content
})
}
</script>

@ -245,3 +245,93 @@ export function formatParams(params = {}, equal: any = [], otherQuery: any = [])
postData.queryCondition = JSON.stringify(conditions)
return postData
}
// 获取列表设置详情接口
import { GetCustomColumnSetInfo } from '/@/components/HColSet/api'
import type { FormSchema } from '/@/types/form'
import { deepMerge } from '/@/utils'
// 重组列配置
export function updateColumns(code, data) {
// 获取数据列
GetCustomColumnSetInfo({
code
}).then(res => {
const oldSchema = data
let updateData = []
if (res.data) {
updateData = JSON.parse(res.data.content)
}
// 重组的表单
const schema: FormSchema[] = []
if (updateData.length == oldSchema.length) {
// 如果原始表单和赋值表单长度相同,则用赋值表单排序
updateData.forEach((item) => {
let _val
oldSchema.forEach((val) => {
if (item.data === val.data) {
_val = val
}
})
if (_val !== undefined && item.data === _val.data) {
const newSchema = deepMerge(_val, item)
schema.push(newSchema as FormSchema)
} else {
schema.push(_val)
}
})
} else {
// 如果原始表单和赋值表单长度不同,则不考虑排序,用原始表单进行赋值
oldSchema.forEach((val) => {
let _val
updateData.forEach((item) => {
if (val.data === item.data) {
_val = item
}
})
if (_val !== undefined && val.field === _val.field) {
const newSchema = deepMerge(val, _val)
schema.push(newSchema as FormSchema)
} else {
schema.push(val)
}
})
}
return schema
})
// // 重组的表单
// const schema: FormSchema[] = []
// // 原始的表单
// const oldSchema = unref(getSchema)
// if (updateData.length == oldSchema.length) {
// // 如果原始表单和赋值表单长度相同,则用赋值表单排序
// updateData.forEach((item) => {
// let _val
// oldSchema.forEach((val) => {
// if (item.field === val.field) {
// _val = val
// }
// })
// if (_val !== undefined && item.field === _val.field) {
// const newSchema = deepMerge(_val, item)
// schema.push(newSchema as FormSchema)
// } else {
// schema.push(_val)
// }
// })
// } else {
// // 如果原始表单和赋值表单长度不同,则不考虑排序,用原始表单进行赋值
// oldSchema.forEach((val) => {
// let _val
// updateData.forEach((item) => {
// if (val.field === item.field) {
// _val = item
// }
// })
// if (_val !== undefined && val.field === _val.field) {
// const newSchema = deepMerge(val, _val)
// schema.push(newSchema as FormSchema)
// } else {
// schema.push(val)
// }
// })
// }
}

@ -520,16 +520,20 @@
if (goodsForm.ctnPriceInfo && goodsForm.ctnPriceInfo.length && ctnPriceData.value.length && ctnPriceData.value[0].show !== false) {
for (let i = 0; i < goodsForm.ctnPriceInfo.length; i++) {
if (!goodsForm.ctnPriceInfo[i].ctn) {
return createMessage.warning('请填写箱型价格!')
createMessage.warning('请填写箱型价格!')
return false
}
if (!goodsForm.ctnPriceInfo[i].ctnNum) {
return createMessage.warning('请填写箱量!')
createMessage.warning('请填写箱量!')
return false
}
if (!goodsForm.ctnPriceInfo[i].quotePrice && goodsForm.ctnPriceInfo[i].quotePrice !== 0) {
return createMessage.warning('请填写报价!')
createMessage.warning('请填写卖单价!')
return false
}
if (route.query.status == 'WAIT_ORDER_AUDIT' && !goodsForm.ctnPriceInfo[i].floorPrice && goodsForm.ctnPriceInfo[i].floorPrice !== 0) {
return createMessage.warning('请填写底价!')
createMessage.warning('请填写底价!')
return false
}
}
}
@ -1099,27 +1103,29 @@
// }
//
const approveDc = async (remark) => {
await save('dc')
if (!remark) {
IsLastMarker({
bsType: 1,
bsId: id.value,
taskType: route.query.status
}).then(res => {
if (res.data) {
//
if (bookingDetails.value.shippingSpaceType == 'xc') {
//
sspace.value.init()
const flag = await save('dc')
if (flag || flag === undefined) {
if (!remark) {
IsLastMarker({
bsType: 1,
bsId: id.value,
taskType: route.query.status
}).then(res => {
if (res.data) {
//
if (bookingDetails.value.shippingSpaceType == 'xc') {
//
sspace.value.init()
} else {
//
seaExportTaskAudit(remark, true)
}
} else {
//
seaExportTaskAudit(remark, true)
//
seaExportTaskAudit(remark, false)
}
} else {
//
seaExportTaskAudit(remark, false)
}
})
})
}
}
}
//

@ -1049,6 +1049,7 @@
if (res.succeeded) {
createMessage.success(res.message)
fileFlag.value = false
emit('refresh')
}
})
.catch((err) => {

Loading…
Cancel
Save