|
|
@@ -28,7 +28,13 @@
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-form-item
|
|
|
+ label="生产性订单"
|
|
|
+ prop="needProduce"
|
|
|
+ style="margin-bottom: 22px">
|
|
|
+ <el-radio v-model="form.needProduce" :label="1">是</el-radio>
|
|
|
+ <el-radio v-model="form.needProduce" :label="0">否</el-radio>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item
|
|
|
label="销售部门"
|
|
|
prop="salesDeptId"
|
|
|
@@ -165,7 +171,7 @@
|
|
|
prop="partaFax"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
- <el-input clearable v-model="form.partaFax" placeholder="请输入" />
|
|
|
+ <el-input clearable v-model="form.partaFax" placeholder="请输入"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
label=" 客户Email"
|
|
|
@@ -249,10 +255,10 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="partbTel" label="售出方联系电话">
|
|
|
- <el-input clearable v-model="form.partbTel" placeholder="请输入" />
|
|
|
+ <el-input clearable v-model="form.partbTel" placeholder="请输入"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="partbFax" label="售出方传真">
|
|
|
- <el-input clearable v-model="form.partbFax" placeholder="请输入" />
|
|
|
+ <el-input clearable v-model="form.partbFax" placeholder="请输入"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
|
|
@@ -283,11 +289,11 @@
|
|
|
|
|
|
<headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
|
|
|
|
|
|
- <inventoryTable ref="inventoryTable"></inventoryTable>
|
|
|
+ <inventoryTable ref="inventoryTable" :isContractId='!!form.contractId'></inventoryTable>
|
|
|
<el-row style="margin-top: 20px">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
- label="金额"
|
|
|
+ label="优惠总金额"
|
|
|
prop="payAmount"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
@@ -343,499 +349,501 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { emailReg, numberReg } from 'ele-admin';
|
|
|
- // import inventoryTable from './inventoryTable.vue';
|
|
|
- import inventoryTable from '@/views/bpm/handleTask/components/contractBook/inventoryTable.vue';
|
|
|
+import {emailReg, numberReg} from 'ele-admin';
|
|
|
+// import inventoryTable from './inventoryTable.vue';
|
|
|
+import inventoryTable from '@/views/bpm/handleTask/components/contractBook/inventoryTable.vue';
|
|
|
|
|
|
- import fileUpload from '@/components/upload/fileUpload';
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
- import parentList from '@/views//bpm/handleTask/components/quotation/parentList.vue';
|
|
|
- import {
|
|
|
- getDetail,
|
|
|
- enterprisePage
|
|
|
- } from '@/api/bpm/components/contractManage/contractBook';
|
|
|
- import { getSaleOrderDetail } from '@/api/bpm/components/saleManage/saleorder';
|
|
|
- import { getcontactlink } from '@/api/bpm/components/saleManage/businessOpportunity.js';
|
|
|
- import headList from '@/components/headList';
|
|
|
- import contractListDialog from './contractListDialog.vue';
|
|
|
- import { listOrganizations } from '@/api/system/organization';
|
|
|
- import { copyObj } from '@/utils/util';
|
|
|
+import fileUpload from '@/components/upload/fileUpload';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import parentList from '@/views//bpm/handleTask/components/quotation/parentList.vue';
|
|
|
+import {
|
|
|
+ getDetail,
|
|
|
+ enterprisePage
|
|
|
+} from '@/api/bpm/components/contractManage/contractBook';
|
|
|
+import {getSaleOrderDetail} from '@/api/bpm/components/saleManage/saleorder';
|
|
|
+import {getcontactlink} from '@/api/bpm/components/saleManage/businessOpportunity.js';
|
|
|
+import headList from '@/components/headList';
|
|
|
+import contractListDialog from './contractListDialog.vue';
|
|
|
+import {listOrganizations} from '@/api/system/organization';
|
|
|
+import {copyObj} from '@/utils/util';
|
|
|
|
|
|
- export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- components: {
|
|
|
- fileUpload,
|
|
|
- headList,
|
|
|
- contractListDialog,
|
|
|
- inventoryTable,
|
|
|
- parentList
|
|
|
- },
|
|
|
- props: {
|
|
|
- businessId: {
|
|
|
- default: ''
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- let formDef = {
|
|
|
- id: '',
|
|
|
- contractId: '',
|
|
|
- orderFiles: [],
|
|
|
- contractName: '',
|
|
|
- deliveryDate: '',
|
|
|
- payAmount: '',
|
|
|
- projectName: '',
|
|
|
- projectId: '',
|
|
|
- receiveAddress: '',
|
|
|
- remark: '',
|
|
|
- saleType: '',
|
|
|
- saleTypeName: '',
|
|
|
- totalAmount: '',
|
|
|
+export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ fileUpload,
|
|
|
+ headList,
|
|
|
+ contractListDialog,
|
|
|
+ inventoryTable,
|
|
|
+ parentList
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ businessId: {
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ let formDef = {
|
|
|
+ id: '',
|
|
|
+ contractId: '',
|
|
|
+ orderFiles: [],
|
|
|
+ contractName: '',
|
|
|
+ deliveryDate: '',
|
|
|
+ payAmount: '',
|
|
|
+ projectName: '',
|
|
|
+ projectId: '',
|
|
|
+ receiveAddress: '',
|
|
|
+ remark: '',
|
|
|
+ saleType: '',
|
|
|
+ saleTypeName: '',
|
|
|
+ totalAmount: '',
|
|
|
|
|
|
- partaUnifiedSocialCreditCode: '',
|
|
|
- partbUnifiedSocialCreditCode: '',
|
|
|
- partaAddress: '',
|
|
|
- partaEmail: '',
|
|
|
- partaFax: '',
|
|
|
- partaId: '',
|
|
|
- partaLinkId: '',
|
|
|
- partaLinkName: '',
|
|
|
- partaName: '',
|
|
|
- partaTel: '',
|
|
|
- partbAddress: '',
|
|
|
- partbEmail: '',
|
|
|
- partbFax: '',
|
|
|
- partbId: '',
|
|
|
- partbLinkId: '',
|
|
|
- partbLinkName: '',
|
|
|
- partbName: '',
|
|
|
- partbTel: '',
|
|
|
- settlementMode: '',
|
|
|
- settlementModeName: ''
|
|
|
- };
|
|
|
+ partaUnifiedSocialCreditCode: '',
|
|
|
+ partbUnifiedSocialCreditCode: '',
|
|
|
+ partaAddress: '',
|
|
|
+ partaEmail: '',
|
|
|
+ partaFax: '',
|
|
|
+ partaId: '',
|
|
|
+ partaLinkId: '',
|
|
|
+ partaLinkName: '',
|
|
|
+ partaName: '',
|
|
|
+ partaTel: '',
|
|
|
+ partbAddress: '',
|
|
|
+ partbEmail: '',
|
|
|
+ partbFax: '',
|
|
|
+ partbId: '',
|
|
|
+ partbLinkId: '',
|
|
|
+ partbLinkName: '',
|
|
|
+ partbName: '',
|
|
|
+ partbTel: '',
|
|
|
+ settlementMode: '',
|
|
|
+ settlementModeName: '',
|
|
|
+ needProduce: 1,
|
|
|
+ };
|
|
|
|
|
|
- return {
|
|
|
- clearing: false, //是否清除合同
|
|
|
- payWayOptions: [],
|
|
|
- delDetailIds: [],
|
|
|
- linkNameOptions: [],
|
|
|
- visible: false,
|
|
|
- title: '',
|
|
|
- row: {},
|
|
|
- activeName: 'base',
|
|
|
- formDef,
|
|
|
- form: copyObj(formDef),
|
|
|
- tableBankData: [],
|
|
|
- tableLinkData: [],
|
|
|
- // 组织机构树形结构数据
|
|
|
- groupTreeData: [],
|
|
|
- groupData: [],
|
|
|
- rules: {
|
|
|
- // deliveryDate: [
|
|
|
- // { required: true, message: '请选择交货日期', trigger: 'change' }
|
|
|
- // ],
|
|
|
- settlementMode: [
|
|
|
- { required: true, message: '请选择结算方式', trigger: 'change' }
|
|
|
- ],
|
|
|
+ return {
|
|
|
+ clearing: false, //是否清除合同
|
|
|
+ payWayOptions: [],
|
|
|
+ delDetailIds: [],
|
|
|
+ linkNameOptions: [],
|
|
|
+ visible: false,
|
|
|
+ title: '',
|
|
|
+ row: {},
|
|
|
+ activeName: 'base',
|
|
|
+ formDef,
|
|
|
+ form: copyObj(formDef),
|
|
|
+ tableBankData: [],
|
|
|
+ tableLinkData: [],
|
|
|
+ // 组织机构树形结构数据
|
|
|
+ groupTreeData: [],
|
|
|
+ groupData: [],
|
|
|
+ rules: {
|
|
|
+ // deliveryDate: [
|
|
|
+ // { required: true, message: '请选择交货日期', trigger: 'change' }
|
|
|
+ // ],
|
|
|
+ settlementMode: [
|
|
|
+ {required: true, message: '请选择结算方式', trigger: 'change'}
|
|
|
+ ],
|
|
|
|
|
|
- saleType: [
|
|
|
- { required: true, message: '请选择销售类型', trigger: 'change' }
|
|
|
- ],
|
|
|
+ saleType: [
|
|
|
+ {required: true, message: '请选择销售类型', trigger: 'change'}
|
|
|
+ ],
|
|
|
|
|
|
- partaName: [
|
|
|
- { required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
- ],
|
|
|
- partaLinkName: [
|
|
|
- { required: true, message: '请选择客户联系人', trigger: 'change' }
|
|
|
- ],
|
|
|
- acceptUnpack: [
|
|
|
- { required: true, message: '请选择是否接受', trigger: 'change' }
|
|
|
- ],
|
|
|
- partaTel: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- pattern: numberReg,
|
|
|
- message: '请输入客户联系电话',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
+ partaName: [
|
|
|
+ {required: true, message: '请选择客户名称', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ partaLinkName: [
|
|
|
+ {required: true, message: '请选择客户联系人', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ acceptUnpack: [
|
|
|
+ {required: true, message: '请选择是否接受', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ partaTel: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ pattern: numberReg,
|
|
|
+ message: '请输入客户联系电话',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
|
|
|
- partbName: [
|
|
|
- { required: true, message: '请输入售出方名称', trigger: 'change' }
|
|
|
- ],
|
|
|
- partbLinkName: [
|
|
|
- { required: true, message: '请输入售出方联系人', trigger: 'change' }
|
|
|
- ],
|
|
|
- partbTel: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- pattern: numberReg,
|
|
|
- message: '请输入售出方联系电话',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- partaEmail: [
|
|
|
- { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
|
|
|
- ]
|
|
|
- },
|
|
|
+ partbName: [
|
|
|
+ {required: true, message: '请输入售出方名称', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ partbLinkName: [
|
|
|
+ {required: true, message: '请输入售出方联系人', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ partbTel: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ pattern: numberReg,
|
|
|
+ message: '请输入售出方联系电话',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ partaEmail: [
|
|
|
+ {pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur'}
|
|
|
+ ]
|
|
|
+ },
|
|
|
|
|
|
- // 提交状态
|
|
|
- loading: false,
|
|
|
- // 是否是修改
|
|
|
- isUpdate: false,
|
|
|
- enterprisePage: []
|
|
|
- };
|
|
|
+ // 提交状态
|
|
|
+ loading: false,
|
|
|
+ // 是否是修改
|
|
|
+ isUpdate: false,
|
|
|
+ enterprisePage: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ allcountAmount() {
|
|
|
+ this.form.payAmount = this.$store.state.order.allcountAmount;
|
|
|
+ return this.$store.state.order.allcountAmount;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ await this.getGroupAll();
|
|
|
+ await this.getEnterprisePage();
|
|
|
+ await this.getSaleOrderDetail(this.businessId);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 选择负责人部门
|
|
|
+ change_principalDep(id) {
|
|
|
+ const info = this.groupData.find((e) => e.id == id);
|
|
|
+ this.form.salesDeptName = info.name;
|
|
|
},
|
|
|
- computed: {
|
|
|
- allcountAmount() {
|
|
|
- return this.$store.state.order.allcountAmount;
|
|
|
- }
|
|
|
+ // 获取公司数据
|
|
|
+ getGroupAll() {
|
|
|
+ listOrganizations().then((list) => {
|
|
|
+ this.groupData = list;
|
|
|
+ this.groupTreeData = this.$util.toTreeData({
|
|
|
+ data: list,
|
|
|
+ idField: 'id',
|
|
|
+ parentIdField: 'parentId'
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
- async created() {
|
|
|
- await this.getGroupAll();
|
|
|
- await this.getEnterprisePage();
|
|
|
- await this.getSaleOrderDetail(this.businessId);
|
|
|
+ listFormatte(data) {
|
|
|
+ return data.filter((item) => item.dictCode !== 0);
|
|
|
},
|
|
|
- methods: {
|
|
|
- // 选择负责人部门
|
|
|
- change_principalDep(id) {
|
|
|
- const info = this.groupData.find((e) => e.id == id);
|
|
|
- this.form.salesDeptName = info.name;
|
|
|
- },
|
|
|
- // 获取公司数据
|
|
|
- getGroupAll() {
|
|
|
- listOrganizations().then((list) => {
|
|
|
- this.groupData = list;
|
|
|
- this.groupTreeData = this.$util.toTreeData({
|
|
|
- data: list,
|
|
|
- idField: 'id',
|
|
|
- parentIdField: 'parentId'
|
|
|
+ //选择供应商
|
|
|
+ changeSupplier(obj) {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ partbId: obj.id,
|
|
|
+ partbName: obj.name,
|
|
|
+ partbAddress: obj.addressName + obj.address,
|
|
|
+ partbLinkId: '',
|
|
|
+ partbLinkName: '',
|
|
|
+ partbEmail: '',
|
|
|
+ partbTel: ''
|
|
|
+ });
|
|
|
+ this.getLinkInfo(obj.id);
|
|
|
+ },
|
|
|
+ //选择合同获取合同的详情
|
|
|
+ async getDetailData(id) {
|
|
|
+ this.loading = true;
|
|
|
+ const data = await getDetail(id);
|
|
|
+ this.loading = false;
|
|
|
+ if (data) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let {contractVO} = data;
|
|
|
+ // this.form=contractVOform.receiveAddress
|
|
|
+ let {
|
|
|
+ partaAddress,
|
|
|
+ partaEmail,
|
|
|
+ partaFax,
|
|
|
+ partaId,
|
|
|
+ partaLinkId,
|
|
|
+ partaLinkName,
|
|
|
+ partaName,
|
|
|
+ partaTel,
|
|
|
+ partbAddress,
|
|
|
+ partbEmail,
|
|
|
+ partbFax,
|
|
|
+ partbId,
|
|
|
+ partbLinkId,
|
|
|
+ partbLinkName,
|
|
|
+ partbName,
|
|
|
+ partbTel,
|
|
|
+ totalPrice,
|
|
|
+ discountTotalPrice,
|
|
|
+ partaUnifiedSocialCreditCode,
|
|
|
+ partbUnifiedSocialCreditCode,
|
|
|
+ settlementMode,
|
|
|
+ settlementModeName
|
|
|
+ } = contractVO;
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ partaAddress,
|
|
|
+ partaEmail,
|
|
|
+ partaFax,
|
|
|
+ partaId,
|
|
|
+ partaLinkId,
|
|
|
+ partaLinkName,
|
|
|
+ partaName,
|
|
|
+ partaTel,
|
|
|
+ partbAddress,
|
|
|
+ partbEmail,
|
|
|
+ partbFax,
|
|
|
+ partbId,
|
|
|
+ partbLinkId,
|
|
|
+ partbLinkName,
|
|
|
+ partbName,
|
|
|
+ partbTel,
|
|
|
+ totalPrice,
|
|
|
+ discountTotalPrice,
|
|
|
+ partaUnifiedSocialCreditCode,
|
|
|
+ partbUnifiedSocialCreditCode,
|
|
|
+ totalAmount: totalPrice,
|
|
|
+ payAmount: discountTotalPrice,
|
|
|
+ receiveAddress: partaAddress,
|
|
|
+ settlementMode,
|
|
|
+ settlementModeName
|
|
|
});
|
|
|
+ this.getLinkInfo(partaId);
|
|
|
+ this.$refs.inventoryTable &&
|
|
|
+ this.$refs.inventoryTable.putTableValue(data);
|
|
|
+ this.$store.commit('order/setAllcountAmount', totalPrice);
|
|
|
});
|
|
|
- },
|
|
|
- listFormatte(data) {
|
|
|
- return data.filter((item) => item.dictCode !== 0);
|
|
|
- },
|
|
|
- //选择供应商
|
|
|
- changeSupplier(obj) {
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- partbId: obj.id,
|
|
|
- partbName: obj.name,
|
|
|
- partbAddress: obj.addressName + obj.address,
|
|
|
- partbLinkId: '',
|
|
|
- partbLinkName: '',
|
|
|
- partbEmail: '',
|
|
|
- partbTel: ''
|
|
|
- });
|
|
|
- this.getLinkInfo(obj.id);
|
|
|
- },
|
|
|
- //选择合同获取合同的详情
|
|
|
- async getDetailData(id) {
|
|
|
- this.loading = true;
|
|
|
- const data = await getDetail(id);
|
|
|
- this.loading = false;
|
|
|
- if (data) {
|
|
|
- this.$nextTick(() => {
|
|
|
- let { contractVO } = data;
|
|
|
- // this.form=contractVOform.receiveAddress
|
|
|
- let {
|
|
|
- partaAddress,
|
|
|
- partaEmail,
|
|
|
- partaFax,
|
|
|
- partaId,
|
|
|
- partaLinkId,
|
|
|
- partaLinkName,
|
|
|
- partaName,
|
|
|
- partaTel,
|
|
|
- partbAddress,
|
|
|
- partbEmail,
|
|
|
- partbFax,
|
|
|
- partbId,
|
|
|
- partbLinkId,
|
|
|
- partbLinkName,
|
|
|
- partbName,
|
|
|
- partbTel,
|
|
|
- totalPrice,
|
|
|
- discountTotalPrice,
|
|
|
- partaUnifiedSocialCreditCode,
|
|
|
- partbUnifiedSocialCreditCode,
|
|
|
- settlementMode,
|
|
|
- settlementModeName
|
|
|
- } = contractVO;
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- partaAddress,
|
|
|
- partaEmail,
|
|
|
- partaFax,
|
|
|
- partaId,
|
|
|
- partaLinkId,
|
|
|
- partaLinkName,
|
|
|
- partaName,
|
|
|
- partaTel,
|
|
|
- partbAddress,
|
|
|
- partbEmail,
|
|
|
- partbFax,
|
|
|
- partbId,
|
|
|
- partbLinkId,
|
|
|
- partbLinkName,
|
|
|
- partbName,
|
|
|
- partbTel,
|
|
|
- totalPrice,
|
|
|
- discountTotalPrice,
|
|
|
- partaUnifiedSocialCreditCode,
|
|
|
- partbUnifiedSocialCreditCode,
|
|
|
- totalAmount: totalPrice,
|
|
|
- payAmount: discountTotalPrice,
|
|
|
- receiveAddress: partaAddress,
|
|
|
- settlementMode,
|
|
|
- settlementModeName
|
|
|
- });
|
|
|
- this.getLinkInfo(partaId);
|
|
|
- this.$refs.inventoryTable &&
|
|
|
- this.$refs.inventoryTable.putTableValue(data);
|
|
|
- this.$store.commit('order/setAllcountAmount', totalPrice);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- //获取订单详情
|
|
|
- async getSaleOrderDetail(id) {
|
|
|
- this.loading = true;
|
|
|
- const data = await getSaleOrderDetail(id);
|
|
|
- this.loading = false;
|
|
|
- if (data) {
|
|
|
- this.$nextTick(() => {
|
|
|
- data.saleType=+data.saleType
|
|
|
- this.form = data;
|
|
|
- this.$refs.inventoryTable &&
|
|
|
- this.$refs.inventoryTable.putTableValue(data);
|
|
|
- this.getLinkInfo(data.partaId);
|
|
|
- this.$store.commit('order/setAllcountAmount', data.totalAmount);
|
|
|
- this.$store.commit('order/setContractId', data.contractId);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- //更新联系人数据
|
|
|
- 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('请先选择名称');
|
|
|
- }
|
|
|
- },
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- //选择下拉框
|
|
|
- onchangeLink(selectedOptions) {
|
|
|
- const option = this.linkNameOptions.find(
|
|
|
- (opt) => opt.id === selectedOptions
|
|
|
- );
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- partaEmail: option?.email,
|
|
|
- partaLinkName: option?.linkName || '',
|
|
|
- partaTel: option?.mobilePhone || option?.phone || '',
|
|
|
- partaLinkId: option?.id
|
|
|
+ //获取订单详情
|
|
|
+ async getSaleOrderDetail(id) {
|
|
|
+ this.loading = true;
|
|
|
+ const data = await getSaleOrderDetail(id);
|
|
|
+ this.loading = false;
|
|
|
+ if (data) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ data.saleType = +data.saleType
|
|
|
+ this.form = data;
|
|
|
+ this.$refs.inventoryTable &&
|
|
|
+ this.$refs.inventoryTable.putTableValue(data);
|
|
|
+ this.getLinkInfo(data.partaId);
|
|
|
+ this.$store.commit('order/setAllcountAmount', data.totalAmount);
|
|
|
+ this.$store.commit('order/setContractId', data.contractId);
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- handHead() {
|
|
|
- let item = {
|
|
|
- id: this.form.partbLinkId
|
|
|
- };
|
|
|
- this.$refs.headRef.open(item);
|
|
|
- },
|
|
|
+ //更新联系人数据
|
|
|
+ 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('请先选择名称');
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- //选择售出方人回调
|
|
|
- changePersonel(obj) {
|
|
|
- this.$set(this.form, 'partbLinkId', obj.id);
|
|
|
- this.$set(this.form, 'partbLinkName', obj.name);
|
|
|
- this.$set(this.form, 'partbTel', obj.phone);
|
|
|
- this.$set(this.form, 'partbEmail', obj.email);
|
|
|
- },
|
|
|
- //选择客户回调
|
|
|
- changeParent(obj) {
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- partaId: obj.id,
|
|
|
- partaName: obj.name,
|
|
|
- partaAddress: obj.addressName + obj.address,
|
|
|
- partaLinkId: '',
|
|
|
- partaLinkName: '',
|
|
|
- partaEmail: '',
|
|
|
- partaTel: ''
|
|
|
- });
|
|
|
- this.getLinkInfo(obj.id);
|
|
|
- },
|
|
|
+ //选择下拉框
|
|
|
+ onchangeLink(selectedOptions) {
|
|
|
+ const option = this.linkNameOptions.find(
|
|
|
+ (opt) => opt.id === selectedOptions
|
|
|
+ );
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ partaEmail: option?.email,
|
|
|
+ partaLinkName: option?.linkName || '',
|
|
|
+ partaTel: option?.mobilePhone || option?.phone || '',
|
|
|
+ partaLinkId: option?.id
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- //选择合同回调
|
|
|
- changeContract(obj) {
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- contractId: obj.id,
|
|
|
- contractName: obj.contractName,
|
|
|
- contractNo: obj.contractNo
|
|
|
- });
|
|
|
- this.getDetailData(obj.id);
|
|
|
- this.$store.commit('order/setContractId', obj.id);
|
|
|
- },
|
|
|
+ handHead() {
|
|
|
+ let item = {
|
|
|
+ id: this.form.partbLinkId
|
|
|
+ };
|
|
|
+ this.$refs.headRef.open(item);
|
|
|
+ },
|
|
|
|
|
|
- //选择合同弹框
|
|
|
- handleContractBtn() {
|
|
|
- console.log('5556666');
|
|
|
- if (this.clearing) return;
|
|
|
- let item = {
|
|
|
- id: this.form.contractId
|
|
|
- };
|
|
|
- this.$refs.selectContractRef.open(item);
|
|
|
- },
|
|
|
- //清除合同
|
|
|
- clearContrcat() {
|
|
|
- this.clearing = true;
|
|
|
- let {
|
|
|
- id,
|
|
|
- projectName,
|
|
|
- saleType,
|
|
|
- saleTypeName,
|
|
|
- deliveryDate,
|
|
|
- orderFiles,
|
|
|
- remark
|
|
|
- } = this.form;
|
|
|
- this.form = Object.assign({}, copyObj(this.formDef), {
|
|
|
- id,
|
|
|
- projectName,
|
|
|
- saleType:+saleType,
|
|
|
- saleTypeName,
|
|
|
- deliveryDate,
|
|
|
- orderFiles,
|
|
|
- remark
|
|
|
- });
|
|
|
+ //选择售出方人回调
|
|
|
+ changePersonel(obj) {
|
|
|
+ this.$set(this.form, 'partbLinkId', obj.id);
|
|
|
+ this.$set(this.form, 'partbLinkName', obj.name);
|
|
|
+ this.$set(this.form, 'partbTel', obj.phone);
|
|
|
+ this.$set(this.form, 'partbEmail', obj.email);
|
|
|
+ },
|
|
|
+ //选择客户回调
|
|
|
+ changeParent(obj) {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ partaId: obj.id,
|
|
|
+ partaName: obj.name,
|
|
|
+ partaAddress: obj.addressName + obj.address,
|
|
|
+ partaLinkId: '',
|
|
|
+ partaLinkName: '',
|
|
|
+ partaEmail: '',
|
|
|
+ partaTel: ''
|
|
|
+ });
|
|
|
+ this.getLinkInfo(obj.id);
|
|
|
+ },
|
|
|
|
|
|
- this.$store.commit('order/setContractId', '');
|
|
|
- this.$store.commit('order/setAllcountAmount', 0);
|
|
|
- this.$refs.inventoryTable.putTableValue([]);
|
|
|
+ //选择合同回调
|
|
|
+ changeContract(obj) {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ contractId: obj.id,
|
|
|
+ contractName: obj.contractName,
|
|
|
+ contractNo: obj.contractNo
|
|
|
+ });
|
|
|
+ this.getDetailData(obj.id);
|
|
|
+ this.$store.commit('order/setContractId', obj.id);
|
|
|
+ },
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
- this.clearing = false;
|
|
|
- }, 500);
|
|
|
- },
|
|
|
+ //选择合同弹框
|
|
|
+ handleContractBtn() {
|
|
|
+ console.log('5556666');
|
|
|
+ if (this.clearing) return;
|
|
|
+ let item = {
|
|
|
+ id: this.form.contractId
|
|
|
+ };
|
|
|
+ this.$refs.selectContractRef.open(item);
|
|
|
+ },
|
|
|
+ //清除合同
|
|
|
+ clearContrcat() {
|
|
|
+ this.clearing = true;
|
|
|
+ let {
|
|
|
+ id,
|
|
|
+ projectName,
|
|
|
+ saleType,
|
|
|
+ saleTypeName,
|
|
|
+ deliveryDate,
|
|
|
+ orderFiles,
|
|
|
+ remark
|
|
|
+ } = this.form;
|
|
|
+ this.form = Object.assign({}, copyObj(this.formDef), {
|
|
|
+ id,
|
|
|
+ projectName,
|
|
|
+ saleType: +saleType,
|
|
|
+ saleTypeName,
|
|
|
+ deliveryDate,
|
|
|
+ orderFiles,
|
|
|
+ remark
|
|
|
+ });
|
|
|
|
|
|
- handParent() {
|
|
|
- if (this.form.contractId) {
|
|
|
- return this.$message.error('选择了合同不能更改客户名称');
|
|
|
- }
|
|
|
- let item = {
|
|
|
- id: this.form.contactId
|
|
|
- };
|
|
|
- this.$refs.parentRef.open(item);
|
|
|
- },
|
|
|
+ this.$store.commit('order/setContractId', '');
|
|
|
+ this.$store.commit('order/setAllcountAmount', 0);
|
|
|
+ this.$refs.inventoryTable.putTableValue([]);
|
|
|
|
|
|
- getEnterprisePage() {
|
|
|
- enterprisePage({
|
|
|
- pageNum: 1,
|
|
|
- size: 100
|
|
|
- }).then((res) => {
|
|
|
- this.enterprisePage = [];
|
|
|
- this.enterprisePage.push(...res.list);
|
|
|
- });
|
|
|
- },
|
|
|
- getEnterprise() {
|
|
|
- let data = this.enterprisePage.find(
|
|
|
- (item) => item.name == this.form.quoteName
|
|
|
- );
|
|
|
- this.form.partbName = data.name;
|
|
|
- this.form.partbUnifiedSocialCreditCode = data.unifiedSocialCreditCode;
|
|
|
- this.form.partbFax = data.fax;
|
|
|
- this.form.partbAddress = data.address;
|
|
|
- },
|
|
|
- salesmanChange(val, info) {
|
|
|
- this.otherForm.salesmanName = info.name;
|
|
|
- },
|
|
|
- settlementModeChange(info) {
|
|
|
- this.form.settlementModeName = info.dictValue;
|
|
|
- },
|
|
|
- ifChiefChange(value, idx) {
|
|
|
- if (value === 1) {
|
|
|
- this.tableLinkData.forEach((e) => (e.ifChief = 0));
|
|
|
- this.tableLinkData[idx].ifChief = 1;
|
|
|
- }
|
|
|
- },
|
|
|
+ setTimeout(() => {
|
|
|
+ this.clearing = false;
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
|
|
|
- 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.inventoryTable.validateForm((valid) => {
|
|
|
- if (!valid) {
|
|
|
- reject(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- ]);
|
|
|
- },
|
|
|
- async getTableValue() {
|
|
|
- try {
|
|
|
- await this.getValidate();
|
|
|
- // 表单验证通过,执行保存操作
|
|
|
- this.loading = true;
|
|
|
+ handParent() {
|
|
|
+ if (this.form.contractId) {
|
|
|
+ return this.$message.error('选择了合同不能更改客户名称');
|
|
|
+ }
|
|
|
+ let item = {
|
|
|
+ id: this.form.contactId
|
|
|
+ };
|
|
|
+ this.$refs.parentRef.open(item);
|
|
|
+ },
|
|
|
|
|
|
- if (!this.form.contractId) {
|
|
|
- this.form.totalAmount = this.allcountAmount;
|
|
|
- }
|
|
|
+ getEnterprisePage() {
|
|
|
+ enterprisePage({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 100
|
|
|
+ }).then((res) => {
|
|
|
+ this.enterprisePage = [];
|
|
|
+ this.enterprisePage.push(...res.list);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getEnterprise() {
|
|
|
+ let data = this.enterprisePage.find(
|
|
|
+ (item) => item.name == this.form.quoteName
|
|
|
+ );
|
|
|
+ this.form.partbName = data.name;
|
|
|
+ this.form.partbUnifiedSocialCreditCode = data.unifiedSocialCreditCode;
|
|
|
+ this.form.partbFax = data.fax;
|
|
|
+ this.form.partbAddress = data.address;
|
|
|
+ },
|
|
|
+ salesmanChange(val, info) {
|
|
|
+ this.otherForm.salesmanName = info.name;
|
|
|
+ },
|
|
|
+ settlementModeChange(info) {
|
|
|
+ this.form.settlementModeName = info.dictValue;
|
|
|
+ },
|
|
|
+ ifChiefChange(value, idx) {
|
|
|
+ if (value === 1) {
|
|
|
+ this.tableLinkData.forEach((e) => (e.ifChief = 0));
|
|
|
+ this.tableLinkData[idx].ifChief = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- let commitData = Object.assign({}, this.form, {
|
|
|
- productList: this.$refs.inventoryTable.getTableValue(),
|
|
|
- saleTypeName: this.getDictValue('销售类型', this.form.saleType)
|
|
|
+ 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.inventoryTable.validateForm((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+ async getTableValue() {
|
|
|
+ try {
|
|
|
+ await this.getValidate();
|
|
|
+ // 表单验证通过,执行保存操作
|
|
|
+ this.loading = true;
|
|
|
|
|
|
- return commitData;
|
|
|
- } catch (error) {
|
|
|
- console.log(error);
|
|
|
- // 表单验证未通过,不执行保存操作
|
|
|
+ if (!this.form.contractId) {
|
|
|
+ this.form.totalAmount = this.allcountAmount;
|
|
|
}
|
|
|
- },
|
|
|
- cancel() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.activeName = 'base';
|
|
|
- // 关闭后,销毁所有的表单数据
|
|
|
- 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;
|
|
|
+
|
|
|
+ let commitData = Object.assign({}, this.form, {
|
|
|
+ productList: this.$refs.inventoryTable.getTableValue(),
|
|
|
+ saleTypeName: this.getDictValue('销售类型', this.form.saleType)
|
|
|
});
|
|
|
- },
|
|
|
- //查找合同分类对应name
|
|
|
- findNameById(tree, targetId) {
|
|
|
- for (let i = 0; i < tree.length; i++) {
|
|
|
- const node = tree[i];
|
|
|
- if (node.id === targetId) {
|
|
|
- return node.name;
|
|
|
- }
|
|
|
- if (node.children && node.children.length > 0) {
|
|
|
- const name = this.findNameById(node.children, targetId);
|
|
|
- if (name) {
|
|
|
- return name;
|
|
|
- }
|
|
|
+
|
|
|
+ return commitData;
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ // 表单验证未通过,不执行保存操作
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.activeName = 'base';
|
|
|
+ // 关闭后,销毁所有的表单数据
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //查找合同分类对应name
|
|
|
+ findNameById(tree, targetId) {
|
|
|
+ for (let i = 0; i < tree.length; i++) {
|
|
|
+ const node = tree[i];
|
|
|
+ if (node.id === targetId) {
|
|
|
+ return node.name;
|
|
|
+ }
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ const name = this.findNameById(node.children, targetId);
|
|
|
+ if (name) {
|
|
|
+ return name;
|
|
|
}
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
- .TotalAmount {
|
|
|
- font-size: 16px;
|
|
|
- padding-right: 30px;
|
|
|
- }
|
|
|
+.TotalAmount {
|
|
|
+ font-size: 16px;
|
|
|
+ padding-right: 30px;
|
|
|
+}
|
|
|
</style>
|