|
@@ -0,0 +1,563 @@
|
|
|
+<template>
|
|
|
+ <a-spin :spinning="loading">
|
|
|
+ <JFormContainer :disabled="disabled">
|
|
|
+ <template #detail>
|
|
|
+ <a-form v-bind="formItemLayout" name="quotationFormForm" ref="formRef">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="发货通知单号(bill code)" v-bind="validateInfos.billCode" id="quotationFormForm-billCode" name="billCode" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.billCode" placeholder="请输入发货通知单号(bill code)" ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="发货日期(delivery date)" v-bind="validateInfos.deliveryDate" id="quotationFormForm-deliveryDate" name="deliveryDate">
|
|
|
+ <a-date-picker placeholder="请选择发货日期(delivery date)" v-model:value="formData.deliveryDate" value-format="YYYY-MM-DD" disabled style="width: 100%" allow-clear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="项目(project)" v-bind="validateInfos.projectName" id="quotationFormForm-projectName" name="projectName">
|
|
|
+ <a-input-search v-model:value="formData.projectName" placeholder="请输入项目(project)" allow-clear enter-button="Search" :disabled="notAllowEdit" @search="onSearchProject"></a-input-search>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="客户(customer)" v-bind="validateInfos.customer" id="quotationFormForm-customer" name="customer" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <JSelectInput v-model:value="formData.customer" placeholder="请选择" :options="customerOption" disabled></JSelectInput>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="优先级(priority)" v-bind="validateInfos.priority" id="quotationFormForm-priority" name="priority">
|
|
|
+ <JDictSelectTag v-model:value="formData.priority" placeholder="请选择" dictCode="priority" disabled/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" id="quotationFormForm-productionClass" name="productionClass" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <JSelectInput v-model:value="formData.productionClass" placeholder="请选择" :options="classOption" disabled></JSelectInput>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="机型(model)" v-bind="validateInfos.model" id="quotationFormForm-model" name="model">
|
|
|
+ <JSelectMultiple v-model:value="formData.model" placeholder="请选择" dictCode="model_typer" disabled/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="厂家(maker)" v-bind="validateInfos.maker" id="quotationFormForm-maker" name="maker" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.maker" placeholder="请输入厂家(maker)" allow-clear disabled></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="币种(currency)" v-bind="validateInfos.currency" id="quotationFormForm-currency" name="currency">
|
|
|
+ <JDictSelectTag v-model:value="formData.currency" placeholder="请选择" dictCode="currency" disabled/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="交货条款(delivery terms)" v-bind="validateInfos.deliveryTerms" id="quotationFormForm-deliveryTerms" name="deliveryTerms" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <JDictSelectTag v-model:value="formData.deliveryTerms" placeholder="请选择" dictCode="delivery_terms" disabled/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="发货方式(delivery)" v-bind="validateInfos.delivery" id="SaleOrderForm-delivery" name="delivery">
|
|
|
+ <JDictSelectTag v-model:value="formData.delivery" placeholder="请选择" dictCode="delivery_methods" disabled/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="交货地点(place of delivery)" v-bind="validateInfos.placeDelivery" id="quotationFormForm-placeDelivery" name="placeDelivery">
|
|
|
+ <a-input v-model:value="formData.placeDelivery" placeholder="请输入交货地点(place of delivery)" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="是否希望出口(export)" v-bind="validateInfos.export" id="quotationFormForm-export" name="export" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <JDictSelectTag v-model:value="formData.export" placeholder="请选择" dictCode="yes_or_no"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="质保期(warranty period)" v-bind="validateInfos.warrantyPeriod" id="SaleOrderForm-warrantyPeriod" name="warrantyPeriod">
|
|
|
+ <a-input v-model:value="formData.warrantyPeriod" placeholder="请输入" style="width: 85%;margin-right: 1%;"/>月(month)
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="销售部门(sale department)" v-bind="validateInfos.saleDepartment" id="SaleInquiryFormForm-saleDepartment" name="saleDepartment">
|
|
|
+ <a-input v-model:value="formData.saleDepartment" placeholder="" allow-clear disabled></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="包装要求(packaging requirement)" v-bind="validateInfos.packagingRequirement" id="quotationFormForm-packagingMethod" name="packagingMethod" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.packagingMethod" placeholder="请输入包装要求(packaging requirement)" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="联系人(linkman)" v-bind="validateInfos.linkman" id="quotationFormForm-linkman" name="linkman" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.linkman" placeholder="请输入联系人(linkman)" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="收货地址(address)" v-bind="validateInfos.address" id="quotationFormForm-address" name="address">
|
|
|
+ <a-input v-model:value="formData.address" placeholder="" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="联系电话(linkman phone)" v-bind="validateInfos.linkmanPhone" id="quotationFormForm-linkmanPhone" name="linkmanPhone">
|
|
|
+ <a-input v-model:value="formData.linkmanPhone" placeholder="" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="业务员(salesman)" v-bind="validateInfos.salesman" id="quotationFormForm-salesman" name="salesman">
|
|
|
+ <a-input v-model:value="formData.salesman" placeholder="" allow-clear disabled></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="F号(F number)" v-bind="validateInfos.FNumber" id="quotationFormForm-FNumber" name="FNumber" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.FNumber" placeholder="请选择" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="提单号(B/L NO)" v-bind="validateInfos.BLNO" id="quotationFormForm-BLNO" name="BLNO">
|
|
|
+ <a-input v-model:value="formData.BLNO" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="备注(notes)" v-bind="validateInfos.notes" id="quotationFormForm-notes" name="notes" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
+ <a-input v-model:value="formData.notes" placeholder="请输入备注(notes)" allow-clear ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </template>
|
|
|
+ </JFormContainer>
|
|
|
+
|
|
|
+ <!-- 子表单区域 -->
|
|
|
+ <a-tabs v-model:activeKey="activeKey" animated style=" padding: 24px;padding-top: 0px;">
|
|
|
+ <a-tab-pane tab="发货通知单 - 发货明细(delivery details)" key="deliveryDetailFormProduct" :forceRender="true">
|
|
|
+ <a-button type="primary" @click="selectProducts" style="margin-right: 1%;margin-bottom: 1%;"> 选择产品(select product)</a-button>
|
|
|
+ <a-button type="primary" @click="selectSaleOrderList"> 选择销售订单(selete saleOrder)</a-button>
|
|
|
+ <j-vxe-table
|
|
|
+ :keep-source="true"
|
|
|
+ resizable
|
|
|
+ ref="deliveryDetailFormProductTableRef"
|
|
|
+ :loading="deliveryDetailFormProductTable.loading"
|
|
|
+ :columns="deliveryDetailFormProductTable.columns"
|
|
|
+ :dataSource="deliveryDetailFormProductTable.dataSource"
|
|
|
+ :height="340"
|
|
|
+ :disabled="disabled"
|
|
|
+ :rowNumber="true"
|
|
|
+ :rowSelection="true"
|
|
|
+ asyncRemove
|
|
|
+ >
|
|
|
+ <template #action="props">
|
|
|
+ <a-popconfirm title="确定删除吗?" @confirm="handleDelete1(props)">
|
|
|
+ <a>删除(delete)</a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </template>
|
|
|
+ </j-vxe-table>
|
|
|
+ </a-tab-pane>
|
|
|
+ <a-tab-pane tab="发货通知单 - 船明细(ship details)" key="deliveryNoticeFormShip" :forceRender="true">
|
|
|
+ <j-vxe-table
|
|
|
+ :keep-source="true"
|
|
|
+ resizable
|
|
|
+ ref="deliveryNoticeFormShipTableRef"
|
|
|
+ :loading="deliveryNoticeFormShipTable.loading"
|
|
|
+ :columns="deliveryNoticeFormShipTable.columns"
|
|
|
+ :dataSource="deliveryNoticeFormShipTable.dataSource"
|
|
|
+ :height="340"
|
|
|
+ :disabled="disabled"
|
|
|
+ :rowNumber="true"
|
|
|
+ :rowSelection="true"
|
|
|
+ >
|
|
|
+ <template #action="props" >
|
|
|
+ <a @click="viewAccessory(props)" >查看配件信息(view accessory information)</a>
|
|
|
+ </template>
|
|
|
+ </j-vxe-table>
|
|
|
+ </a-tab-pane>
|
|
|
+
|
|
|
+ </a-tabs>
|
|
|
+ <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesModal>
|
|
|
+ <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct="addProduct"></SelectPrpductModal>
|
|
|
+ <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
|
+ <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addFormSaleOrder"></SelectSaleOrderModal>
|
|
|
+ </a-spin>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+ import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
|
|
|
+ import { defHttp } from '/@/utils/http/axios';
|
|
|
+ import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
|
|
+ import { querysaleQuotationFormShipListByMainId,querySaleQuotationFormProductListByMainId,queryDataById, saveOrUpdate } from '../delivertNoticeForm.api';
|
|
|
+ import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
+ import {deliveryNoticeShipColumns, deliveryNoticeProductColumns} from '../delivertNoticeForm.data';
|
|
|
+ import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
|
+ import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
|
|
|
+ import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
|
+ import SelectSaleOrderModal from '../../../publicComponents/SelectSaleOrderModal.vue';
|
|
|
+ import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
+ import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
|
+ import { JDictSelectTag,JSelectMultiple} from '/@/components/Form';
|
|
|
+ import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
|
|
|
+ import { Form,message } from 'ant-design-vue';
|
|
|
+ import { useUserStore } from '/@/store/modules/user';
|
|
|
+ import moment from 'moment';
|
|
|
+ const userStore = useUserStore();
|
|
|
+ const useForm = Form.useForm;
|
|
|
+ export default defineComponent({
|
|
|
+ name: "deliveryNoticeForm",
|
|
|
+ components:{
|
|
|
+ JVxeTable,
|
|
|
+ JFormContainer,
|
|
|
+ BaseShipArchiveAccessoriesModal,
|
|
|
+ SelectPrpductModal,
|
|
|
+ JUpload,
|
|
|
+ SelectProjectModal,
|
|
|
+ JDictSelectTag,
|
|
|
+ JSelectInput,
|
|
|
+ JSelectMultiple,
|
|
|
+ SelectSaleOrderModal
|
|
|
+ },
|
|
|
+ props:{
|
|
|
+ formDisabled:{
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ formData: { type: Object, default: ()=>{} },
|
|
|
+ formBpm: { type: Boolean, default: true }
|
|
|
+ },
|
|
|
+ emits:['success'],
|
|
|
+ setup(props, {emit}) {
|
|
|
+ const loading = ref(false);
|
|
|
+ const formRef = ref();
|
|
|
+ const SelectSaleOrderModalRef = ref();
|
|
|
+ var SelectPrpductModalRef = ref()
|
|
|
+ var SelectProjectModalRef = ref()
|
|
|
+ const deliveryNoticeFormShipTableRef = ref();
|
|
|
+ const deliveryNoticeFormShipTable = reactive<Record<string, any>>({
|
|
|
+ loading: false,
|
|
|
+ columns:deliveryNoticeShipColumns,
|
|
|
+ dataSource: []
|
|
|
+ });
|
|
|
+ const deliveryDetailFormProductTableRef = ref();
|
|
|
+ const deliveryDetailFormProductTable = reactive<Record<string, any>>({
|
|
|
+ loading: false,
|
|
|
+ columns: deliveryNoticeProductColumns,
|
|
|
+ dataSource: []
|
|
|
+ });
|
|
|
+ var SelectShipSModalRef = ref();
|
|
|
+ var BaseShipArchiveAccessoriesListRef = ref();
|
|
|
+ const activeKey = ref('deliveryDetailFormProduct');
|
|
|
+ var notAllowEdit = ref(false);
|
|
|
+ var classOption = ref([]);
|
|
|
+ var customerOption =ref([]);
|
|
|
+ const formData = reactive<Record<string, any>>({
|
|
|
+ id: '',
|
|
|
+ status: undefined,
|
|
|
+ delFlag: undefined,
|
|
|
+ deliveryDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
+ billCode: '',
|
|
|
+ project: '',
|
|
|
+ projectName: '',
|
|
|
+ customer: '',
|
|
|
+ customerName: '',
|
|
|
+ priority: '',
|
|
|
+ productionClass: '',
|
|
|
+ model: '',
|
|
|
+ maker: '',
|
|
|
+ currency:"",
|
|
|
+ deliveryTerms: '',
|
|
|
+ delivery: '',
|
|
|
+ placeDelivery:'',
|
|
|
+ export:'',
|
|
|
+ warrantyPeriod:'',
|
|
|
+ paymentTerms: '',
|
|
|
+ saleDepartment:'',
|
|
|
+ packagingMethod:'',
|
|
|
+ linkman:'',
|
|
|
+ address:'',
|
|
|
+ linkmanPhone:'',
|
|
|
+ salesman: '',
|
|
|
+ FNumber:"",
|
|
|
+ BLNO: '',
|
|
|
+ notes: '',
|
|
|
+ sourceCode:'',
|
|
|
+ });
|
|
|
+
|
|
|
+ //表单验证
|
|
|
+ const validatorRules = reactive({
|
|
|
+ });
|
|
|
+ const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
|
|
|
+ const dbData = {};
|
|
|
+ const formItemLayout = {
|
|
|
+ labelCol: {xs: {span: 24}, sm: {span: 8}},
|
|
|
+ wrapperCol: {xs: {span: 24}, sm: {span: 13}},
|
|
|
+ labelCol1: {xs: {span: 24}, sm: {span: 8}},
|
|
|
+ wrapperCol1: {xs: {span: 24}, sm: {span: 13}},
|
|
|
+ };
|
|
|
+
|
|
|
+ // 表单禁用
|
|
|
+ const disabled = computed(()=>{
|
|
|
+ if(props.formBpm === true){
|
|
|
+ if(props.formData.disabled === false){
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return props.formDisabled;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ //新增方法
|
|
|
+ function add() {
|
|
|
+ resetFields();
|
|
|
+ deliveryNoticeFormShipTable.dataSource = [];
|
|
|
+ deliveryDetailFormProductTable.dataSource = [];
|
|
|
+ activeKey.value = 'deliveryDetailFormProduct'
|
|
|
+ getOptiom()
|
|
|
+ getCustomerOptions()
|
|
|
+ formData.salesman=userStore.getUserInfo.username;
|
|
|
+ formData.saleDepartment = userStore.getUserInfo.orgCode
|
|
|
+ notAllowEdit.value = false
|
|
|
+ }
|
|
|
+ //编辑方法
|
|
|
+ async function edit(row) {
|
|
|
+ //主表数据
|
|
|
+ await queryMainData(row.id);
|
|
|
+ //子表数据
|
|
|
+ const deliveryNoticeFormShipDataList = await querysaleQuotationFormShipListByMainId(row['id']);
|
|
|
+ deliveryNoticeFormShipTable.dataSource = [...deliveryNoticeFormShipDataList];
|
|
|
+ const deliveryDetailFormProductDataList = await querySaleQuotationFormProductListByMainId(row['id']);
|
|
|
+ deliveryDetailFormProductTable.dataSource = [...deliveryDetailFormProductDataList];
|
|
|
+ getOptiom()
|
|
|
+ getCustomerOptions()
|
|
|
+ notAllowEdit.value=true
|
|
|
+ }
|
|
|
+ //获取主表
|
|
|
+ async function queryMainData(id) {
|
|
|
+ const row = await queryDataById(id);
|
|
|
+ resetFields();
|
|
|
+ const tmpData = {};
|
|
|
+ Object.keys(formData).forEach((key) => {
|
|
|
+ if(row.hasOwnProperty(key)){
|
|
|
+ tmpData[key] = row[key]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //赋值
|
|
|
+ Object.assign(formData,tmpData);
|
|
|
+ }
|
|
|
+
|
|
|
+ const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
|
|
+ 'saleQuotationShip': deliveryNoticeFormShipTableRef,
|
|
|
+ 'saleQuotationProduct': deliveryDetailFormProductTableRef,
|
|
|
+ });
|
|
|
+ //获取表单信息
|
|
|
+ async function getFormData() {
|
|
|
+ try {
|
|
|
+ // 触发表单验证
|
|
|
+ await validate();
|
|
|
+ } catch ({ errorFields }) {
|
|
|
+ if (errorFields) {
|
|
|
+ const firstField = errorFields[0];
|
|
|
+ if (firstField) {
|
|
|
+ formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Promise.reject(errorFields);
|
|
|
+ }
|
|
|
+ return transformData(toRaw(formData))
|
|
|
+ }
|
|
|
+ //保存
|
|
|
+ async function submitForm() {
|
|
|
+ if(formData.sourceCode==''){
|
|
|
+ message.warning('请选择供应商报价单')
|
|
|
+ }else{
|
|
|
+ const mainData = await getFormData();
|
|
|
+ const subData = await getSubFormAndTableData();
|
|
|
+ const values = Object.assign({}, dbData, mainData, subData);
|
|
|
+ console.log('表单提交数据', values)
|
|
|
+ const isUpdate = values.id ? true : false
|
|
|
+ const isRevise = values.status=='1' ? true : false
|
|
|
+ await saveOrUpdate(values, isUpdate,isRevise);
|
|
|
+ //关闭弹窗
|
|
|
+ emit('success');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function setFieldsValue(values) {
|
|
|
+ if(values){
|
|
|
+ Object.keys(values).map(k=>{
|
|
|
+ formData[k] = values[k];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 值改变事件触发-树控件回调
|
|
|
+ * @param key
|
|
|
+ * @param value
|
|
|
+ */
|
|
|
+ function handleFormChange(key, value) {
|
|
|
+ formData[key] = value;
|
|
|
+ }
|
|
|
+ //产品明细-删除行
|
|
|
+ async function handleDelete1(prop) {
|
|
|
+ var newArray = [...deliveryDetailFormProductTable.dataSource]
|
|
|
+ newArray.splice(prop.rowIndex, 1)
|
|
|
+ deliveryDetailFormProductTable.dataSource = newArray
|
|
|
+ if( deliveryDetailFormProductTable.dataSource.length!==0){
|
|
|
+ var arr = []
|
|
|
+ deliveryDetailFormProductTable.dataSource.map(item=>{
|
|
|
+ if(item.sourceId){
|
|
|
+ arr.push(item.sourceId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(arr.length==0){
|
|
|
+ formData.sourceCode=''
|
|
|
+ notAllowEdit.value=false
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ formData.sourceCode=''
|
|
|
+ notAllowEdit.value=false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //增行-产品明细
|
|
|
+ function addProduct(data){
|
|
|
+ data.map(item=>{
|
|
|
+ item.productClass = item.classId_dictText
|
|
|
+ item.productCode = item.code
|
|
|
+ // item.unit = item.measurementUnit
|
|
|
+ item.deliveryTime = formData.deliveryTime
|
|
|
+ item.productId = item.id
|
|
|
+ })
|
|
|
+ var arrProduct = data.concat(deliveryDetailFormProductTable.dataSource)
|
|
|
+ deliveryDetailFormProductTable.dataSource=arrProduct
|
|
|
+ }
|
|
|
+ //选择项目
|
|
|
+ function addProject(data) {
|
|
|
+ if(data.length==0){
|
|
|
+ formData.quotationProject =
|
|
|
+ formData.quotationProjectName = ''
|
|
|
+ }else{
|
|
|
+ formData.quotationProject = data[0].id
|
|
|
+ formData.quotationProjectName = data[0].name
|
|
|
+ formData.quotationCustomer =data[0].customerId
|
|
|
+ formData.quotationCustomerName =data[0].customerId_dictText
|
|
|
+ customerOption.value.map(item=>{
|
|
|
+ if(item.value==data[0].customerId){
|
|
|
+ formData.priority =item.priority
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取客户列表
|
|
|
+ function getCustomerOptions(){
|
|
|
+ let params = {pageSize:'-1',status:1}
|
|
|
+ defHttp.get({url:'/cuspCode/cuspCustomerProfile/list',params}, { isTransformResponse: false }).then(res=>{
|
|
|
+ if(res){
|
|
|
+ customerOption.value = []
|
|
|
+ res.result.records.forEach(item=>{
|
|
|
+ customerOption.value.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ priority:item.priority,
|
|
|
+ intermediatorCommission:item.intermediatorCommission
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //查看配件信息
|
|
|
+ function viewAccessory(prop){
|
|
|
+ BaseShipArchiveAccessoriesListRef.value.getTable(prop.row)
|
|
|
+ }
|
|
|
+ //选择产品
|
|
|
+ function selectProducts(){
|
|
|
+ SelectPrpductModalRef.value.getTable()
|
|
|
+ }
|
|
|
+ //选择项目
|
|
|
+ function onSearchProject(){
|
|
|
+ SelectProjectModalRef.value.getTable()
|
|
|
+ }
|
|
|
+ //获取产品分类下拉框
|
|
|
+ function getOptiom(){
|
|
|
+ defHttp
|
|
|
+ .get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ classOption.value = []
|
|
|
+ res.result.records.forEach(element => {
|
|
|
+ var obj = {
|
|
|
+ label: element.name?element.name:'无名称请维护',
|
|
|
+ value: element.id?element.id:''
|
|
|
+ };
|
|
|
+ classOption.value.push( obj)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // loading.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 选择销售订单
|
|
|
+ function selectSaleOrderList(){
|
|
|
+ SelectSaleOrderModalRef.value.getTable(formData)
|
|
|
+ }
|
|
|
+ function addFormSaleOrder(data){
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ deliveryNoticeFormShipTableRef,
|
|
|
+ deliveryNoticeFormShipTable,
|
|
|
+ deliveryDetailFormProductTableRef,
|
|
|
+ deliveryDetailFormProductTable,
|
|
|
+ validatorRules,
|
|
|
+ validateInfos,
|
|
|
+ activeKey,
|
|
|
+ loading,
|
|
|
+ formData,
|
|
|
+ setFieldsValue,
|
|
|
+ handleFormChange,
|
|
|
+ formItemLayout,
|
|
|
+ disabled,
|
|
|
+ getFormData,
|
|
|
+ submitForm,
|
|
|
+ SelectShipSModalRef,
|
|
|
+ add,
|
|
|
+ edit,
|
|
|
+ formRef,
|
|
|
+ addProduct,
|
|
|
+ BaseShipArchiveAccessoriesListRef,
|
|
|
+ viewAccessory,
|
|
|
+ handleDelete1,
|
|
|
+ selectProducts,
|
|
|
+ SelectPrpductModalRef,
|
|
|
+ SelectProjectModalRef,
|
|
|
+ onSearchProject,
|
|
|
+ addProject,
|
|
|
+ getOptiom,
|
|
|
+ classOption,
|
|
|
+ getCustomerOptions,
|
|
|
+ customerOption,
|
|
|
+ notAllowEdit,
|
|
|
+ selectSaleOrderList,
|
|
|
+ SelectSaleOrderModalRef,
|
|
|
+ addFormSaleOrder
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+ /** 时间和数字输入框样式 */
|
|
|
+ :deep(.ant-input-number) {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.ant-calendar-picker) {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ /deep/.vxe-table--body-wrapper{
|
|
|
+ height: 100% !important;
|
|
|
+ }
|
|
|
+ /deep/.ant-modal-body{
|
|
|
+ padding: 24px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.ant-form-item{
|
|
|
+ margin-bottom: 8px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|