价格销售
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);
|
||||
|
||||
Reference in New Issue
Block a user