|
|
@@ -45,19 +45,30 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="12">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="退货单">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :disabled="!!saleOrderData.id"
|
|
|
+ v-model="form.sourceNo"
|
|
|
+ @click.native="handleReturnGoodsBtn"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<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-row>
|
|
|
+
|
|
|
+ <el-row :gutter="12">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="客户联系人" prop="linkName">
|
|
|
<el-input clearable v-model="form.linkName" 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" placeholder="请输入" />
|
|
|
@@ -230,6 +241,14 @@
|
|
|
ref="processSubmitDialogRef"
|
|
|
@reload="reload"
|
|
|
></process-submit-dialog>
|
|
|
+ <!-- 退货单 -->
|
|
|
+ <return-order-dialog
|
|
|
+ :returnOrderDialogFlag.sync="returnOrderDialogFlag"
|
|
|
+ v-if="returnOrderDialogFlag"
|
|
|
+ @changeParent="getSReturnOrderInfo"
|
|
|
+ ref="returnOrderDialogRef"
|
|
|
+ >
|
|
|
+ </return-order-dialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -260,6 +279,10 @@
|
|
|
import { projectsGetByIdAPI } from '@/api/pro';
|
|
|
import { parameterGetByCode } from '@/api/main/index.js';
|
|
|
import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
|
|
|
+ import returnOrderDialog from '@/views/saleManage/saleOrder/customerReturnOrder/returnOrderDialog.vue';
|
|
|
+import {
|
|
|
+ getReturnSaleOrderrecordDetail,
|
|
|
+ } from '@/api/saleManage/returnGoods';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
@@ -275,7 +298,8 @@
|
|
|
parentList,
|
|
|
entrustedReceiveDialog,
|
|
|
stowageTable,
|
|
|
- replaceTable
|
|
|
+ replaceTable,
|
|
|
+ returnOrderDialog
|
|
|
},
|
|
|
|
|
|
//客户管理数据
|
|
|
@@ -317,7 +341,10 @@
|
|
|
trayNum: '',
|
|
|
replaceList: [],
|
|
|
deliveryTypeId: '',
|
|
|
- receiptRequirementTypeId: 2
|
|
|
+ receiptRequirementTypeId: 2,
|
|
|
+ sourceType: '',
|
|
|
+ sourceId: '',
|
|
|
+ sourceNo: ''
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
@@ -335,7 +362,7 @@
|
|
|
activeName: 'first',
|
|
|
formDef,
|
|
|
form: copyObj(formDef),
|
|
|
-
|
|
|
+ returnOrderDialogFlag: false,
|
|
|
rules: {
|
|
|
partaName: [
|
|
|
{ required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
@@ -590,6 +617,196 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ // 选择退货单
|
|
|
+ handleReturnGoodsBtn(e) {
|
|
|
+ if (e.target.nodeName == 'I') {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ carNo: [],
|
|
|
+ deviceName: '',
|
|
|
+ deviceId: '',
|
|
|
+ linkName: '',
|
|
|
+ linkPhone: '',
|
|
|
+ orderNo: '',
|
|
|
+ productList: [],
|
|
|
+ orderId: '',
|
|
|
+ contactId: '',
|
|
|
+ contactName: '',
|
|
|
+ entrustedCode: '',
|
|
|
+ entrustedId: '',
|
|
|
+ sendNoteNo: '',
|
|
|
+ pricingWay: ''
|
|
|
+ });
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue([], true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.returnOrderDialogFlag = true;
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.returnOrderDialogRef.init();
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ // 获取退货单数据
|
|
|
+ async getSReturnOrderInfo(row) {
|
|
|
+ console.log('row~~~~', row)
|
|
|
+ // this.form = Object.assign({}, this.form, {
|
|
|
+ // sourceId: row.id,
|
|
|
+ // sourceNo: row.returnNo,
|
|
|
+ // });
|
|
|
+ const data = await getReturnSaleOrderrecordDetail(row.id);
|
|
|
+ if (data) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let {
|
|
|
+ carNo,
|
|
|
+ returnNo,
|
|
|
+ id,
|
|
|
+ linkName,
|
|
|
+ linkPhone,
|
|
|
+ orderIds,
|
|
|
+ orderNo,
|
|
|
+ contactId,
|
|
|
+ contactName,
|
|
|
+ pricingWay = data?.saleOrder?.pricingWay,
|
|
|
+ partaId,
|
|
|
+ partaName,
|
|
|
+ partaTel,
|
|
|
+ partaLinkName,
|
|
|
+ partaAddress,
|
|
|
+ productList,
|
|
|
+ trayList,
|
|
|
+ trakNoteList,
|
|
|
+ totalAmount,
|
|
|
+ payAmount,
|
|
|
+ projectName,
|
|
|
+ projectId,
|
|
|
+ projectCode,
|
|
|
+ totalPrice,
|
|
|
+ redressProductList,
|
|
|
+ receiveAddress
|
|
|
+ } = data;
|
|
|
+
|
|
|
+ if (redressProductList && redressProductList.length > 0) {
|
|
|
+ productList.push(...redressProductList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (productList && productList.length > 0) {
|
|
|
+ productList.forEach((v) => {
|
|
|
+ v.orderTotalCount = v.totalCount;
|
|
|
+ v.extField = {};
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ // contactId,
|
|
|
+ // contactName,
|
|
|
+ // linkName,
|
|
|
+ // linkPhone,
|
|
|
+ // orderNo,
|
|
|
+ // orderIds: orderIds,
|
|
|
+ carNo: carNo ? carNo.split(',') : [],
|
|
|
+ pricingWay,
|
|
|
+ sourceType: 3,
|
|
|
+ sourceNo: returnNo,
|
|
|
+ sourceId: id,
|
|
|
+ contactId,
|
|
|
+ contactName,
|
|
|
+ // linkName: partaLinkName,
|
|
|
+ // linkPhone: partaTel,
|
|
|
+ orderNo,
|
|
|
+ orderIds,
|
|
|
+ // receiveAddress: receiveAddress || partaAddress,
|
|
|
+ productList,
|
|
|
+ trakNoteList,
|
|
|
+ trayList,
|
|
|
+ totalAmount,
|
|
|
+ totalPrice,
|
|
|
+ payAmount,
|
|
|
+ projectName,
|
|
|
+ projectId,
|
|
|
+ projectSn: projectCode
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ productList.forEach((item, index) => {
|
|
|
+ item['tempId'] = index;
|
|
|
+ item.id = '';
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.oldProductList = JSON.parse(JSON.stringify(productList));
|
|
|
+
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue(productList, true);
|
|
|
+ // this.setReturnData(data);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setReturnData(data) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let {
|
|
|
+ partaId,
|
|
|
+ partaName,
|
|
|
+ partaTel,
|
|
|
+ orderIds,
|
|
|
+ orderNo,
|
|
|
+ partaLinkName,
|
|
|
+ partaAddress,
|
|
|
+ productList,
|
|
|
+ trayList,
|
|
|
+ trakNoteList,
|
|
|
+ totalAmount,
|
|
|
+ payAmount,
|
|
|
+ projectName,
|
|
|
+ projectId,
|
|
|
+ projectCode,
|
|
|
+ totalPrice,
|
|
|
+ receiveAddress
|
|
|
+ } = data;
|
|
|
+ if (productList && productList.length > 0) {
|
|
|
+ productList.forEach((v) => {
|
|
|
+ v.orderTotalCount = v.totalCount;
|
|
|
+ v.extField = {};
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ contactId: partaId,
|
|
|
+ contactName: partaName,
|
|
|
+ linkName: partaLinkName,
|
|
|
+ linkPhone: partaTel,
|
|
|
+ orderNo,
|
|
|
+ orderIds,
|
|
|
+ receiveAddress: receiveAddress || partaAddress,
|
|
|
+ productList,
|
|
|
+ trakNoteList,
|
|
|
+ trayList,
|
|
|
+ totalAmount,
|
|
|
+ totalPrice,
|
|
|
+ payAmount,
|
|
|
+ projectName,
|
|
|
+ projectId,
|
|
|
+ projectSn: projectCode
|
|
|
+ });
|
|
|
+ productList.forEach((item, index) => {
|
|
|
+ item['tempId'] = index;
|
|
|
+ item.id = '';
|
|
|
+ });
|
|
|
+ // this.$refs.inventoryTableref &&
|
|
|
+ // this.$refs.inventoryTableref.putTableValue(productList);
|
|
|
+ this.oldProductList = JSON.parse(JSON.stringify(productList));
|
|
|
+
|
|
|
+ // this.$refs.inventoryTableref &&
|
|
|
+ // this.$refs.inventoryTableref.$refs.productListRef.open(
|
|
|
+ // productList
|
|
|
+ // );
|
|
|
+
|
|
|
+ // this.$refs.taskInfoTableRef &&
|
|
|
+ // this.$refs.taskInfoTableRef.putTableValue(trakNoteList);
|
|
|
+ // this.setAddress();
|
|
|
+ // if (projectId) {
|
|
|
+ // this.getProjectData(projectId);
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ },
|
|
|
//选择受托收货单弹框
|
|
|
handleEntrustedReceive(e) {
|
|
|
if (e.target.nodeName == 'I') {
|