Commit 6721290f by linjinhong

修改物流方式编辑问题

parent 213060b8
......@@ -136,9 +136,11 @@ export function updateLogisticsQuotation(params: any) {
}
//删除
export function deleteLogisticsQuotation(params: any) {
return axios.post<never, BaseRespData<never>>(
return axios.get<never, BaseRespData<never>>(
'/logistics/logisticsQuotation/delete',
params,
{
params,
},
)
}
//导入
......
......@@ -84,6 +84,7 @@ export default defineComponent({
watch(
() => props.config,
(val) => {
console.log('tableConfig', val)
tableConfig.value = val
},
{ immediate: true, deep: true },
......@@ -143,9 +144,9 @@ export default defineComponent({
.filter((item) => !item.fixed)
.concat(tableConfig.value.filter((item) => item.fixed))
} else {
tableConfig.value = props.config
tableConfig.value = [...props.config]
console.log(tableConfig.value)
}
console.log('tableConfig', tableConfig.value)
}
return {
......@@ -211,6 +212,10 @@ export default defineComponent({
'onUpdate:modelValue': (value: unknown) => {
this.formData[item.prop] = value
},
disabled:
typeof item.attrs?.disabled === 'function'
? item.attrs.disabled()
: item.attrs?.disabled,
...this.getComponentAttrs(item),
})}
{item.btn && item.btn()}
......
......@@ -498,11 +498,12 @@ async function deleteWay(item) {
async function editWay(item: LogisticsMethod) {
try {
editForm.value = { ...item }
editForm.value.ruleId = item.ruleList[0].ruleId
editForm.value.platformList = item.platformList.map((el) => {
el.showPlatform = el.platform.split(',')
return el
})
editForm.value.ruleId = item.ruleList?.[0]?.ruleId || ''
editForm.value.platformList =
item.platformList?.map((el) => {
el.showPlatform = el.platform.split(',')
return el
}) || []
console.log(493, editForm.value)
dialogVisible.value = true
......
......@@ -37,21 +37,13 @@
v-model="tableData"
:config="tableConfig"
:merge-cells="mergeCells"
:tableEditConfig="{
enabled: true,
}"
border="full"
@getCheckboxRecords="handleCheckboxRecords"
></CustomizeTable>
</div>
<!-- <ElPagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[100, 200, 300, 400, 500]"
background
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin: 10px auto 0; text-align: right"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></ElPagination> -->
</div>
</div>
......@@ -99,6 +91,7 @@ import usePageList from '@/utils/hooks/usePageList'
import { useValue } from './hooks/useValue'
import { showConfirm } from '@/utils/ui'
import { Edit } from '@element-plus/icons-vue'
import { ElInput } from 'element-plus'
const [searchForm] = useValue({})
const [editForm, resetEditForm] = useValue({ logisticsList: [] })
......@@ -383,7 +376,15 @@ async function getList(data?) {
newConfig.push({
prop: key,
label: key,
render: {
edit: ({ row }) => {
return (
<div>
{/* <ElInput v-model={row[key]?.codePrefix} /> */}
</div>
)
},
default: ({ row }) => {
return (
<span
......
......@@ -162,7 +162,7 @@ const searchConfig = ref([
},
])
const formConfig = ref([
const formConfig = computed(() => [
{
prop: 'logistics',
type: 'select',
......@@ -186,7 +186,7 @@ const formConfig = ref([
label: 'Rate(oz/LB)',
attrs: {
placeholder: '请输入Rate(oz/LB)',
disabled: editForm.value?.['id'] ? true : false,
hasSuffix: false,
hasAppend: true,
appendRender: () => {
......@@ -210,73 +210,82 @@ const formConfig = ref([
},
{
prop: 'zone1',
type: 'input',
type: 'amountInput',
label: 'ZONE 1',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 1',
},
},
{
prop: 'zone2',
type: 'input',
type: 'amountInput',
label: 'ZONE 2',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 2',
},
},
{
prop: 'zone3',
type: 'input',
type: 'amountInput',
label: 'ZONE 3',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 3',
},
},
{
prop: 'zone4',
type: 'input',
type: 'amountInput',
label: 'ZONE 4',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 4',
},
},
{
prop: 'zone5',
type: 'input',
type: 'amountInput',
label: 'ZONE 5',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 5',
},
},
{
prop: 'zone6',
type: 'input',
type: 'amountInput',
label: 'ZONE 6',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 6',
},
},
{
prop: 'zone7',
type: 'input',
type: 'amountInput',
label: 'ZONE 7',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 7',
},
},
{
prop: 'zone8',
type: 'input',
type: 'amountInput',
label: 'ZONE 8',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 8',
},
},
{
prop: 'zone9',
type: 'input',
type: 'amountInput',
label: 'ZONE 9',
attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 9',
},
},
......@@ -439,8 +448,7 @@ async function editWay(item: LogisticsMethod) {
try {
editForm.value = { ...item }
console.log(432, editForm.value)
// formConfig.value[0].attrs!.disabled = true
// formConfig.value[1].attrs!.disabled = true
editFormRef.value?.refashConfig()
dialogVisible.value = true
} catch (e) {
console.log(e)
......@@ -516,7 +524,7 @@ async function deleteFn() {
return
}
try {
const ids = selection.value.map((item) => item.id).join(',')
const ids = { ids: selection.value.map((item) => item.id).join(',') }
await deleteLogisticsQuotation(ids)
ElMessage({
message: '删除成功',
......@@ -525,6 +533,10 @@ async function deleteFn() {
search()
} catch (e) {
search()
ElMessage({
message: '删除失败',
type: 'error',
})
// showError(e)
}
}
......@@ -607,9 +619,11 @@ async function updateExcel(file) {
}
watch(
() => loading.value,
() => editForm.value,
(val) => {
console.log(442, val)
console.log('editForm', val)
const bool = editForm.value?.['id'] ? true : false
console.log('bool', bool)
},
{ deep: true, immediate: true },
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment