|
|
@@ -12,103 +12,59 @@
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
|
- <headerTitle title="发货信息"></headerTitle>
|
|
|
+ <headerTitle title="退货信息"></headerTitle>
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
- label="选择订单"
|
|
|
- prop="orderNo"
|
|
|
+ label="发货单"
|
|
|
+ prop="sendNo"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
<el-input
|
|
|
clearable
|
|
|
- v-model="form.orderNo"
|
|
|
+ v-model="form.sendNo"
|
|
|
@click.native="handleOrderBtn"
|
|
|
placeholder="请输入"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item
|
|
|
- label="客户名称"
|
|
|
- prop="contactName"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <span>{{form.contactName}}</span>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="客户联系人"
|
|
|
- prop="linkName"
|
|
|
+ label="退货备注"
|
|
|
+ prop="remark"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
<el-input
|
|
|
clearable
|
|
|
- v-model="form.linkName"
|
|
|
+ v-model="form.remark"
|
|
|
+ type="textarea"
|
|
|
placeholder="请输入"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item prop="sendFiles" label="发货附件">
|
|
|
- <fileUpload
|
|
|
- v-model="form.sendFiles"
|
|
|
- module="main"
|
|
|
- :showLib="false"
|
|
|
- :limit="10"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
-
|
|
|
- <el-form-item
|
|
|
- label="车辆号"
|
|
|
- prop="carNo"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.carNo"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <!-- <el-form-item
|
|
|
- label="订单编码"
|
|
|
- prop="orderNo"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <span>{{form.orderNo}}</span>
|
|
|
-
|
|
|
- </el-form-item> -->
|
|
|
|
|
|
-
|
|
|
- <el-form-item
|
|
|
- label="客户电话"
|
|
|
- prop="linkPhone"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.linkPhone"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="客户收货地址"
|
|
|
- prop="receiveAddress"
|
|
|
+ <el-form-item
|
|
|
+ label="客户名称"
|
|
|
+ prop="contactName"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.receiveAddress"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
+ {{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>
|
|
|
|
|
|
@@ -117,49 +73,39 @@
|
|
|
|
|
|
|
|
|
<headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
|
|
|
- <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns" :toolkit="[]" :datasource="form.productList" row-key="id">
|
|
|
- <!-- <template v-slot:toolbar>
|
|
|
- <div class="headbox">
|
|
|
- <span class="amount">总计:{{form.totalAmount}}元</span>
|
|
|
- <span class="amount">应付金额:{{form.payAmount}}元</span>
|
|
|
- </div>
|
|
|
- </template> -->
|
|
|
- <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>
|
|
|
- <template v-slot:remark="{ row }">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="row.remark"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <!-- 操作列 -->
|
|
|
- <template v-slot:action="{ row }">
|
|
|
- <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
|
|
|
- <template v-slot:reference>
|
|
|
- <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
- 删除
|
|
|
- </el-link>
|
|
|
- </template>
|
|
|
- </el-popconfirm>
|
|
|
- </template>
|
|
|
-
|
|
|
- </ele-pro-table>
|
|
|
-
|
|
|
+ <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 @click="cancel">返回</el-button>
|
|
|
</div>
|
|
|
- <orderListDialog ref="orderListDialogRef" @changeParent="changeOrder"></orderListDialog>
|
|
|
+ <sendListDialog ref="sendListDialogRef" @changeParent="changeOrder"></sendListDialog>
|
|
|
+
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -171,12 +117,10 @@ 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 { getDetail} from '@/api/contractManage/contractBook';
|
|
|
-import { getSaleOrderDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/saleorder';
|
|
|
-import { addSendInformation,UpdateSendInformation,getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
|
|
|
-import {getcontactlink} from '@/api/saleManage/businessFollow';
|
|
|
-import {listOrganizations} from '@/api/system/organization';
|
|
|
-import orderListDialog from './orderListDialog.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';
|
|
|
|
|
|
|
|
|
@@ -185,26 +129,24 @@ export default {
|
|
|
components: {
|
|
|
fileUpload,
|
|
|
deptSelect,
|
|
|
- orderListDialog,
|
|
|
+ sendListDialog,
|
|
|
+ inventoryTable,
|
|
|
parentList,
|
|
|
personSelect
|
|
|
},
|
|
|
data() {
|
|
|
let formDef = {
|
|
|
id:'',
|
|
|
- contractId: '',
|
|
|
- sendFiles:[],
|
|
|
- contractName: '',
|
|
|
- receiveAddress:'',
|
|
|
- carNo:'',
|
|
|
- carId:'',
|
|
|
- linkName:'',
|
|
|
- linkPhone:'',
|
|
|
- orderNo:'',
|
|
|
- orderId:''
|
|
|
+ payAmount: '',
|
|
|
+ returnFiles:[],
|
|
|
+ remark:'',
|
|
|
+ sendId:'',
|
|
|
+ sendNo:'',
|
|
|
+ totalAmount:''
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
+
|
|
|
detailData:{},
|
|
|
payWayOptions:[],
|
|
|
delDetailIds:[],
|
|
|
@@ -225,6 +167,10 @@ export default {
|
|
|
partaName: [
|
|
|
{ required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
],
|
|
|
+ payAmount:[
|
|
|
+ {required: true, pattern: numberReg, message: '请输入数字', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+
|
|
|
},
|
|
|
competAnalysisListcolumns: [
|
|
|
|
|
|
@@ -366,9 +312,14 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
-
|
|
|
- allcountAmount(){
|
|
|
- return this.$store.state.order.allcountAmount
|
|
|
+
|
|
|
+ totalAmount(){
|
|
|
+ let allcountAmount=this.$store.state.returnGoods.allcountAmount
|
|
|
+ if(!this.$store.state.isDefaultPayableAmount){
|
|
|
+ this.form.payAmount=allcountAmount
|
|
|
+ }
|
|
|
+
|
|
|
+ return allcountAmount
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -384,29 +335,15 @@ export default {
|
|
|
|
|
|
//选择订单回调
|
|
|
changeOrder(obj){
|
|
|
- this.form = Object.assign({},this.form,{
|
|
|
- orderId: obj.id,
|
|
|
- orderNo: obj.orderNo,
|
|
|
- })
|
|
|
- this.getSaleOrderDetail(obj.id)
|
|
|
+ // this.form = Object.assign({},this.form,{
|
|
|
+ // orderId: obj.orderId,
|
|
|
+ // sendNo: obj.docNo,
|
|
|
+ // sendId:obj.id
|
|
|
+ // })
|
|
|
+ this.getSendSaleOrderDetail(obj.id)
|
|
|
|
|
|
},
|
|
|
- //获取订单详情
|
|
|
- async getSaleOrderDetail(id){
|
|
|
- this.loading = true;
|
|
|
- const data = await getSaleOrderDetail(id);
|
|
|
- this.loading = false;
|
|
|
- console.log(this.form,'9999999')
|
|
|
- if (data) {
|
|
|
- this.$nextTick(()=>{
|
|
|
- let {partaId,partaName,partaTel,orderNo,id,partaLinkName,receiveAddress,productList,totalAmount,payAmount}=data
|
|
|
- this.form =Object.assign({}, this.form,{contactId:partaId,contactName:partaName,linkName:partaLinkName,linkPhone:partaTel,orderNo,orderId:id,receiveAddress,productList,totalAmount,payAmount}) ;
|
|
|
- console.log(this.form,'7777777777777777')
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
//发货单详情
|
|
|
async getSendSaleOrderDetail(id){
|
|
|
@@ -415,61 +352,57 @@ export default {
|
|
|
this.loading = false;
|
|
|
if (data) {
|
|
|
this.$nextTick(()=>{
|
|
|
- this.form = data;
|
|
|
+ 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 getLinkInfo(contactId) {
|
|
|
- const data = await getcontactlink({contactId});
|
|
|
- if(data&&data?.length){
|
|
|
- this.linkNameOptions=data
|
|
|
- }
|
|
|
- },
|
|
|
- selectFocus(){
|
|
|
- if(this.linkNameOptions.length===0){
|
|
|
- return this.$message.error('请先选择名称')
|
|
|
- }
|
|
|
- },
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- handHead(){
|
|
|
-
|
|
|
- let item={
|
|
|
- id:this.form.partbLinkId
|
|
|
+ //获取退货单详情
|
|
|
+ async getReturnSaleOrderrecordDetail(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.$refs.headRef.open(item)
|
|
|
- },
|
|
|
-
|
|
|
+ },
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
//选择订单弹框
|
|
|
handleOrderBtn(){
|
|
|
let item = {
|
|
|
- id: this.form.orderId
|
|
|
+ id: this.form.sendId
|
|
|
}
|
|
|
- this.$refs.orderListDialogRef.open(item)
|
|
|
+ this.$refs.sendListDialogRef.open(item)
|
|
|
},
|
|
|
|
|
|
|
|
|
//打开新增编辑弹框
|
|
|
- async open(type, row,orderId) {
|
|
|
+ async open(type, row,sendId) {
|
|
|
this.title = type==='add'?'新增':'修改';
|
|
|
this.row = row;
|
|
|
this.visible = true;
|
|
|
- if(orderId){
|
|
|
- this.getSaleOrderDetail(orderId)
|
|
|
+ this.$store.commit('returnGoods/clearUserData');
|
|
|
+ if(type==='add'){
|
|
|
+ this.$store.commit('returnGoods/setIsDefaultPayableAmount', false); // 设置标志变量为 false,应付金额将跟随订单金额同步
|
|
|
}
|
|
|
if(row&&row?.id){
|
|
|
- this.getSendSaleOrderDetail(row?.id)
|
|
|
+ this.getReturnSaleOrderrecordDetail(row?.id)
|
|
|
+ }
|
|
|
+ if(sendId){
|
|
|
+ this.getSendSaleOrderDetail(sendId)
|
|
|
}
|
|
|
-
|
|
|
if (type == 'add') {
|
|
|
this.isUpdate = false;
|
|
|
} else {
|
|
|
@@ -515,10 +448,17 @@ export default {
|
|
|
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) {
|
|
|
- UpdateSendInformation(this.form)
|
|
|
+ UpdateReturnInformation(commitData)
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
this.$message.success("修改成功");
|
|
|
@@ -529,7 +469,7 @@ export default {
|
|
|
//this.loading = false;
|
|
|
});
|
|
|
} else {
|
|
|
- addSendInformation(this.form)
|
|
|
+ addReturnInformation(commitData)
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
this.$message.success("新增成功");
|