计量客户
This commit is contained in:
@ -8,14 +8,35 @@ enum Api {
|
||||
List = '/dayPlan/lngDemand/list',
|
||||
Info = '/dayPlan/lngDemand/info',
|
||||
LngLngDemand = '/dayPlan/lngDemand',
|
||||
|
||||
|
||||
ContractList ='/magic-api/dayPlan/queryContractList',
|
||||
StationList ='/magic-api/dayPlan/queryStationList',
|
||||
Export = '/dayPlan/lngDemand/export',
|
||||
|
||||
|
||||
DataLog = '/dayPlan/lngDemand/datalog',
|
||||
}
|
||||
|
||||
export async function getLngLngDemandStationList(params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngLngDemandPageResult>(
|
||||
{
|
||||
url: Api.StationList,
|
||||
params: params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
export async function getLngLngDemandContractList(params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngLngDemandPageResult>(
|
||||
{
|
||||
url: Api.ContractList,
|
||||
params: params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 查询LngLngDemand分页列表
|
||||
*/
|
||||
|
||||
@ -3,17 +3,39 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/dayPlan/lngMeasureSales/page',
|
||||
// Page = '/dayPlan/lngMeasureSales/page',
|
||||
Page = '/magic-api/dayPlan/lngMeasureSalesPageList',
|
||||
List = '/dayPlan/lngMeasureSales/list',
|
||||
Info = '/dayPlan/lngMeasureSales/info',
|
||||
LngLngMeasure = '/dayPlan/lngMeasureSales',
|
||||
|
||||
|
||||
PageAdd = '/magic-api/dayPlan/dayPlanLngSelectList',
|
||||
Cancel = '/dayPlan/lngMeasureSales/cancel',
|
||||
|
||||
|
||||
DataLog = '/dayPlan/lngMeasureSales/datalog',
|
||||
}
|
||||
|
||||
export async function cancelLngLngMeasure(lngLngMeasure: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Cancel,
|
||||
params: lngLngMeasure,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
export async function getLngLngMeasurePageAdd(params: LngLngMeasurePageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngLngMeasurePageResult>(
|
||||
{
|
||||
url: Api.PageAdd,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 查询LngLngMeasure分页列表
|
||||
*/
|
||||
|
||||
230
src/components/common/priceLngHdrListModal.vue
Normal file
230
src/components/common/priceLngHdrListModal.vue
Normal file
@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||
@visible-change="handleVisibleChange" >
|
||||
<div class="box">
|
||||
<a-checkbox class="checkItem" v-model:checked="checked" @change="checkChange">仅显示未结算</a-checkbox>
|
||||
<BasicTable @register="registerTable" class="measureListModal">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'settledSign'">
|
||||
{{ Number(record.settledSign) == 1 ? '已结算': '未结算' }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'file'">
|
||||
<div v-for="item in (record.lngFileUploadList )" class="fileCSS">
|
||||
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref, nextTick, watch } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { getLngPngSettleHdrPageAdd} from '/@/api/dayPlan/PngSettleHdr';
|
||||
import { getLngPngSettleHdrPageAddPur} from '/@/api/dayPlan/PngSettleHdrPur'
|
||||
import { parseDownloadUrl} from '/@/api/system/file';
|
||||
import { downloadByUrl } from '/@/utils/file/download';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
const props = defineProps({
|
||||
selectType: { type: String, default: 'checkbox' },
|
||||
pageType: String
|
||||
|
||||
});
|
||||
const { t } = useI18n();
|
||||
const checked = ref(false)
|
||||
const codeFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'datePlan',
|
||||
label: '计划日期',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
style: { width: '100%' },
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const columns: BasicColumn[] = [
|
||||
{ dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100},
|
||||
{ dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100},
|
||||
{ dataIndex: 'cuSname', title: '客户', align: 'left', },
|
||||
{ dataIndex: 'pointDelyName', title: '下载点', align: 'left',},
|
||||
{ dataIndex: 'comName', title: '交易主体', align: 'left',},
|
||||
{ dataIndex: 'qtyMeaSalesGj', title: '完成量(吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'qtyMeaPurM3', title: '完成量(方)', align: 'left',width: 120},
|
||||
{ dataIndex: 'rateM3Gj', title: '比值(方/吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'ksName', title: '销售合同', align: 'left',},
|
||||
{ dataIndex: 'file', title: '附件', align: 'left',width: 200},
|
||||
{ dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100},
|
||||
];
|
||||
const columnsPur: BasicColumn[] = [
|
||||
{ dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100},
|
||||
{ dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100},
|
||||
{ dataIndex: 'suSname', title: '供应商', align: 'left', },
|
||||
{ dataIndex: 'pointUpName', title: '上载点', align: 'left',},
|
||||
{ dataIndex: 'cuSname', title: '客户', align: 'left',},
|
||||
{ dataIndex: 'pointDelyName', title: '下载点', align: 'left',},
|
||||
{ dataIndex: 'comName', title: '交易主体', align: 'left',},
|
||||
{ dataIndex: 'qtyMeaPurGj', title: '完成量(吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'qtyMeaPurM3', title: '完成量(方)', align: 'left',width: 120},
|
||||
{ dataIndex: 'rateM3Gj', title: '比值(方/吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'kpName', title: '采购合同', align: 'left',},
|
||||
{ dataIndex: 'file', title: '附件', align: 'left',width: 200},
|
||||
{ dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100},
|
||||
];
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { notification } = useMessage();
|
||||
const isUpdate = ref(true);
|
||||
const rowId = ref('');
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const selectedValues = ref([]);
|
||||
|
||||
const searchParams = ref({})
|
||||
const tableData = ref([])
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ confirmLoading: false });
|
||||
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
searchParams.value = data.searchParams || {}
|
||||
});
|
||||
|
||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,clearSelectedRowKeys }] = useTable({
|
||||
title: t('待结算记录'),
|
||||
api: props.pageType=='supplier'?getLngPngSettleHdrPageAddPur: getLngPngSettleHdrPageAdd,
|
||||
rowKey: props.pageType=='supplier' ? 'salesPurId': 'salesId',
|
||||
columns: props.pageType=='supplier' ? columnsPur: columns,
|
||||
|
||||
bordered: true,
|
||||
pagination: true,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
labelCol:{span: 12},
|
||||
schemas: codeFormSchema,
|
||||
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||
showResetButton: true,
|
||||
resetButtonOptions: {
|
||||
text: '重置',
|
||||
onClick: () => {
|
||||
checked.value = false
|
||||
},
|
||||
},
|
||||
},
|
||||
immediate: false, // 设置为不立即调用
|
||||
beforeFetch: (params) => {
|
||||
return { ...params,page:params.limit,...searchParams.value,settledSign: checked.value ? 0 : null};
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableData.value = res || []
|
||||
tableData.value.forEach(v => {
|
||||
let a = v.attachList ? v.attachList.split(',') : []
|
||||
v.lngFileUploadList = []
|
||||
a.forEach(k => {
|
||||
v.lngFileUploadList.push({
|
||||
fileOrg: k.split('@')[0],
|
||||
fileUrl: k.split('@')[1]
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
rowSelection: {
|
||||
type: props.selectType,
|
||||
onChange: onSelectChange
|
||||
},
|
||||
});
|
||||
watch(
|
||||
() => tableData.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let arr = DataFormat.format(val, [
|
||||
FormatOption.createQty('qtyMeaGj'),
|
||||
FormatOption.createQty('qtyMeaM3'),
|
||||
]);
|
||||
if (arr.length) {
|
||||
setTableData(arr)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
const handleVisibleChange = (visible: boolean) => {
|
||||
if (visible) {
|
||||
nextTick(() => {
|
||||
reload();
|
||||
});
|
||||
}
|
||||
};
|
||||
const checkChange = (val) => {
|
||||
reload();
|
||||
}
|
||||
const handleDownload = (info) => {
|
||||
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
||||
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
||||
downloadByUrl({ url, fileName: fileName});
|
||||
};
|
||||
function onSelectChange(rowKeys: string[], e) {
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
}
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('待结算记录') : t('')));
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!selectedValues.value.length) {
|
||||
notification.warning({
|
||||
message: t('提示'),
|
||||
description: t('请选择数据')
|
||||
});
|
||||
return
|
||||
}
|
||||
closeModal();
|
||||
clearSelectedRowKeys()
|
||||
emit('success', selectedValues.value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style >
|
||||
.measureListModal .basicCol{
|
||||
position: inherit !important;
|
||||
top: 0;
|
||||
}
|
||||
.measureListModal .ant-col-8 {
|
||||
width: 450px !important;
|
||||
max-width: 450px !important;;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
position: relative;
|
||||
}
|
||||
.checkItem {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 17px;
|
||||
z-index: 104;
|
||||
}
|
||||
.fileCSS a{
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
268
src/components/common/settleLngHdrList.vue
Normal file
268
src/components/common/settleLngHdrList.vue
Normal file
@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<div style="width: 100%">
|
||||
<div class="btnBox">
|
||||
<a-button v-if="!disabled" type="primary" style="margin-bottom: 10px;margin-right: 10px;" @click="handleBtn('add')">新增</a-button>
|
||||
<a-button v-if="!disabled" @click="handleBtn('del')">删除</a-button>
|
||||
<span>一次结算量(吉焦):{{ numObj.qtySettleGjOne }}</span>
|
||||
<span>多次结算量(吉焦):{{ numObj.qtySettleGjNum }}</span>
|
||||
<span>结算总量(吉焦):{{ numObj.qtySettleGjAll }}</span>
|
||||
<span>结算总金额(元):{{ numObj.amount }}</span>
|
||||
</div>
|
||||
<div class="price-box">
|
||||
<div>
|
||||
<span class="btn-title">修改价格/吉焦</span>
|
||||
<a-input-search type="number" enter-button="批量修改" style="width: 200px" :min="0" v-model.trim="formData.priceGj" placeholder="请输入" @search="editBtn('priceGj')"/>
|
||||
</div>
|
||||
<div>
|
||||
<span class="btn-title">修改价格/吨</span>
|
||||
<a-input-search type="number" enter-button="批量修改" style="width: 200px" :min="0" v-model.trim="formData.priceTon" placeholder="请输入" @search="editBtn('priceTon')"/>
|
||||
</div>
|
||||
<div>
|
||||
<span class="btn-title">修改金额</span>
|
||||
<a-input-search type="number" enter-button="批量修改" style="width: 200px" :min="0" v-model.trim="formData.amount" placeholder="请输入" @search="editBtn('amount')"/>
|
||||
</div>
|
||||
</div>
|
||||
<a-table :columns="columns" :data-source="dataList" :scroll="{x: 1800}" :rowKey="rowKey" :pagination="false" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a v-if="!disabled" @click="btnCheck(record, index, 'delete')">删除</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'kName'">
|
||||
<a @click="btnCheck(record, index, 'kName')">{{pageType=='supplier'?record.kpName :record.kName}}</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<priceLngHdrListModal @register="registerHdr" @success="handleSuccessHdr" :pageType="pageType"></priceLngHdrListModal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { Card } from 'ant-design-vue';
|
||||
import { reactive, ref, watch} from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { message } from 'ant-design-vue';
|
||||
import priceLngHdrListModal from '/@/components/common/priceLngHdrListModal.vue';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const dataList = ref([])
|
||||
const formData = reactive({})
|
||||
const selectedKeys = ref([])
|
||||
const numObj = ref({})
|
||||
const columns = ref([
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||
{ title: t('计划日期'), dataIndex: 'datePlan', width:120},
|
||||
{ title: t('车头号'), dataIndex: 'noTractor', width:120},
|
||||
{ title: t('挂车号'), dataIndex: 'noTrailer', width:120},
|
||||
{ title: t('进厂皮重时间'), dataIndex: 'timeIn', width:120},
|
||||
{ title: t('出厂毛重时间'), dataIndex: 'timeOut', width:120},
|
||||
{ title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:120},
|
||||
{ title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:120},
|
||||
{ title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 140},
|
||||
{ title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 130},
|
||||
{ title: t('结算价格(元/吉焦)'), dataIndex: 'priceGj', width: 180},
|
||||
{ title: t('结算价格(元/吨)'), dataIndex: 'priceTon', width: 170},
|
||||
{ title: t('结算金额(元)'), dataIndex: 'amount', width: 140},
|
||||
{ title: t('合同名称'), dataIndex: 'kName', width: 180},
|
||||
{ title: t('结算次数'), dataIndex: 'settleTimes', width: 100},
|
||||
{ title: t('操作'), dataIndex: 'operation', width: 80},
|
||||
]);
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const [registerHdr, { openModal:openModalHdr}] = useModal();
|
||||
const props = defineProps({
|
||||
disabled: Boolean,
|
||||
list: Array,
|
||||
formState: Object,
|
||||
pageType: String
|
||||
});
|
||||
const rowKey = props.pageType=='supplier' ? 'salesPurId': 'salesId'
|
||||
const emit = defineEmits(['change']);
|
||||
const onSelectChange = (rowKeys) => {
|
||||
selectedKeys.value = rowKeys;
|
||||
}
|
||||
const editBtn = (val) => {
|
||||
|
||||
}
|
||||
const handleBtn = (type) => {
|
||||
if (type === 'add') {
|
||||
if (!props.formState.cpCode || !props.formState.comId) {
|
||||
message.warn(props.pageType == 'customer' ? '请选择客户和交易主体' : '请选择供应商和交易主体')
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
cpCode: props.formState.cpCode,
|
||||
comId: props.formState.comId
|
||||
}
|
||||
openModalHdr(true,{isUpdate: false, searchParams: obj})
|
||||
} else {
|
||||
if (!selectedKeys.value.length) {
|
||||
message.warn('请选择删除数据')
|
||||
return
|
||||
}
|
||||
selectedKeys.value.forEach(i => {
|
||||
let idx = dataList.value.findIndex(v=>v[rowKey] == i)
|
||||
idx>-1&&dataList.value.splice(idx, 1)
|
||||
emit('change', dataList.value)
|
||||
});
|
||||
setTimeout(() => {
|
||||
selectedKeys.value = []
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
const handleSuccessHdr = (val) => {
|
||||
val.forEach(i =>{
|
||||
i.qtyMeaGj = props.pageType == 'supplier' ? i.qtyMeaPurGj : i.qtyMeaSalesGj
|
||||
i.qtyMeaM3 = props.pageType == 'supplier' ? i.qtyMeaPurM3 : i.qtyMeaPurM3
|
||||
delete i.lngFileUploadList
|
||||
})
|
||||
if (!dataList.value.length) {
|
||||
dataList.value = val
|
||||
emit('change', dataList.value)
|
||||
return
|
||||
}
|
||||
val.forEach(v=> {
|
||||
let idx = dataList.value.findIndex(k=>k[rowKey]==v[rowKey])
|
||||
idx<0&&dataList.value.push(v)
|
||||
emit('change', dataList.value)
|
||||
})
|
||||
}
|
||||
|
||||
const btnCheck = (record, index, type) => {
|
||||
if (type == 'delete') {
|
||||
dataList.value.splice(index, 1)
|
||||
emit('change', dataList.value)
|
||||
}
|
||||
if (type == 'kName'){
|
||||
if (props.pageType == 'supplier') {
|
||||
router.push({
|
||||
path: '/contract/ContractPurPng/viewForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/PngSettleHdrPur',
|
||||
id: record.kpId,
|
||||
disabled: true
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
router.push({
|
||||
path: '/contract/ContractSales/viewForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/PngSettleHdr',
|
||||
id: record.ksId,
|
||||
disabled: true
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
const getList = () => {
|
||||
return dataList.value
|
||||
}
|
||||
watch(
|
||||
() => dataList.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let qtySettleGjOne = 0
|
||||
let qtySettleGjNum = 0
|
||||
let amount = 0
|
||||
val.forEach(v => {
|
||||
if (Number(v.settleTimes) == 1){
|
||||
qtySettleGjOne+=Number((v.qtySettleGj || '').replace(/,/g, '')) || 0
|
||||
} else {
|
||||
qtySettleGjNum+=Number((v.qtySettleGj || '').replace(/,/g, '')) || 0
|
||||
}
|
||||
amount+=Number((v.amount || '').replace(/,/g, '')) || 0
|
||||
})
|
||||
numObj.value.qtySettleGjOne = qtySettleGjOne.toFixed(3)
|
||||
numObj.value.qtySettleGjNum = qtySettleGjNum.toFixed(3)
|
||||
numObj.value.qtySettleGjAll = (qtySettleGjOne + qtySettleGjNum).toFixed(3)
|
||||
numObj.value.amount = amount.toFixed(2)
|
||||
|
||||
numObj.value = DataFormat.format({...numObj.value}, [
|
||||
FormatOption.createQty('qtySettleGjOne'),
|
||||
FormatOption.createQty('qtySettleGjNum'),
|
||||
FormatOption.createQty('qtySettleGjAll'),
|
||||
FormatOption.createAmt('amount'),
|
||||
]);
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.pageType,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let idx1 = columns.value.findIndex(v=>v.dataIndex == 'pointUpName')
|
||||
let idx2 = columns.value.findIndex(v=>v.dataIndex == 'cuSname')
|
||||
if (val == 'supplier') {
|
||||
idx1 < 0 && columns.value.splice(4, 0, { title: t('上载点'), dataIndex: 'pointUpName', width: 200})
|
||||
idx2 < 0 && columns.value.splice(5, 0, { title: t('客户'), dataIndex: 'cuSname', width: 200})
|
||||
} else {
|
||||
idx1>-1 && columns.value.splice(idx1, 1)
|
||||
idx2>-1 && columns.value.splice(idx2, 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let idx2 = columns.value.findIndex(v =>v.dataIndex == 'operation')
|
||||
idx2>-1 && columns.value.splice(idx2, 1)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.list,
|
||||
async (val) => {
|
||||
dataList.value = val || []
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
defineExpose({
|
||||
getList,
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.btnBox {
|
||||
span {
|
||||
margin: 0 30px;
|
||||
}
|
||||
}
|
||||
.btn-title {
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
z-index: 2;
|
||||
margin: 0 -5px 0 10px;
|
||||
border: 1px solid #d9d9d9;
|
||||
width: 110px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
.price-box {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin: 0 20px 10px 0;
|
||||
div {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -144,7 +144,7 @@
|
||||
import { getCompDept } from '/@/api/approve/Appro';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { getLngPngDemandContractList, getLngPngDemandPointDely, getLngPngDemandContractQty, getLngPngDemandPurList, getLngPngDemandRate } from '/@/api/dayPlan/Demand';
|
||||
import { getLngLngDemandContractList, getLngLngDemandStationList } from '/@/api/dayPlan/LngDemand';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
@ -203,7 +203,7 @@
|
||||
cuCode:formState.value.cuCode,
|
||||
datePlan: dayjs(formState.value.datePlan).format('YYYY-MM-DD')
|
||||
}
|
||||
let res = await getLngPngDemandContractList(obj)
|
||||
let res = await getLngLngDemandContractList(obj)
|
||||
contractList.value = res || []
|
||||
if (contractList.value.length == 1) {
|
||||
formState.value.kName = contractList.value[0].kName
|
||||
@ -240,7 +240,7 @@
|
||||
getPurList()
|
||||
}
|
||||
const getPointDely = async () => {
|
||||
let res = await getLngPngDemandPointDely({kId: formState.value.ksId})
|
||||
let res = await getLngLngDemandStationList({kId: formState.value.ksId})
|
||||
pointDelyList.value = res || []
|
||||
if (pointDelyList.value.length == 1) {
|
||||
formState.value.pointDelyName = pointDelyList.value[0].pointDelyName
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||
import { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { getLngLngMeasurePageAdd, addLngLngMeasure } from '/@/api/dayPlan/LngMeasureSales';
|
||||
import NP from 'number-precision';
|
||||
|
||||
const userStore = useUserStore();
|
||||
@ -172,7 +172,7 @@
|
||||
const selectedValues = ref([]);
|
||||
const [registerTable, { reload,setPagination }] = useTable({
|
||||
title: t('LNG计量(客户)新增列表'),
|
||||
api: getLngPngMeasureSalesPurPageAdd,
|
||||
api: getLngLngMeasurePageAdd,
|
||||
columns: columns,
|
||||
|
||||
pagination: true,
|
||||
@ -219,7 +219,7 @@
|
||||
spinning.value = true;
|
||||
try {
|
||||
|
||||
await addLngPngMeasureSalesPur(selectedValues.value);
|
||||
await addLngLngMeasure(selectedValues.value);
|
||||
spinning.value = false;
|
||||
notification.success({
|
||||
message: '提示',
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngLngMeasurePage, deleteLngLngMeasure} from '/@/api/dayPlan/LngMeasureSales';
|
||||
import { getLngLngMeasurePage, deleteLngLngMeasure,addLngLngMeasure, updateLngLngMeasure,cancelLngLngMeasure} from '/@/api/dayPlan/LngMeasureSales';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -70,7 +70,6 @@
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||
import { getLngLngMeasure } from '/@/api/dayPlan/LngMeasureSales';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import LngMeasureSalesModal from './components/LngMeasureSalesModal.vue';
|
||||
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||
@ -81,7 +80,11 @@
|
||||
import { parseDownloadUrl} from '/@/api/system/file';
|
||||
import { downloadByUrl } from '/@/utils/file/download';
|
||||
import { DeleteOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
import { getCompDept } from '/@/api/approve/Appro';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
const curCuCode = ref('')
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -95,7 +98,6 @@
|
||||
const customSearchFormSchema =ref(searchFormSchema);
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const selectedRowsData = ref<any[]>([]);
|
||||
const curCuCode = ref('')
|
||||
const tableRef = ref();
|
||||
const curIdx = ref('')
|
||||
//所有按钮
|
||||
@ -149,8 +151,9 @@
|
||||
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||
showResetButton: false,
|
||||
},
|
||||
immediate: false,
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit,cuCode:curCuCode.value };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
@ -233,7 +236,7 @@
|
||||
} else {
|
||||
selectedRowsData.value= [{...val}]
|
||||
}
|
||||
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
await cancelLngLngMeasure(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: '提示',
|
||||
@ -254,7 +257,7 @@
|
||||
selectedRowsData.value= [{...val}]
|
||||
}
|
||||
|
||||
await updateLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
await updateLngLngMeasure(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: '提示',
|
||||
@ -274,7 +277,7 @@
|
||||
} else {
|
||||
selectedRowsData.value= [{...val}]
|
||||
}
|
||||
await addLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
await addLngLngMeasure(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: '提示',
|
||||
@ -312,8 +315,10 @@
|
||||
|
||||
reload();
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
onMounted(async() => {
|
||||
const res = await getCompDept(userInfo.id)
|
||||
curCuCode.value = res?.comp?.cuCode
|
||||
reload({searchInfo:{'limit':1,'size':10,'page':1}});
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="账期内含预收付款" name="rpSign">
|
||||
<a-select v-model:value="formState.rpSign" style="width: 100%" allow-clear :disabled="isDisable">
|
||||
<a-select-option v-for="item in optionSelect.signList" :key="item.code" :value="item.code">
|
||||
<a-form-item label="状态" name="approCode">
|
||||
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -57,15 +57,6 @@
|
||||
<a-input v-model:value="formState.amount" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="状态" name="approCode">
|
||||
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="结算说明" name="settleDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.settleDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
@ -78,15 +69,16 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
</Card>
|
||||
<Card>
|
||||
<settleSalesPurList :list="dataList" :disabled="isDisable" pageType="customer" :formState="formState" @change="settleChange"></settleSalesPurList>
|
||||
</Card>
|
||||
|
||||
<Card title="对账单" :bordered="false" >
|
||||
<UploadList :disabled="isDisable" btnTip="上传对账单" :list="dataFileAccount" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadChange"/>
|
||||
</Card>
|
||||
<Card title="附件信息" :bordered="false" >
|
||||
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||
</Card>
|
||||
<Card>
|
||||
<settleLngHdrList :list="dataList" :disabled="isDisable" pageType="customer" :formState="formState" @change="settleChange"></settleLngHdrList>
|
||||
</Card>
|
||||
</a-form>
|
||||
</div>
|
||||
<customerListModal @register="registerCustomer" @success="handleSuccessCustomer" selectType="radio" />
|
||||
@ -112,7 +104,7 @@
|
||||
import { message } from 'ant-design-vue';
|
||||
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||
import customerListModal from '/@/components/common/customerListModal.vue';
|
||||
import settleSalesPurList from '/@/components/common/settleSalesPurList.vue';
|
||||
import settleLngHdrList from '/@/components/common/settleLngHdrList.vue';
|
||||
|
||||
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
const taskIdRef = ref('');
|
||||
const visibleFlowRecordModal = ref(false);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='LNG销售结算';
|
||||
const formName=currentRoute.value.meta?.title;
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngLngSettleHdrPage,
|
||||
|
||||
Reference in New Issue
Block a user