Commit e0ac790f by linjinhong Committed by qinjianhui

修改物流方式编辑问题

parent 797aadc2
...@@ -136,9 +136,11 @@ export function updateLogisticsQuotation(params: any) { ...@@ -136,9 +136,11 @@ export function updateLogisticsQuotation(params: any) {
} }
//删除 //删除
export function deleteLogisticsQuotation(params: any) { export function deleteLogisticsQuotation(params: any) {
return axios.post<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
'/logistics/logisticsQuotation/delete', '/logistics/logisticsQuotation/delete',
params, {
params,
},
) )
} }
//导入 //导入
......
...@@ -84,6 +84,7 @@ export default defineComponent({ ...@@ -84,6 +84,7 @@ export default defineComponent({
watch( watch(
() => props.config, () => props.config,
(val) => { (val) => {
console.log('tableConfig', val)
tableConfig.value = val tableConfig.value = val
}, },
{ immediate: true, deep: true }, { immediate: true, deep: true },
...@@ -143,9 +144,9 @@ export default defineComponent({ ...@@ -143,9 +144,9 @@ export default defineComponent({
.filter((item) => !item.fixed) .filter((item) => !item.fixed)
.concat(tableConfig.value.filter((item) => item.fixed)) .concat(tableConfig.value.filter((item) => item.fixed))
} else { } else {
tableConfig.value = props.config tableConfig.value = [...props.config]
console.log(tableConfig.value)
} }
console.log('tableConfig', tableConfig.value)
} }
return { return {
...@@ -211,6 +212,10 @@ export default defineComponent({ ...@@ -211,6 +212,10 @@ export default defineComponent({
'onUpdate:modelValue': (value: unknown) => { 'onUpdate:modelValue': (value: unknown) => {
this.formData[item.prop] = value this.formData[item.prop] = value
}, },
disabled:
typeof item.attrs?.disabled === 'function'
? item.attrs.disabled()
: item.attrs?.disabled,
...this.getComponentAttrs(item), ...this.getComponentAttrs(item),
})} })}
{item.btn && item.btn()} {item.btn && item.btn()}
......
...@@ -498,11 +498,12 @@ async function deleteWay(item) { ...@@ -498,11 +498,12 @@ async function deleteWay(item) {
async function editWay(item: LogisticsMethod) { async function editWay(item: LogisticsMethod) {
try { try {
editForm.value = { ...item } editForm.value = { ...item }
editForm.value.ruleId = item.ruleList[0].ruleId editForm.value.ruleId = item.ruleList?.[0]?.ruleId || ''
editForm.value.platformList = item.platformList.map((el) => { editForm.value.platformList =
el.showPlatform = el.platform.split(',') item.platformList?.map((el) => {
return el el.showPlatform = el.platform.split(',')
}) return el
}) || []
console.log(493, editForm.value) console.log(493, editForm.value)
dialogVisible.value = true dialogVisible.value = true
......
...@@ -37,21 +37,13 @@ ...@@ -37,21 +37,13 @@
v-model="tableData" v-model="tableData"
:config="tableConfig" :config="tableConfig"
:merge-cells="mergeCells" :merge-cells="mergeCells"
:tableEditConfig="{
enabled: true,
}"
border="full" border="full"
@getCheckboxRecords="handleCheckboxRecords" @getCheckboxRecords="handleCheckboxRecords"
></CustomizeTable> ></CustomizeTable>
</div> </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>
</div> </div>
...@@ -99,6 +91,7 @@ import usePageList from '@/utils/hooks/usePageList' ...@@ -99,6 +91,7 @@ import usePageList from '@/utils/hooks/usePageList'
import { useValue } from './hooks/useValue' import { useValue } from './hooks/useValue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { Edit } from '@element-plus/icons-vue' import { Edit } from '@element-plus/icons-vue'
import { ElInput } from 'element-plus'
const [searchForm] = useValue({}) const [searchForm] = useValue({})
const [editForm, resetEditForm] = useValue({ logisticsList: [] }) const [editForm, resetEditForm] = useValue({ logisticsList: [] })
...@@ -383,7 +376,15 @@ async function getList(data?) { ...@@ -383,7 +376,15 @@ async function getList(data?) {
newConfig.push({ newConfig.push({
prop: key, prop: key,
label: key, label: key,
render: { render: {
edit: ({ row }) => {
return (
<div>
{/* <ElInput v-model={row[key]?.codePrefix} /> */}
</div>
)
},
default: ({ row }) => { default: ({ row }) => {
return ( return (
<span <span
......
...@@ -162,7 +162,7 @@ const searchConfig = ref([ ...@@ -162,7 +162,7 @@ const searchConfig = ref([
}, },
]) ])
const formConfig = ref([ const formConfig = computed(() => [
{ {
prop: 'logistics', prop: 'logistics',
type: 'select', type: 'select',
...@@ -186,7 +186,7 @@ const formConfig = ref([ ...@@ -186,7 +186,7 @@ const formConfig = ref([
label: 'Rate(oz/LB)', label: 'Rate(oz/LB)',
attrs: { attrs: {
placeholder: '请输入Rate(oz/LB)', placeholder: '请输入Rate(oz/LB)',
disabled: editForm.value?.['id'] ? true : false,
hasSuffix: false, hasSuffix: false,
hasAppend: true, hasAppend: true,
appendRender: () => { appendRender: () => {
...@@ -210,73 +210,82 @@ const formConfig = ref([ ...@@ -210,73 +210,82 @@ const formConfig = ref([
}, },
{ {
prop: 'zone1', prop: 'zone1',
type: 'input', type: 'amountInput',
label: 'ZONE 1', label: 'ZONE 1',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 1', placeholder: '请输入ZONE 1',
}, },
}, },
{ {
prop: 'zone2', prop: 'zone2',
type: 'input', type: 'amountInput',
label: 'ZONE 2', label: 'ZONE 2',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 2', placeholder: '请输入ZONE 2',
}, },
}, },
{ {
prop: 'zone3', prop: 'zone3',
type: 'input', type: 'amountInput',
label: 'ZONE 3', label: 'ZONE 3',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 3', placeholder: '请输入ZONE 3',
}, },
}, },
{ {
prop: 'zone4', prop: 'zone4',
type: 'input', type: 'amountInput',
label: 'ZONE 4', label: 'ZONE 4',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 4', placeholder: '请输入ZONE 4',
}, },
}, },
{ {
prop: 'zone5', prop: 'zone5',
type: 'input', type: 'amountInput',
label: 'ZONE 5', label: 'ZONE 5',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 5', placeholder: '请输入ZONE 5',
}, },
}, },
{ {
prop: 'zone6', prop: 'zone6',
type: 'input', type: 'amountInput',
label: 'ZONE 6', label: 'ZONE 6',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 6', placeholder: '请输入ZONE 6',
}, },
}, },
{ {
prop: 'zone7', prop: 'zone7',
type: 'input', type: 'amountInput',
label: 'ZONE 7', label: 'ZONE 7',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 7', placeholder: '请输入ZONE 7',
}, },
}, },
{ {
prop: 'zone8', prop: 'zone8',
type: 'input', type: 'amountInput',
label: 'ZONE 8', label: 'ZONE 8',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 8', placeholder: '请输入ZONE 8',
}, },
}, },
{ {
prop: 'zone9', prop: 'zone9',
type: 'input', type: 'amountInput',
label: 'ZONE 9', label: 'ZONE 9',
attrs: { attrs: {
hasSuffix: false,
placeholder: '请输入ZONE 9', placeholder: '请输入ZONE 9',
}, },
}, },
...@@ -439,8 +448,7 @@ async function editWay(item: LogisticsMethod) { ...@@ -439,8 +448,7 @@ async function editWay(item: LogisticsMethod) {
try { try {
editForm.value = { ...item } editForm.value = { ...item }
console.log(432, editForm.value) console.log(432, editForm.value)
// formConfig.value[0].attrs!.disabled = true editFormRef.value?.refashConfig()
// formConfig.value[1].attrs!.disabled = true
dialogVisible.value = true dialogVisible.value = true
} catch (e) { } catch (e) {
console.log(e) console.log(e)
...@@ -516,7 +524,7 @@ async function deleteFn() { ...@@ -516,7 +524,7 @@ async function deleteFn() {
return return
} }
try { try {
const ids = selection.value.map((item) => item.id).join(',') const ids = { ids: selection.value.map((item) => item.id).join(',') }
await deleteLogisticsQuotation(ids) await deleteLogisticsQuotation(ids)
ElMessage({ ElMessage({
message: '删除成功', message: '删除成功',
...@@ -525,6 +533,10 @@ async function deleteFn() { ...@@ -525,6 +533,10 @@ async function deleteFn() {
search() search()
} catch (e) { } catch (e) {
search() search()
ElMessage({
message: '删除失败',
type: 'error',
})
// showError(e) // showError(e)
} }
} }
...@@ -607,9 +619,11 @@ async function updateExcel(file) { ...@@ -607,9 +619,11 @@ async function updateExcel(file) {
} }
watch( watch(
() => loading.value, () => editForm.value,
(val) => { (val) => {
console.log(442, val) console.log('editForm', val)
const bool = editForm.value?.['id'] ? true : false
console.log('bool', bool)
}, },
{ deep: true, immediate: true }, { 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