|
|
@@ -50,7 +50,7 @@
|
|
|
<el-form-item
|
|
|
label="订单类型"
|
|
|
prop="needProduce"
|
|
|
- >
|
|
|
+ >
|
|
|
<el-radio v-model="form.needProduce" :label="1">生产性订单</el-radio>
|
|
|
<el-radio v-model="form.needProduce" :label="0">库存式订单</el-radio>
|
|
|
</el-form-item>
|
|
|
@@ -111,7 +111,7 @@
|
|
|
<el-form-item
|
|
|
label="计价方式"
|
|
|
prop="pricingWay"
|
|
|
- >
|
|
|
+ >
|
|
|
<el-radio-group v-model="form.pricingWay" @change="changePricingWay" :disabled="!!form.contractId">
|
|
|
<el-radio v-for="item in pricingWayList" :label="item.id">{{ item.name }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
@@ -368,6 +368,8 @@
|
|
|
ref="selectContractRef"
|
|
|
@changeParent="changeContract"
|
|
|
></contractListDialog>
|
|
|
+ <autogenerate-dialog :autogenerate-dialog-flag.sync="autogenerateDialogFlag" ref="autogenerateDialogRef"
|
|
|
+ v-if="autogenerateDialogFlag" @getAutogenerateParams="getAutogenerateParams"></autogenerate-dialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -378,6 +380,7 @@ import inventoryTable from './inventoryTable.vue';
|
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
+import autogenerateDialog from "@/BIZComponents/autogenerateDialog.vue";
|
|
|
import {getDetail} from '@/api/contractManage/contractBook';
|
|
|
import {
|
|
|
getSaleOrderDetail,
|
|
|
@@ -401,7 +404,8 @@ export default {
|
|
|
contractListDialog,
|
|
|
paymentList,
|
|
|
inventoryTable,
|
|
|
- parentList
|
|
|
+ parentList,
|
|
|
+ autogenerateDialog
|
|
|
},
|
|
|
data() {
|
|
|
let formDef = {
|
|
|
@@ -419,8 +423,8 @@ export default {
|
|
|
saleType: '',
|
|
|
saleTypeName: '',
|
|
|
totalAmount: '',
|
|
|
- settlementMode:'4',
|
|
|
- settlementModeName:'分期付款',
|
|
|
+ settlementMode: '4',
|
|
|
+ settlementModeName: '分期付款',
|
|
|
partaUnifiedSocialCreditCode: '',
|
|
|
partbUnifiedSocialCreditCode: '',
|
|
|
partaAddress: '',
|
|
|
@@ -444,6 +448,7 @@ export default {
|
|
|
|
|
|
return {
|
|
|
clearing: false, //是否清除合同
|
|
|
+ autogenerateDialogFlag: false,
|
|
|
payWayOptions: [],
|
|
|
delDetailIds: [],
|
|
|
linkNameOptions: [],
|
|
|
@@ -554,7 +559,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
//选择供应商
|
|
|
- changeSupplier(obj) {
|
|
|
+ async changeSupplier(obj) {
|
|
|
this.form = Object.assign({}, this.form, {
|
|
|
partbId: obj.id,
|
|
|
partbName: obj.name,
|
|
|
@@ -564,7 +569,15 @@ export default {
|
|
|
partbEmail: '',
|
|
|
partbTel: ''
|
|
|
});
|
|
|
- this.getLinkInfo(obj.id);
|
|
|
+ await this.getLinkInfo(obj.id);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let firstLink = this.linkNameOptions.find(item => item.ifChief == 1) || {}
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ partbLinkId: firstLink.id || this.linkNameOptions[0]?.id,
|
|
|
+ partbLinkName: firstLink.linkName || this.linkNameOptions[0]?.linkName,
|
|
|
+ partbTel: firstLink.mobilePhone || this.linkNameOptions[0]?.mobilePhone,
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
//选择合同获取合同的详情
|
|
|
async getDetailData(id) {
|
|
|
@@ -699,7 +712,7 @@ export default {
|
|
|
this.$set(this.form, 'partbEmail', obj.email);
|
|
|
},
|
|
|
//选择客户回调
|
|
|
- changeParent(obj) {
|
|
|
+ async changeParent(obj) {
|
|
|
this.form = Object.assign({}, this.form, {
|
|
|
partaId: obj.id,
|
|
|
partaName: obj.name,
|
|
|
@@ -709,7 +722,15 @@ export default {
|
|
|
partaEmail: '',
|
|
|
partaTel: ''
|
|
|
});
|
|
|
- this.getLinkInfo(obj.id);
|
|
|
+ await this.getLinkInfo(obj.id);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let firstLink = this.linkNameOptions.find(item => item.ifChief == 1) || {}
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ partaLinkId: firstLink.id || this.linkNameOptions[0]?.id,
|
|
|
+ partaLinkName: firstLink.linkName || this.linkNameOptions[0]?.linkName,
|
|
|
+ partaTel: firstLink.mobilePhone || this.linkNameOptions[0]?.mobilePhone,
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
//选择合同回调
|
|
|
@@ -776,7 +797,7 @@ export default {
|
|
|
return data.filter(item => item.dictCode !== 0)
|
|
|
},
|
|
|
//切换计价方式重新算费用
|
|
|
- changePricingWay(){
|
|
|
+ changePricingWay() {
|
|
|
this.$refs.inventoryTable.getTotalPrice()
|
|
|
},
|
|
|
//打开新增编辑弹框
|
|
|
@@ -890,42 +911,41 @@ export default {
|
|
|
saleTypeName: this.getDictValue('销售类型', this.form.saleType)
|
|
|
});
|
|
|
|
|
|
- if (this.isUpdate) {
|
|
|
- UpdateInformation(commitData)
|
|
|
- .then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success('修改成功');
|
|
|
- if (type === 'sub') {
|
|
|
- this.saleOrderSubmit(res);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.cancel();
|
|
|
- this.$emit('done');
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- //this.loading = false;
|
|
|
- });
|
|
|
- } else {
|
|
|
- addInformation(commitData)
|
|
|
- .then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success('新增成功');
|
|
|
- if (type === 'sub') {
|
|
|
- this.saleOrderSubmit(res);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.cancel();
|
|
|
- this.$emit('done');
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- //this.loading = false;
|
|
|
- });
|
|
|
- }
|
|
|
+ this.interfaceCall(commitData,type);
|
|
|
+ // if (type === 'sub') {
|
|
|
+ // this.autogenerateDialogFlag = true
|
|
|
+ // }else {
|
|
|
+ // this.interfaceCall(commitData,type);
|
|
|
+ // }
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
// 表单验证未通过,不执行保存操作
|
|
|
}
|
|
|
},
|
|
|
+ getAutogenerateParams(params){
|
|
|
+ let commitData = Object.assign({}, this.form, {
|
|
|
+ productList: this.$refs.inventoryTable.getTableValue(),
|
|
|
+ saleTypeName: this.getDictValue('销售类型', this.form.saleType),
|
|
|
+ ...params
|
|
|
+ });
|
|
|
+ this.interfaceCall(commitData,'sub');
|
|
|
+ },
|
|
|
+ interfaceCall(commitData,type){
|
|
|
+ let API = this.isUpdate ? UpdateInformation : addInformation;
|
|
|
+ API(commitData).then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ if (type === 'sub') {
|
|
|
+ this.saleOrderSubmit(res);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
saleOrderSubmit(res) {
|
|
|
submit({
|
|
|
businessId: this.businessId || res
|
|
|
@@ -935,6 +955,7 @@ export default {
|
|
|
this.$emit('done');
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
cancel() {
|
|
|
this.$nextTick(() => {
|
|
|
this.activeName = 'base';
|