价格销售
This commit is contained in:
@ -43,7 +43,7 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
</Card>
|
||||
<priceInfoList :list="dataListPrice" :formState="formState" :optionSelect="optionSelect" ref="priceRef" pageType="pur" :isDisable="isDisable" :rateCode="rateCode" @change="priceChange"/>
|
||||
<priceInfoList :list="dataListPrice" :formState="formState" :optionSelect="optionSelect" ref="priceRef" pageType="sales" :isDisable="isDisable" :rateCode="rateCode" @change="priceChange"/>
|
||||
<Card title="附件信息" :bordered="false" >
|
||||
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||
</Card>
|
||||
@ -65,7 +65,7 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngPricePurPngApp,updateLngPricePurPngApp, getLngPricePurPngApp } from '/@/api/price/PricePurPngApp';
|
||||
import { addLngPriceSalesPngApp,updateLngPriceSalesPngApp, getLngPriceSalesPngApp } from '/@/api/price/PriceSalesPngApp';
|
||||
import dayjs from 'dayjs';
|
||||
import { h } from 'vue';
|
||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||
@ -82,8 +82,8 @@
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const tableName = 'PricePurPngApp';
|
||||
const columnName = 'PricePurPngApp'
|
||||
const tableName = 'PriceSalesPngApp';
|
||||
const columnName = 'PriceSalesPngApp'
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
@ -177,11 +177,16 @@
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngPricePurPngApp(id)
|
||||
let data = await getLngPriceSalesPngApp(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
Object.assign(dataListPrice.value, formState.lngPricePurPngAppSuList || [])
|
||||
Object.assign(dataListPrice.value, formState.lngPriceSalesPngAppCuList || [])
|
||||
dataListPrice.value.forEach(v=> {
|
||||
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null
|
||||
v.lngPricePurPngAppSuDtlList = v.lngPriceSalesPngAppCuDtlList || []
|
||||
|
||||
})
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
}
|
||||
@ -200,17 +205,20 @@
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
let priceList = priceRef.value.getList()
|
||||
let priceList = JSON.parse(JSON.stringify(priceRef.value.getList()))
|
||||
for(let i=0; i<priceList.length; i++) {
|
||||
let isFlag = !priceList[i].kName || !priceList[i].dateFrom
|
||||
if (isFlag) {
|
||||
message.warn('请完善供应商价格信息必选项')
|
||||
message.warn('请完善客户价格信息必选项')
|
||||
return
|
||||
}
|
||||
let arr = priceList[i].lngPricePurPngAppSuDtlList || []
|
||||
priceList[i].dateFrom = priceList[i].dateFrom ? dayjs(priceList[i].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null
|
||||
priceList[i].lngPriceSalesPngAppCuDtlList = priceList[i].lngPricePurPngAppSuDtlList || []
|
||||
delete priceList[i].lngPricePurPngAppSuDtlList
|
||||
let arr = priceList[i].lngPriceSalesPngAppCuDtlList || []
|
||||
for(let i=0; i<arr.length; i++) {
|
||||
if (!arr[i].priceCode) {
|
||||
message.warn('请完善供应商价格信息必选项')
|
||||
message.warn('请完善客户价格信息必选项')
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -218,13 +226,13 @@
|
||||
|
||||
let obj = {
|
||||
...formState,
|
||||
lngPricePurPngAppSuList: priceList,
|
||||
lngPriceSalesPngAppCuList: priceList,
|
||||
lngFileUploadList: dataFile.value,
|
||||
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngPricePurPngApp :updateLngPricePurPngApp
|
||||
let request = !formState.id ? addLngPriceSalesPngApp :updateLngPriceSalesPngApp
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
|
||||
@ -29,9 +29,7 @@
|
||||
const logId = ref('')
|
||||
const logPath = ref('/ship/meaPurInt/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
|
||||
} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, } from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
@ -51,6 +49,7 @@
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -66,7 +65,7 @@
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
@ -89,6 +88,7 @@
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const defaultDate = ref([dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='国际采购计量';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
@ -100,10 +100,34 @@
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
schemas: [
|
||||
{
|
||||
field: 'dateEta',
|
||||
label: '计量日期',
|
||||
component: 'RangePicker',
|
||||
defaultValue: defaultDate.value,
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
style: { width: '100%' },
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'staName',
|
||||
label: '接收站',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'ssNo',
|
||||
label: '船期编号',
|
||||
component: 'Input',
|
||||
},
|
||||
|
||||
],
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
showResetButton: true,
|
||||
},
|
||||
immediate: false,
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
},
|
||||
@ -237,7 +261,7 @@
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
reload({ searchInfo: { startDate: defaultDate.value[0], endDate: defaultDate.value[1] }});
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
@ -305,4 +329,12 @@
|
||||
.hide{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep( .ant-col-8:nth-child(1)) {
|
||||
width: 320px !important;
|
||||
max-width: 320px !important;;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||
width: 80px !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user