计量
This commit is contained in:
@ -164,7 +164,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="联系电话" name="tel">
|
||||
<a-input-search v-model:value="formState.tel" :disabled="isDisable" placeholder="请输入电话" />
|
||||
<a-input v-model:value="formState.tel" :disabled="isDisable" placeholder="请输入电话" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
|
||||
@ -51,10 +51,25 @@ export const columns: BasicColumn[] = [
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'cuSname',
|
||||
title: '供应商简称',
|
||||
title: '客户',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'pointDelyName',
|
||||
title: '下载点',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'suSname',
|
||||
title: '供应商',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
@ -70,15 +85,6 @@ export const columns: BasicColumn[] = [
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'pointDelyName',
|
||||
title: '下载点',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'qtySalesGj',
|
||||
title: '批复量(吉焦)',
|
||||
@ -159,7 +165,14 @@ export const columns: BasicColumn[] = [
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ksNmae',
|
||||
title: '销售合同',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'kpName',
|
||||
title: '采购合同',
|
||||
|
||||
@ -9,128 +9,55 @@
|
||||
<slot name="icon"><save-outlined /></slot>保存
|
||||
</a-button>
|
||||
</div>
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||
<a-row>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="计量日期" name="reply" >
|
||||
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="客户名称/简称/编码" name="kName">
|
||||
<a-input v-model:value="formState.kName" placeholder="请选择合同" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="供应商名称/简称/编码" name="kName">
|
||||
<a-input v-model:value="formState.kName" placeholder="请选择合同" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="3">
|
||||
<a-button style="margin: 0 10px" type="primary" @click="onSearch">搜索</a-button>
|
||||
<a-button @click="onReset">重置</a-button>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="计划日期" name="reply" >
|
||||
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="上载点" name="kName">
|
||||
<a-input v-model:value="formState.kName" placeholder="请选择上载点" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="下载点" name="kName">
|
||||
<a-input v-model:value="formState.kName" placeholder="请选择下载点" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-form>
|
||||
<BasicTable @register="registerTable" class="contractFactListModal"></BasicTable>
|
||||
<searchForm @search="onSearch" @reset="onReset" ></searchForm>
|
||||
<BasicTable @register="registerTable"></BasicTable>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { Card } from 'ant-design-vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import { SaveOutlined, } from '@ant-design/icons-vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare } from '/@/api/dayPlan/PngAppro';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||
import { getLngPngMeasureSalesPurPageAdd } from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import {formConfig, searchFormSchema, columns } from './config';
|
||||
import searchForm from './searchForm.vue';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
const props = defineProps({
|
||||
disabled: false,
|
||||
id: ''
|
||||
|
||||
});
|
||||
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const { currentRoute } = router;
|
||||
const isDisable = ref(false);
|
||||
const { formPath } = currentRoute.value.query;
|
||||
const pathArr = [];
|
||||
|
||||
const tabStore = useMultipleTabStore();
|
||||
const formProps = ref(null);
|
||||
const formId = ref(currentRoute.value?.params?.id);
|
||||
const pageType = ref(currentRoute.value.query?.type);
|
||||
const pageId = ref(currentRoute.value.query?.id)
|
||||
|
||||
|
||||
const spinning = ref(false);
|
||||
const { t } = useI18n();
|
||||
const hasDel = ref(false)
|
||||
const formState = reactive({
|
||||
|
||||
});
|
||||
const formState = ref({});
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const rules= reactive({
|
||||
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
});
|
||||
const layout = {
|
||||
labelCol: { span: 9 },
|
||||
wrapperCol: { span: 18 },
|
||||
}
|
||||
const basicFormRef = ref()
|
||||
let optionSelect= reactive({
|
||||
approCodeList: [],
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
});
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { notification } = useMessage();
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const selectedValues = ref([]);
|
||||
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: t('管道气计量新增列表'),
|
||||
api: getLngPngMeasureSalesPurPageAdd,
|
||||
columns,
|
||||
columns: columns,
|
||||
|
||||
pagination: true,
|
||||
canResize: false,
|
||||
@ -142,7 +69,7 @@
|
||||
},
|
||||
immediate: true,
|
||||
beforeFetch: (params) => {
|
||||
return { ...params,...formState};
|
||||
return { ...params,...formState.value};
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
@ -153,54 +80,31 @@
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
}
|
||||
const onSearch = () => {
|
||||
const onSearch = (val) => {
|
||||
formState.value = val
|
||||
reload()
|
||||
}
|
||||
const onReset = () => {
|
||||
formState = {
|
||||
page: 1,
|
||||
size: 10
|
||||
}
|
||||
formState.value ={ page: 1,size: 10}
|
||||
}
|
||||
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute.value, router);
|
||||
}
|
||||
async function checkBtn(type) {
|
||||
let data = basicFormRef.value.getFormValue()
|
||||
console.log(data, 'data')
|
||||
let arr = JSON.parse(JSON.stringify(data.list))
|
||||
arr.forEach(v=> {
|
||||
v.qtyDemandM3 = Number(v.qtyDemandM3)*10000
|
||||
v.qtySalesM3 = Number(v.qtySalesM3)*10000
|
||||
})
|
||||
let obj = {
|
||||
...data.formInfo,
|
||||
qtyContractM3: Number(data.formInfo.qtyContractM3)*10000,
|
||||
qtyPlanM3: Number(data.formInfo.qtyPlanM3)*10000,
|
||||
qtyDemandM3: Number(data.formInfo.qtyDemandM3)*10000,
|
||||
qtySalesM3: Number(data.formInfo.qtySalesM3)*10000,
|
||||
lngPngApproPurList:arr
|
||||
}
|
||||
let params = {
|
||||
result: type == 'agree' ? 'C' : 'R',
|
||||
remark: formState.reply,
|
||||
data: obj
|
||||
async function checkBtn() {
|
||||
if (!selectedValues.value.length) {
|
||||
message.warn('请选择数据')
|
||||
return
|
||||
}
|
||||
spinning.value = true;
|
||||
try {
|
||||
if (type == 'reject') {
|
||||
if (!formState.reply) {
|
||||
message.warn('请输入批复意见')
|
||||
return
|
||||
}
|
||||
}
|
||||
await approveLngPngAppro(params);
|
||||
|
||||
await addLngPngMeasureSalesPur(selectedValues.value);
|
||||
spinning.value = false;
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: type == 'agree' ? '审批通过':'已驳回'
|
||||
}); //提示消息
|
||||
description: '保存成功'
|
||||
});
|
||||
setTimeout(() => {
|
||||
bus.emit(FORM_LIST_MODIFIED, {});
|
||||
close();
|
||||
|
||||
120
src/views/dayPlan/PngMeasureSalesPur/components/searchForm.vue
Normal file
120
src/views/dayPlan/PngMeasureSalesPur/components/searchForm.vue
Normal file
@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<a-form ref="formRef" :model="formState" v-bind="layout">
|
||||
<a-row>
|
||||
<a-col :span="6">
|
||||
<a-form-item label="计量日期" name="dateMea" >
|
||||
<a-range-picker v-model:value="formState.dateMea" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="客户名称/简称/编码" name="cuSname">
|
||||
<a-input v-model:value="formState.cuSname" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7">
|
||||
<a-form-item label="供应商名称/简称/编码" name="suSname">
|
||||
<a-input v-model:value="formState.suSname" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<div class="btnFoot">
|
||||
<a-button style="margin: 0 10px" type="primary" @click="onSearch">搜索</a-button>
|
||||
<a-button @click="onReset">重置</a-button>
|
||||
<AButton type="link" size="small" @click="toggleAdvanced">
|
||||
{{ isAdvanced ? t('收起') : t('展开') }}
|
||||
<BasicArrow class="ml-1" :expand="!isAdvanced" up />
|
||||
</AButton>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="6" v-if="isAdvanced">
|
||||
<a-form-item label="计划日期" name="reply" >
|
||||
<a-range-picker v-model:value="formState.datePlan" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7" v-if="isAdvanced">
|
||||
<a-form-item label="上载点" name="pointUpName">
|
||||
<a-input-search v-model:value="formState.pointUpName" readonly placeholder="请选择上载点" @search="onSearchDownLoad('up')" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="7" v-if="isAdvanced">
|
||||
<a-form-item label="下载点" name="pointDelyName">
|
||||
<a-input-search v-model:value="formState.pointDelyName" readonly placeholder="请选择下载点" @search="onSearchDownLoad('dely')"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-form>
|
||||
<downloadPointModal @register="register" @success="handleSuccessDownLoad" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import dayjs from 'dayjs';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
|
||||
import { Button as AButton, ButtonProps } from '/@/components/Button';
|
||||
import { BasicArrow } from '/@/components/Basic';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const { currentRoute } = router;
|
||||
|
||||
const tabStore = useMultipleTabStore();
|
||||
|
||||
const spinning = ref(false);
|
||||
const { t } = useI18n();
|
||||
const formState = ref({});
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const layout = {
|
||||
labelCol: { span: 9 },
|
||||
wrapperCol: { span: 15 },
|
||||
}
|
||||
const isAdvanced = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
});
|
||||
|
||||
const emit = defineEmits(['search', 'reset']);
|
||||
function toggleAdvanced() {
|
||||
isAdvanced.value = !isAdvanced.value
|
||||
}
|
||||
const onSearchDownLoad = (val)=> {
|
||||
openModal(true,{isUpdate: false, type: val})
|
||||
}
|
||||
const handleSuccessDownLoad = (val, type)=> {
|
||||
if (type === 'up') {
|
||||
formState.value.pointUpName = val[0].fullName
|
||||
formState.value.pointUpCode = val[0].code
|
||||
} else {
|
||||
formState.value.pointDelyName = val[0].fullName
|
||||
formState.value.pointDelyCode = val[0].code
|
||||
}
|
||||
}
|
||||
const onSearch = () => {
|
||||
emit('search', formState.value)
|
||||
}
|
||||
const onReset = () => {
|
||||
formState.value ={ page: 1,size: 10}
|
||||
emit('reset', formState.value)
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.btnFoot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@ -54,7 +54,7 @@
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur} from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur} from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -62,7 +62,6 @@
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||
import { getLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import PngMeasureSalesPurModal from './components/PngMeasureSalesPurModal.vue';
|
||||
import { ImportModal } from '/@/components/Import';
|
||||
@ -90,7 +89,7 @@
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":false},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":false},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":true},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"驳回","code":"reject","icon":"ant-design:stop-outlined","isDefault":true},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
@ -105,7 +104,7 @@
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,}
|
||||
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport, save: handleSave, submit: handleSubmit}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -211,6 +210,39 @@
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
async function handleSubmit() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要确认的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
await updateLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('确认成功!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
}
|
||||
async function handleSave() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要保存的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
await addLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('保存成功!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
|
||||
}
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
|
||||
Reference in New Issue
Block a user