| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072 |
- <template>
- <ele-modal
- custom-class="ele-dialog-form long-dialog-form"
- :centered="true"
- v-if="visible"
- :visible.sync="visible"
- :title="title"
- :close-on-click-modal="false"
- :append-to-body="true"
- :fullscreen="fullscreen"
- width="70%"
- @close="cancel"
- >
- <template slot="title">
- <modalTitle
- :title="title"
- @setFullscreen="fullscreen = !fullscreen"
- ></modalTitle>
- </template>
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- class="el-form-box"
- label-width="120px"
- >
- <headerTitle title="收货确认单信息"></headerTitle>
- <el-row :gutter="12">
- <el-col :span="12">
- <el-form-item label="发货单" prop="sendNo">
- <el-input
- clearable
- v-model="form.sendNo"
- @click.native="handleSendOrderBtn"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="repliedFiles" label="回执附件">
- <fileMain v-model="form.repliedFiles"></fileMain>
- <!-- <fileUpload-->
- <!-- v-model="form.repliedFiles"-->
- <!-- module="main"-->
- <!-- :showLib="false"-->
- <!-- :limit="10"-->
- <!-- />-->
- </el-form-item>
- </el-col>
- </el-row>
- <!-- <template v-if="form.sendNo">-->
- <!-- -->
- <!-- </template>-->
- <headerTitle title="发货信息"></headerTitle>
- <el-row :gutter="12">
- <el-col :span="12">
- <el-form-item label="销售订单" prop="orderNo">
- <el-input
- clearable
- v-model="form.orderNo"
- disabled
- @click.native="handleOrderBtn"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="受托收货单">
- <el-input
- clearable
- disabled
- v-model="form.entrustedCode"
- @click.native="handleEntrustedReceive"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="12">
- <el-col :span="12">
- <el-form-item label="客户名称" prop="contactName">
- <el-input v-model="form.contactName" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="客户联系人" prop="linkName">
- <el-input
- clearable
- v-model="form.linkName"
- disabled
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="12">
- <el-col :span="12">
- <el-form-item label="客户电话" prop="linkPhone">
- <el-input
- clearable
- v-model="form.linkPhone"
- disabled
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="收货地址" prop="receiveAddress">
- <el-input
- disabled
- clearable
- v-model="form.receiveAddress"
- placeholder="请输入"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="项目名称" prop="projectName">
- <el-input clearable v-model="form.projectName" :disabled="true" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="sendFiles" label="发货附件">
- <fileMain v-model="form.sendFiles" type="view"></fileMain>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
- <el-tab-pane label="收货产品明细" name="first">
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="columns"
- :toolkit="[]"
- :datasource="form.productList"
- row-key="id"
- >
- <template v-slot:isException="scope">
- <el-select v-model="scope.row.isException" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </template>
- <!-- <template v-slot:action="{ $index }">
- <el-popconfirm
- class="ele-action"
- title="确定要删除吗?"
- @confirm="remove($index)"
- >
- <template v-slot:reference>
- <el-link type="danger" :underline="false" icon="el-icon-delete">
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template> -->
- </ele-pro-table>
- </el-tab-pane>
- <!-- <el-tab-pane label="原产品清单" name="first1">
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="competAnalysisListcolumns"
- :toolkit="[]"
- :datasource="productList"
- row-key="id"
- >
- <template v-slot:technicalDrawings="{ row }">
- <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
- <el-link
- v-for="link in row.technicalDrawings"
- :key="link.id"
- type="primary"
- :underline="false"
- @click="downloadFile(link)"
- >
- {{ link.name }}
- </el-link>
- </div>
- </template>
- </ele-pro-table>
- </el-tab-pane> -->
- <el-tab-pane label="托盘清单" name="second">
- <palletTable ref="palletTableRef" type="view"></palletTable>
- </el-tab-pane>
- <el-tab-pane label="装载车叉车信息" name="third">
- <stowageTable ref="stowageTableRef" dialogType="view"></stowageTable>
- </el-tab-pane>
- <el-tab-pane label="运输清单" name="fourth">
- <taskInfoTable ref="taskInfoTableRef" dialogType="view"></taskInfoTable>
- </el-tab-pane>
- </el-tabs>
- <div slot="footer" class="footer">
- <el-button type="primary" @click="save" v-click-once>保存</el-button>
- <el-button
- type="primary"
- v-if="isNeed_process_is_close"
- @click="save('sub')"
- v-click-once
- >提交</el-button
- >
- <el-button @click="cancel">返回</el-button>
- </div>
- <sendListDialog
- ref="orderListDialogRef"
- @changeParent="changeOrder"
- :contactData="contactData"
- ></sendListDialog>
- <!--出库详情-->
- <outbound-details-dialog
- v-if="outboundDetailsDialogFlag"
- ref="outboundDetailsDialogRef"
- :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
- @saveDate="saveDate"
- ></outbound-details-dialog>
- <process-submit-dialog
- :isNotNeedProcess="false"
- :processSubmitDialogFlag.sync="processSubmitDialogFlag"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="reload"
- ></process-submit-dialog>
- </ele-modal>
- </template>
- <script>
- import { acceptUnpackoptions } from '@/enum/dict';
- import fileUpload from '@/components/upload/fileUpload';
- import dictMixins from '@/mixins/dictMixins';
- import outboundDetailsDialog from '@/views/saleManage/saleOrder/returnGoods/components/outboundDetailsDialog.vue';
- import { getSaleOrderDetail } from '@/api/saleManage/saleorder';
- import taskInfoTable from '../../invoice/components/taskInfoTable.vue';
- import {
- addSendInformation,
- getSendSaleOrderrecordDetailSplit
- } from '@/api/saleManage/saleordersendrecord';
- import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
- import { getcontactlink } from '@/api/saleManage/businessFollow';
- import inventoryTable from '../../invoice/components/inventoryTable.vue';
- import stowageTable from '../../invoice/components/stowageTable.vue';
- import sendListDialog from './sendListDialog.vue';
- import { copyObj } from '@/utils/util';
- import PalletTable from '@/views/saleManage/saleOrder/invoice/components/palletTable.vue';
- import fileMain from '@/components/addDoc/index.vue';
- import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
- import getDynamicsColumns from '@/mixins/getDynamicsColumns';
- import {
- addSendConfirmInformation,
- getSendSaleOrderConfirmDetail,
- getSendSaleOrderConfirmDetailSplit,
- UpdateSendConfirmInformation
- } from '@/api/saleManage/invoiceConfirm';
- import modalTitle from '@/BIZComponents/modalTitle.vue';
- export default {
- mixins: [dictMixins, getDynamicsColumns],
- components: {
- processSubmitDialog,
- fileMain,
- PalletTable,
- sendListDialog,
- taskInfoTable,
- fileUpload,
- inventoryTable,
- stowageTable,
- modalTitle,
- outboundDetailsDialog
- },
- //客户管理数据
- props: {
- contactData: {
- type: Object,
- default: () => {
- return {};
- }
- },
- saleOrderData: {
- type: Object,
- default: () => {
- return {};
- }
- }
- },
- data() {
- let formDef = {
- id: '',
- sendNo: '',
- sendId: '',
- contactId: '',
- contactName: '',
- entrustedCode: '',
- entrustedId: '',
- pricingWay: 1,
- sendFiles: [],
- repliedFiles: [],
- productList: [],
- projectName: '',
- projectId: '',
- receiveAddress: '',
- deviceName: '',
- deviceId: '',
- carNo: '',
- linkName: '',
- linkPhone: '',
- orderNo: '',
- orderId: '',
- replied: 0
- };
- return {
-
- fullscreen: false,
- outboundDetailsDialogFlag: false,
- payWayOptions: [],
- delDetailIds: [],
- linkNameOptions: [],
- productList: [],
- acceptUnpackoptions,
- visible: false,
- entrustedReceiveDialogFlag: false,
- processSubmitDialogFlag: false,
- title: '',
- row: {},
- activeName: 'first',
- formDef,
- options:[
- {value:0,label:'已收货'},
- {value:1,label:'未收货'},
- ],
- qualityStatus: {
- 0: '未质检',
- 1: '已质检'
- }, // 质检状态 0未检 1已检
- qualityResults: {
- 1: '合格',
- 2: '不合格'
- }, // 质检结果 1合格 2不合格
- columns: [
- {
- width: 45,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- fixed: 'left'
- },
- {
- minWidth: 160,
- prop: 'productCode',
- label: '编码',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 120,
- prop: 'productName',
- label: '名称',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 160,
- prop: 'batchNo',
- label: '批次号',
- showOverflowTooltip: true,
- slot: 'batchNo',
- align: 'center'
- },
- {
- minWidth: 160,
- prop: 'barcodes',
- label: '发货条码',
- showOverflowTooltip: true,
- slot: 'barcodes',
- align: 'center'
- },
- {
- minWidth: 120,
- prop: 'materielDesignation',
- label: '物料代号',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 120,
- prop: 'clientCode',
- label: '客户代号',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 120,
- prop: 'engrave',
- label: '刻码',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 160,
- prop: 'packageNo',
- align: 'center',
- label: '包装编码',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'packingQuantity',
- align: 'center',
- label: '包装数量',
- showOverflowTooltip: true
- },
- {
- minWidth: 120,
- prop: 'packingUnit',
- align: 'center',
- label: '包装单位',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'totalCount',
- label: '计量数量',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 150,
- prop: 'measuringUnit',
- label: '计量单位',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- width: 160,
- prop: 'pricingWay',
- label: '计价方式',
- slot: 'pricingWay',
- align: 'center',
- formatter: (row, column) => {
- return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
- }
- },
- {
- width: 100,
- prop: 'singlePrice',
- label: '单价',
- slot: 'singlePrice',
- align: 'center'
- },
- {
- width: 100,
- prop: 'totalPrice',
- label: '合计',
- align: 'center'
- },
- {
- minWidth: 80,
- prop: 'sendTotalWeight',
- label: '重量',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 100,
- prop: 'weightUnit',
- label: '重量单位',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- width: 220,
- prop: 'remark',
- label: '备注',
- slot: 'remark',
- align: 'center'
- },
- {
- width: 120,
- slot: 'isException',
- prop: 'isException',
- label: '收货状态',
- align: 'center',
- fixed: 'right'
- }
- ],
- childrenColumns: [
- {
- width: 45,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- fixed: 'left'
- },
- {
- minWidth: 100,
- prop: 'code',
- label: '编码',
- align: 'center'
- },
- {
- minWidth: 140,
- prop: 'barcodes',
- label: '发货条码',
- align: 'center'
- },
- {
- minWidth: 100,
- prop: 'engrave',
- label: '刻码',
- align: 'center'
- }
- ],
- form: copyObj(formDef),
- tableBankData: [],
- tableLinkData: [],
- // 组织机构树形结构数据
- groupTreeData: [],
- groupData: [],
- rules: {
- sendNo: [
- { required: true, message: '请选择发货单', trigger: 'change' }
- ],
- repliedFiles: [
- { required: true, message: '请上传回执附件', trigger: 'change' }
- ]
- },
- // 提交状态
- loading: false,
- // 是否是修改
- isUpdate: false,
- businessId: ''
- };
- },
- computed: {
- competAnalysisListcolumns() {
- return [
- {
- width: 45,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- fixed: 'left'
- },
- {
- width: 200,
- prop: 'productName',
- label: '名称',
- slot: 'productName',
- align: 'center'
- },
- {
- width: 120,
- prop: 'productCode',
- label: '编码',
- slot: 'productCode',
- align: 'center'
- },
- {
- width: 200,
- prop: 'productCategoryName',
- label: '类型',
- slot: 'productCategoryName',
- align: 'center'
- },
- {
- width: 160,
- prop: 'productBrand',
- label: '牌号',
- slot: 'productBrand',
- align: 'center'
- },
- {
- width: 160,
- prop: 'batchNo',
- label: '批次号',
- slot: 'batchNo',
- align: 'center'
- },
- {
- width: 120,
- prop: 'modelType',
- label: '型号',
- slot: 'modelType',
- align: 'center'
- },
- {
- width: 120,
- prop: 'specification',
- label: '规格',
- slot: 'specification',
- align: 'center'
- },
- {
- width: 200,
- prop: 'customerMark',
- label: '客户代号',
- slot: 'customerMark',
- align: 'center'
- },
- {
- width: 200,
- prop: 'warehouseName',
- label: '仓库名称',
- slot: 'warehouseName',
- align: 'center'
- },
- // {
- // width: 100,
- // prop: 'stockLedger',
- // label: '发货明细',
- // slot: 'stockLedger',
- // align: 'center'
- // },
- {
- width: 120,
- prop: 'sendTotalCount',
- label: '发货数量',
- slot: 'sendTotalCount',
- align: 'center'
- },
- // {
- // width: 120,
- // prop: 'totalCount',
- // label: '实收数量',
- // slot: 'totalCount',
- // align: 'center'
- // },
- {
- width: 120,
- prop: 'measuringUnit',
- label: '计量单位',
- slot: 'measuringUnit',
- align: 'center'
- },
- {
- width: 120,
- prop: 'singleWeight',
- label: '单重',
- slot: 'singleWeight',
- align: 'center'
- },
- {
- width: 100,
- prop: 'receiveTotalWeight',
- label: '收货总重',
- slot: 'receiveTotalWeight',
- align: 'center'
- },
- {
- width: 200,
- prop: 'sendTotalWeight',
- label: '发货总重',
- slot: 'sendTotalWeight',
- align: 'center',
- headerSlot: 'headerTotalCount'
- },
- {
- width: 100,
- prop: 'increaseTotalWeight',
- label: '增重重量',
- slot: 'increaseTotalWeight',
- align: 'center'
- },
- {
- width: 100,
- prop: 'weightUnit',
- label: '重量单位',
- slot: 'weightUnit',
- align: 'center'
- },
- {
- width: 160,
- prop: 'singlePrice',
- label: '单价',
- slot: 'singlePrice',
- align: 'center'
- },
- {
- width: 160,
- prop: 'discountSinglePrice',
- label: '折后单价',
- slot: 'discountSinglePrice',
- align: 'center'
- },
- {
- width: 120,
- prop: 'totalPrice',
- label: '合计',
- slot: 'totalPrice',
- align: 'center'
- },
- {
- width: 120,
- prop: 'discountTotalPrice',
- label: '折后合计',
- slot: 'discountTotalPrice',
- align: 'center'
- },
- ...this.dynamicsColumns,
- {
- width: 120,
- prop: 'deliveryDays',
- label: '交期(天)',
- slot: 'deliveryDays',
- align: 'center'
- },
- {
- width: 200,
- prop: 'guaranteePeriod',
- label: '质保期',
- slot: 'guaranteePeriod',
- formatter: (_row, _column, cellValue) => {
- return (
- (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
- );
- },
- align: 'center'
- },
- // {
- // width: 120,
- // prop: 'guaranteePeriodUnitCode',
- // label: '',
- // slot: 'guaranteePeriodUnitCode'
- // },
- {
- width: 120,
- prop: 'technicalAnswerName',
- label: '技术答疑人',
- slot: 'technicalAnswerName',
- align: 'center'
- },
- {
- width: 220,
- prop: 'technicalParams',
- label: '技术参数',
- slot: 'technicalParams',
- align: 'center'
- },
- {
- width: 240,
- prop: 'technicalDrawings',
- label: '技术图纸',
- slot: 'technicalDrawings',
- formatter: (_row, _column, cellValue) => {
- return (
- (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
- );
- },
- align: 'center'
- },
- {
- width: 220,
- prop: 'remark',
- label: '备注',
- slot: 'remark',
- align: 'center'
- }
- ];
- }
- },
- methods: {
- //选择订单回调
- changeOrder(obj) {
- this.form = Object.assign({}, this.form, {
- sendId: obj.id,
- sendNo: obj.docNo
- });
- this.getSaleOrderDetail(obj.id);
- },
- //发货单详情
- async getSaleOrderDetail(id) {
- this.loading = true;
- const data = await getSendSaleOrderrecordDetailSplit(id);
- this.loading = false;
- if (data) {
- this.form = data;
- this.form.sendId = this.form.id;
- this.form.sendNo = this.form.docNo;
- this.form.docNo = '';
- this.form.id = '';
- this.$refs.taskInfoTableRef &&
- this.$refs.taskInfoTableRef.putTableValue(
- data.logisticTrakListNoteVOList
- );
- this.$refs.stowageTableRef &&
- this.$refs.stowageTableRef.putTableValue(data.carList);
- this.$refs.palletTableRef &&
- this.$refs.palletTableRef.putTableValue(data.trayList);
- this.productList = data.productList;
- this.form.pricingWay = data?.saleOrder?.pricingWay;
- this.form.productList = [];
- this.handleSelectGoods();
- }
- },
- //选择退货明细
- handleSelectGoods(list) {
- this.outboundDetailsDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.outboundDetailsDialogRef.init({...this.form,type:10}, list);
- });
- },
- saveDate(data) {
- console.log(data,'data')
- data.forEach((item) => {
- item['totalCount'] = item.measureQuantity;
- item['qmsResult'] = item.result;
- item['qmsStatus'] = item.status;
- item['sendProductId'] = item.categoryId;
- item['sendTotalWeight'] = item.weight;
-
- this.productList.forEach((val) => {
- if (item.productCode == val.productCode) {
- item['singlePrice'] = val.singlePrice;
- item['clientCode'] = item.clientCode || val.customerMark;
- item['pricingWay'] = item.pricingWay||val.pricingWay || 1;
- if (item.pricingWay == 1) {
- item.totalPrice = item.singlePrice * item.totalCount;
- }
- if (item.pricingWay == 2) {
- item.totalPrice =
- item.singlePrice * item.totalCount * item.sendTotalWeight;
- }
- }
- });
- });
- this.form.productList = data;
- this.form.productList.forEach((item,index)=>{
- this.$set(this.form.productList[index],'isException',0)
- })
- },
- // //发货单确认详情
- async getSendSaleOrderDetail(id) {
- this.businessId = id;
- this.loading = true;
- const data = await getSendSaleOrderConfirmDetail(id);
- this.loading = false;
- if (data) {
- this.$nextTick(() => {
- this.form = data;
- this.form.pricingWay = data?.saleOrder?.pricingWay;
- this.$refs.inventoryTableref &&
- this.$refs.inventoryTableref.putTableValue(data.productList);
- this.$refs.stowageTableRef &&
- this.$refs.stowageTableRef.putTableValue(data.carList);
- this.$refs.taskInfoTableRef &&
- this.$refs.taskInfoTableRef.putTableValue(
- data.logisticTrakListNoteVOList
- );
- this.$refs.palletTableRef &&
- this.$refs.palletTableRef.putTableValue(data.trayList);
- });
- }
- },
- //选择订单弹框
- handleSendOrderBtn(e) {
- if (e.target.nodeName == 'I') {
- this.form = Object.assign({}, this.form, {
- sendId: '',
- sendNo: '',
- contactId: '',
- contactName: '',
- carNo: '',
- deviceName: '',
- deviceId: '',
- linkName: '',
- linkPhone: '',
- orderNo: '',
- orderId: '',
- pricingWay: '',
- receiveAddress: '',
- entrustedCode: '',
- entrustedId: '',
- productList: [],
- sendFiles: [],
- repliedFiles: []
- });
- // this.$refs.inventoryTableref && this.$refs.inventoryTableref.putTableValue([]);
- this.$refs.stowageTableRef &&
- this.$refs.stowageTableRef.putTableValue([]);
- this.$refs.taskInfoTableRef &&
- this.$refs.taskInfoTableRef.putTableValue([]);
- this.$refs.palletTableRef &&
- this.$refs.palletTableRef.putTableValue([]);
- return;
- }
- let item = {
- id: this.form.sendId
- };
- this.$refs.orderListDialogRef.open(item);
- },
- //打开新增编辑弹框
- async open(type, row) {
- this.title = type === 'add' ? '新增收货确认单' : '修改';
- this.row = row;
- this.visible = true;
- if (row && row?.id) {
- await this.getSendSaleOrderDetail(row?.id);
- }
- this.isUpdate = type != 'add';
- },
- totalCountChange(row) {
- if (row.totalCount > row.sendTotalCount) {
- row.totalCount = row.sendTotalCount;
- }
- if (row.totalCount < 0) {
- row.totalCount = 0;
- }
- },
- getValidate() {
- return Promise.all([
- new Promise((resolve, reject) => {
- this.$refs.form.validate((valid) => {
- if (!valid) {
- reject(false);
- } else {
- resolve(true);
- }
- });
- })
- ]).catch((e) => {
- this.$message.warning('有必填项未填写,请检查');
- return Promise.reject(e);
- });
- },
- // 添加
- handlAdd() {
- if (!this.form.sendNo) return this.$message.error('请先选择来源单据');
- this.handleSelectGoods();
- // this.$refs.productListRef.open(this.form.datasource);
- },
- async save(type) {
- try {
- await this.getValidate();
- // 表单验证通过,执行保存操作
- this.loading = true;
- if (!this.isUpdate) {
- delete this.form.id;
- }
- this.form.repliedFiles = this.form.repliedFiles || [];
- this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
- let commitData = Object.assign({}, this.form, {
- trayList: this.$refs.palletTableRef.getTableValue(),
- carList: this.$refs.stowageTableRef.getTableValue(),
- trakNoteList: this.$refs.taskInfoTableRef.getTableValue()
- });
- const API = this.isUpdate
- ? UpdateSendConfirmInformation
- : addSendConfirmInformation;
- API(commitData)
- .then((res) => {
- this.loading = false;
- this.$message.success('修改成功');
- if (type === 'sub') {
- this.sendSubmit(res);
- return;
- }
- this.cancel();
- this.$emit('done');
- })
- .catch((e) => {
- //this.loading = false;
- });
- } catch (error) {
- console.log(error);
- // 表单验证未通过,不执行保存操作
- }
- },
- async sendSubmit(res) {
- const data = await getSendSaleOrderConfirmDetail(
- this.businessId || res
- );
- this.processSubmitDialogFlag = true;
- this.$nextTick(() => {
- let params = {
- businessId: this.businessId || res,
- businessKey: 'sales_sendconfirm_approve',
- formCreateUserId: data.createUserId,
- variables: {
- businessCode: data.docNo
- }
- // callBackMethodType : '1',
- // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
- // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
- // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
- // miniHandle : '',
- // miniView : '',
- };
- this.$refs.processSubmitDialogRef.init(params);
- });
- // submit({
- // businessId: this.businessId || res
- // // productionSupervisorId
- // }).then((res) => {
- // this.cancel();
- // this.$emit('done');
- // });
- },
- remove(index) {
- this.form.productList.splice(index, 1);
- },
- reload() {
- this.cancel();
- this.$emit('done');
- },
- cancel() {
- this.$nextTick(() => {
- this.activeName = 'first';
- // 关闭后,销毁所有的表单数据
- this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
- this.$refs['formRef'] && this.$refs['formRef'].resetFields();
- this.$store.commit('order/clearUserData');
- this.form = copyObj(this.formDef);
- this.visible = false;
- });
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .TotalAmount {
- font-size: 16px;
- padding-right: 30px;
- }
- .headbox {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .amount {
- font-size: 14px;
- font-weight: bold;
- margin-right: 20px;
- }
- }
- </style>
|