|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<ele-modal
|
|
|
- custom-class="ele-dialog-form long-dialog-form"
|
|
|
+ custom-class="ele-dialog-form long-dialog-form"
|
|
|
:centered="true"
|
|
|
v-if="visible"
|
|
|
:visible.sync="visible"
|
|
|
@@ -9,122 +9,124 @@
|
|
|
width="80%"
|
|
|
@close="cancel"
|
|
|
>
|
|
|
-
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
-
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
<headerTitle title="退货信息"></headerTitle>
|
|
|
- <el-row>
|
|
|
-
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- label="发货单"
|
|
|
- prop="sendNo"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="发货单"
|
|
|
+ prop="sendNo"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
<el-input
|
|
|
- clearable
|
|
|
- v-model="form.sendNo"
|
|
|
- @click.native="handleOrderBtn"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item
|
|
|
- label="退货备注"
|
|
|
- prop="remark"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.remark"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <el-col :span="12">
|
|
|
+ clearable
|
|
|
+ v-model="form.sendNo"
|
|
|
+ @click.native="handleOrderBtn"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item
|
|
|
- label="客户名称"
|
|
|
- prop="contactName"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- {{form.contactName}}
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item prop="returnFiles" label="退货附件">
|
|
|
- <fileUpload
|
|
|
- v-model="form.returnFiles"
|
|
|
- module="main"
|
|
|
- :showLib="false"
|
|
|
- :limit="10"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-form-item
|
|
|
+ label="退货备注"
|
|
|
+ prop="remark"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.remark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="repliedFiles" label="回执附件">
|
|
|
+ <fileUpload
|
|
|
+ v-model="form.repliedFiles"
|
|
|
+ module="main"
|
|
|
+ :showLib="false"
|
|
|
+ :limit="10"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="客户名称"
|
|
|
+ prop="contactName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ {{ form.contactName }}
|
|
|
+ </el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="returnFiles" label="退货附件">
|
|
|
+ <fileUpload
|
|
|
+ v-model="form.returnFiles"
|
|
|
+ module="main"
|
|
|
+ :showLib="false"
|
|
|
+ :limit="10"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- <headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
|
|
|
- <inventoryTable ref="inventoryTableref" :sendId="form.sendId"></inventoryTable>
|
|
|
- <el-row style="margin-top:20px">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- label="总金额"
|
|
|
- prop="totalPrice"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- {{ totalAmount}}元
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- label="金额"
|
|
|
- prop="payAmount"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.payAmount"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
|
|
|
+ <inventoryTable
|
|
|
+ ref="inventoryTableref"
|
|
|
+ :sendId="form.sendId"
|
|
|
+ ></inventoryTable>
|
|
|
+ <el-row style="margin-top: 20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="总金额"
|
|
|
+ prop="totalPrice"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ {{ totalAmount }}元
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="金额"
|
|
|
+ prop="payAmount"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input clearable v-model="form.payAmount" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
<el-button type="primary" @click="save">保存</el-button>
|
|
|
+ <el-button type="primary" @click="save('sub')">提交</el-button>
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
</div>
|
|
|
- <sendListDialog ref="sendListDialogRef" @changeParent="changeOrder"></sendListDialog>
|
|
|
-
|
|
|
+ <sendListDialog
|
|
|
+ ref="sendListDialogRef"
|
|
|
+ @changeParent="changeOrder"
|
|
|
+ ></sendListDialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { emailReg, phoneReg,numberReg } from 'ele-admin';
|
|
|
-import {acceptUnpackoptions} from '@/enum/dict';
|
|
|
-import fileUpload from '@/components/upload/fileUpload';
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
-import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
-import parentList from '@/views/saleManage/contact/components/parentList.vue'
|
|
|
-import {getReturnTableList, getReturnSaleOrderrecordDetail, UpdateReturnInformation, addReturnInformation,deleteReturnInformation} from '@/api/saleManage/returnGoods';
|
|
|
-import {getSendSaleOrderrecordDetail } from '@/api/saleManage/saleordersendrecord';
|
|
|
-import inventoryTable from './inventoryTable.vue';
|
|
|
-import sendListDialog from './sendListDialog.vue';
|
|
|
-import {copyObj} from '@/utils/util';
|
|
|
+ import { emailReg, phoneReg, numberReg } from 'ele-admin';
|
|
|
+ import { acceptUnpackoptions } from '@/enum/dict';
|
|
|
+ import fileUpload from '@/components/upload/fileUpload';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
+ import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
+ import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
+ import {
|
|
|
+ getReturnSaleOrderrecordDetail,
|
|
|
+ UpdateReturnInformation,
|
|
|
+ addReturnInformation,
|
|
|
+ submit
|
|
|
+ } from '@/api/saleManage/returnGoods';
|
|
|
+ import { getSendSaleOrderrecordDetail } from '@/api/saleManage/saleordersendrecord';
|
|
|
+ import inventoryTable from './inventoryTable.vue';
|
|
|
+ import sendListDialog from './sendListDialog.vue';
|
|
|
+ import { copyObj } from '@/utils/util';
|
|
|
|
|
|
-
|
|
|
-export default {
|
|
|
+ export default {
|
|
|
mixins: [dictMixins],
|
|
|
components: {
|
|
|
fileUpload,
|
|
|
@@ -136,21 +138,21 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
let formDef = {
|
|
|
- id:'',
|
|
|
- payAmount: '',
|
|
|
- returnFiles:[],
|
|
|
- remark:'',
|
|
|
- sendId:'',
|
|
|
- sendNo:'',
|
|
|
- totalAmount:''
|
|
|
- };
|
|
|
-
|
|
|
+ id: '',
|
|
|
+ payAmount: '',
|
|
|
+ returnFiles: [],
|
|
|
+ repliedFiles: [],
|
|
|
+ remark: '',
|
|
|
+ sendId: '',
|
|
|
+ sendNo: '',
|
|
|
+ totalAmount: ''
|
|
|
+ };
|
|
|
+
|
|
|
return {
|
|
|
-
|
|
|
- detailData:{},
|
|
|
- payWayOptions:[],
|
|
|
- delDetailIds:[],
|
|
|
- linkNameOptions:[],
|
|
|
+ detailData: {},
|
|
|
+ payWayOptions: [],
|
|
|
+ delDetailIds: [],
|
|
|
+ linkNameOptions: [],
|
|
|
acceptUnpackoptions,
|
|
|
visible: false,
|
|
|
title: '',
|
|
|
@@ -160,371 +162,386 @@ export default {
|
|
|
form: copyObj(formDef),
|
|
|
tableBankData: [],
|
|
|
tableLinkData: [],
|
|
|
- // 组织机构树形结构数据
|
|
|
- groupTreeData: [],
|
|
|
- groupData:[],
|
|
|
- rules: {
|
|
|
+ // 组织机构树形结构数据
|
|
|
+ groupTreeData: [],
|
|
|
+ groupData: [],
|
|
|
+ rules: {
|
|
|
partaName: [
|
|
|
{ required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
],
|
|
|
- payAmount:[
|
|
|
- {required: true, pattern: numberReg, message: '请输入数字', trigger: 'blur' }
|
|
|
+ payAmount: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ pattern: numberReg,
|
|
|
+ message: '请输入数字',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
]
|
|
|
-
|
|
|
},
|
|
|
competAnalysisListcolumns: [
|
|
|
-
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'index',
|
|
|
- columnKey: 'index',
|
|
|
- align: 'center',
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'productName',
|
|
|
- label: '名称',
|
|
|
- slot: 'productName'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'productCode',
|
|
|
- label: '编码',
|
|
|
- slot: 'productCode'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'productCategoryName',
|
|
|
- label: '类型',
|
|
|
- slot: 'productCategoryName'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 160,
|
|
|
- prop: 'productBrand',
|
|
|
- label: '牌号',
|
|
|
- slot: 'productBrand'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'modelType',
|
|
|
- label: '型号',
|
|
|
- slot: 'modelType'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'specification',
|
|
|
- label: '规格',
|
|
|
- slot: 'specification'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- width: 160,
|
|
|
- prop: 'singlePrice',
|
|
|
- label: '单价',
|
|
|
- slot: 'singlePrice'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'totalCount',
|
|
|
- label: '数量',
|
|
|
- slot: 'totalCount'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'totalPrice',
|
|
|
- label: '销售总金额',
|
|
|
- slot: 'totalPrice',
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.totalPrice+'元'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'measuringUnit',
|
|
|
- label: '计量单位',
|
|
|
- slot: 'measuringUnit'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'deliveryDays',
|
|
|
- label: '交期(天)',
|
|
|
- slot: 'deliveryDays'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'guaranteePeriod',
|
|
|
- label: '质保期',
|
|
|
- slot: 'guaranteePeriod',
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.guaranteePeriod+_row.guaranteePeriodUnitName
|
|
|
- }
|
|
|
- },
|
|
|
- // {
|
|
|
- // width: 120,
|
|
|
- // prop: 'guaranteePeriodUnitCode',
|
|
|
- // label: '',
|
|
|
- // slot: 'guaranteePeriodUnitCode'
|
|
|
- // },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'technicalAnswerName',
|
|
|
- label: '技术答疑人',
|
|
|
- slot: 'technicalAnswerName'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 220,
|
|
|
- prop: 'technicalParams',
|
|
|
- label: '技术参数',
|
|
|
- slot: 'technicalParams'
|
|
|
- },
|
|
|
- {
|
|
|
- width:240,
|
|
|
- prop: 'technicalDrawings',
|
|
|
- label: '技术图纸',
|
|
|
- slot: 'technicalDrawings',
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.guaranteePeriod+_row.guaranteePeriodUnitName
|
|
|
- }
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'index',
|
|
|
+ columnKey: 'index',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'productName',
|
|
|
+ label: '名称',
|
|
|
+ slot: 'productName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '编码',
|
|
|
+ slot: 'productCode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'productCategoryName',
|
|
|
+ label: '类型',
|
|
|
+ slot: 'productCategoryName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'productBrand',
|
|
|
+ label: '牌号',
|
|
|
+ slot: 'productBrand'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'modelType',
|
|
|
+ label: '型号',
|
|
|
+ slot: 'modelType'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ slot: 'specification'
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
- {
|
|
|
- width: 220,
|
|
|
- prop: 'remark',
|
|
|
- label: '备注',
|
|
|
- slot: 'remark'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 120,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- fixed:'right',
|
|
|
- showOverflowTooltip: true
|
|
|
- }
|
|
|
- ],
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'singlePrice',
|
|
|
+ label: '单价',
|
|
|
+ slot: 'singlePrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'totalCount',
|
|
|
+ label: '数量',
|
|
|
+ slot: 'totalCount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'totalPrice',
|
|
|
+ label: '销售总金额',
|
|
|
+ slot: 'totalPrice',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.totalPrice + '元';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'measuringUnit',
|
|
|
+ label: '计量单位',
|
|
|
+ slot: 'measuringUnit'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'deliveryDays',
|
|
|
+ label: '交期(天)',
|
|
|
+ slot: 'deliveryDays'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'guaranteePeriod',
|
|
|
+ label: '质保期',
|
|
|
+ slot: 'guaranteePeriod',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // width: 120,
|
|
|
+ // prop: 'guaranteePeriodUnitCode',
|
|
|
+ // label: '',
|
|
|
+ // slot: 'guaranteePeriodUnitCode'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'technicalAnswerName',
|
|
|
+ label: '技术答疑人',
|
|
|
+ slot: 'technicalAnswerName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 220,
|
|
|
+ prop: 'technicalParams',
|
|
|
+ label: '技术参数',
|
|
|
+ slot: 'technicalParams'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 240,
|
|
|
+ prop: 'technicalDrawings',
|
|
|
+ label: '技术图纸',
|
|
|
+ slot: 'technicalDrawings',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 220,
|
|
|
+ prop: 'remark',
|
|
|
+ label: '备注',
|
|
|
+ slot: 'remark'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ fixed: 'right',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
// 提交状态
|
|
|
loading: false,
|
|
|
// 是否是修改
|
|
|
isUpdate: false,
|
|
|
+ businessId: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
-
|
|
|
- totalAmount(){
|
|
|
- let allcountAmount=this.$store.state.returnGoods.allcountAmount
|
|
|
- if(!this.$store.state.isDefaultPayableAmount){
|
|
|
- this.form.payAmount=allcountAmount
|
|
|
+ totalAmount() {
|
|
|
+ let allcountAmount = this.$store.state.returnGoods.allcountAmount;
|
|
|
+ if (!this.$store.state.isDefaultPayableAmount) {
|
|
|
+ this.form.payAmount = allcountAmount;
|
|
|
}
|
|
|
-
|
|
|
- return allcountAmount
|
|
|
+
|
|
|
+ return allcountAmount;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
methods: {
|
|
|
//删除产品
|
|
|
remove(row) {
|
|
|
- if( this.form.productList.length===1) return this.$message.error('必须要留一个产品')
|
|
|
- let index = this.form.productList.findIndex((n) => n.key == row.key);
|
|
|
- if (index !== -1) {
|
|
|
- this.form.productList.splice(index, 1);
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- //选择订单回调
|
|
|
- changeOrder(obj){
|
|
|
+ if (this.form.productList.length === 1)
|
|
|
+ return this.$message.error('必须要留一个产品');
|
|
|
+ let index = this.form.productList.findIndex((n) => n.key == row.key);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.form.productList.splice(index, 1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //选择订单回调
|
|
|
+ changeOrder(obj) {
|
|
|
// this.form = Object.assign({},this.form,{
|
|
|
// orderId: obj.orderId,
|
|
|
// sendNo: obj.docNo,
|
|
|
// sendId:obj.id
|
|
|
// })
|
|
|
- this.getSendSaleOrderDetail(obj.id)
|
|
|
-
|
|
|
+ this.getSendSaleOrderDetail(obj.id);
|
|
|
},
|
|
|
-
|
|
|
|
|
|
//发货单详情
|
|
|
- async getSendSaleOrderDetail(id){
|
|
|
+ async getSendSaleOrderDetail(id) {
|
|
|
this.loading = true;
|
|
|
const data = await getSendSaleOrderrecordDetail(id);
|
|
|
this.loading = false;
|
|
|
if (data) {
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.form = Object.assign({},this.form,{
|
|
|
- orderId: data.orderId,
|
|
|
- sendNo: data.docNo,
|
|
|
- sendId:data.id,
|
|
|
- contactName:data.contactName
|
|
|
- })
|
|
|
- this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.productList)
|
|
|
- })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ orderId: data.orderId,
|
|
|
+ sendNo: data.docNo,
|
|
|
+ sendId: data.id,
|
|
|
+ contactName: data.contactName
|
|
|
+ });
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue(data.productList);
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
//获取退货单详情
|
|
|
- async getReturnSaleOrderrecordDetail(id){
|
|
|
+ async getReturnSaleOrderrecordDetail(id) {
|
|
|
+ this.businessId = id;
|
|
|
+
|
|
|
this.loading = true;
|
|
|
const data = await getReturnSaleOrderrecordDetail(id);
|
|
|
this.loading = false;
|
|
|
if (data) {
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.form =data
|
|
|
- this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.productList)
|
|
|
- })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form = data;
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue(data.productList);
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//选择订单弹框
|
|
|
- handleOrderBtn(){
|
|
|
- let item = {
|
|
|
- id: this.form.sendId
|
|
|
- }
|
|
|
- this.$refs.sendListDialogRef.open(item)
|
|
|
- },
|
|
|
+ handleOrderBtn() {
|
|
|
+ let item = {
|
|
|
+ id: this.form.sendId
|
|
|
+ };
|
|
|
+ this.$refs.sendListDialogRef.open(item);
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
//打开新增编辑弹框
|
|
|
- async open(type, row,sendId) {
|
|
|
- this.title = type==='add'?'新增':'修改';
|
|
|
+ async open(type, row, sendId) {
|
|
|
+ this.title = type === 'add' ? '新增' : '修改';
|
|
|
this.row = row;
|
|
|
this.visible = true;
|
|
|
this.$store.commit('returnGoods/clearUserData');
|
|
|
- if(type==='add'){
|
|
|
- this.$store.commit('returnGoods/setIsDefaultPayableAmount', false); // 设置标志变量为 false,应付金额将跟随订单金额同步
|
|
|
+ if (type === 'add') {
|
|
|
+ this.$store.commit('returnGoods/setIsDefaultPayableAmount', false); // 设置标志变量为 false,应付金额将跟随订单金额同步
|
|
|
}
|
|
|
- if(row&&row?.id){
|
|
|
- this.getReturnSaleOrderrecordDetail(row?.id)
|
|
|
+ if (row && row?.id) {
|
|
|
+ this.getReturnSaleOrderrecordDetail(row?.id);
|
|
|
}
|
|
|
- if(sendId){
|
|
|
- this.getSendSaleOrderDetail(sendId)
|
|
|
+ if (sendId) {
|
|
|
+ this.getSendSaleOrderDetail(sendId);
|
|
|
}
|
|
|
if (type == 'add') {
|
|
|
this.isUpdate = false;
|
|
|
} else {
|
|
|
this.isUpdate = true;
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- salesmanChange(val, info){
|
|
|
+ salesmanChange(val, info) {
|
|
|
this.otherForm.salesmanName = info.name;
|
|
|
},
|
|
|
- settlementModeChange(info){
|
|
|
+ settlementModeChange(info) {
|
|
|
this.form.settlementModeName = info.dictValue;
|
|
|
},
|
|
|
- ifChiefChange(value, idx){
|
|
|
- if(value === 1){
|
|
|
- this.tableLinkData.forEach(e => e.ifChief = 0);
|
|
|
+ ifChiefChange(value, idx) {
|
|
|
+ if (value === 1) {
|
|
|
+ this.tableLinkData.forEach((e) => (e.ifChief = 0));
|
|
|
this.tableLinkData[idx].ifChief = 1;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
- getValidate() {
|
|
|
+
|
|
|
+ getValidate() {
|
|
|
return Promise.all([
|
|
|
- new Promise((resolve, reject) => {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- reject(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }),
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ this.$refs.inventoryTableref.validateForm((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+ async save(type) {
|
|
|
+ try {
|
|
|
+ await this.getValidate();
|
|
|
+ // 表单验证通过,执行保存操作
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ if (!this.isUpdate) {
|
|
|
+ delete this.form.id;
|
|
|
+ }
|
|
|
+ let productList = this.$refs.inventoryTableref.getTableValue();
|
|
|
+ if (productList.length === 0) {
|
|
|
+ return this.$message.error('至少选择一个退货产品');
|
|
|
+ }
|
|
|
+ this.form.repliedFiles = this.form.repliedFiles || [];
|
|
|
+ this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
|
|
|
+ let commitData = Object.assign({}, this.form, {
|
|
|
+ totalAmount: Number(this.totalAmount),
|
|
|
+ productList
|
|
|
+ });
|
|
|
+
|
|
|
+ if (this.isUpdate) {
|
|
|
+ UpdateReturnInformation(commitData)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ if (type === 'sub') {
|
|
|
+ this.returnSubmit(res);
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
});
|
|
|
- }), new Promise((resolve, reject) => {
|
|
|
- this.$refs.inventoryTableref.validateForm((valid) => {
|
|
|
- if (!valid) {
|
|
|
- reject(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
+ } else {
|
|
|
+ addReturnInformation(commitData)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('新增成功');
|
|
|
+ if (type === 'sub') {
|
|
|
+ this.returnSubmit(res);
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
});
|
|
|
- })
|
|
|
-
|
|
|
- ]);
|
|
|
- },
|
|
|
- async save() {
|
|
|
- try {
|
|
|
- await this.getValidate();
|
|
|
- // 表单验证通过,执行保存操作
|
|
|
- this.loading = true;
|
|
|
-
|
|
|
- if (!this.isUpdate) {
|
|
|
- delete this.form.id;
|
|
|
- }
|
|
|
- let productList=this.$refs.inventoryTableref.getTableValue()
|
|
|
- if(productList.length===0) {
|
|
|
- return this.$message.error('至少选择一个退货产品')
|
|
|
- }
|
|
|
- let commitData=Object.assign({},this.form,{
|
|
|
- totalAmount:Number(this.totalAmount),
|
|
|
- productList
|
|
|
- })
|
|
|
-
|
|
|
- if (this.isUpdate) {
|
|
|
- UpdateReturnInformation(commitData)
|
|
|
- .then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success("修改成功");
|
|
|
- this.cancel();
|
|
|
- this.$emit('done');
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- //this.loading = false;
|
|
|
- });
|
|
|
- } else {
|
|
|
- addReturnInformation(commitData)
|
|
|
- .then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success("新增成功");
|
|
|
- this.cancel();
|
|
|
- this.$emit('done');
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- //this.loading = false;
|
|
|
- });
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log(error)
|
|
|
+ console.log(error);
|
|
|
// 表单验证未通过,不执行保存操作
|
|
|
}
|
|
|
-
|
|
|
+ },
|
|
|
+ returnSubmit(res) {
|
|
|
+ submit({
|
|
|
+ businessId: this.businessId || res
|
|
|
+ // productionSupervisorId
|
|
|
+ }).then((res) => {
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ });
|
|
|
},
|
|
|
cancel() {
|
|
|
this.$nextTick(() => {
|
|
|
this.activeName = 'base';
|
|
|
// 关闭后,销毁所有的表单数据
|
|
|
- this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
|
|
|
- this.$refs['formRef'] && this.$refs['formRef'].resetFields();
|
|
|
+ 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.form = copyObj(this.formDef);
|
|
|
this.visible = false;
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
-.TotalAmount{
|
|
|
- font-size: 16px;
|
|
|
- padding-right: 30px;
|
|
|
-}
|
|
|
+ .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;
|
|
|
+ .headbox {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ .amount {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
-</style>
|
|
|
+</style>
|