|
|
@@ -0,0 +1,432 @@
|
|
|
+<template>
|
|
|
+ <ele-modal
|
|
|
+ custom-class="ele-dialog-form"
|
|
|
+ v-if="visible"
|
|
|
+ :visible.sync="visible"
|
|
|
+ :title="title"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="80%"
|
|
|
+ @close="cancel"
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-card
|
|
|
+ shadow="never"
|
|
|
+ header="基本信息"
|
|
|
+ body-style="padding: 22px 20px 0 0;"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item
|
|
|
+ label="询价方名称"
|
|
|
+ prop="contactName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.contactName"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="businessLicenseFiles" label="询价单附件">
|
|
|
+ <fileUpload
|
|
|
+ v-model="form.businessLicenseFiles"
|
|
|
+ module="main"
|
|
|
+ :showLib="false"
|
|
|
+ :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="deliveryDate" label="交货日期">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.deliveryDate"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="交货日期"
|
|
|
+ type="date"
|
|
|
+ class="filter-item"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="quoteFax" label="报价方传真">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.quoteFax"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="quoteTel" label="报价方联系电话">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.quoteTel"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item
|
|
|
+ label="询价方电话"
|
|
|
+ prop="contactTel"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :maxlength="20"
|
|
|
+ v-model="form.contactTel"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="询价方地址"
|
|
|
+ prop="contactAddress"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.contactAddress"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="付款方式"
|
|
|
+ prop="payWay"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <DictSelection dictName="付款方式" clearable v-model="form.payWay">
|
|
|
+ </DictSelection>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="taxRate" label="税率">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.taxRate"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="totalPrice" label="总金额">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.totalPrice"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item
|
|
|
+ label="询价方联系人"
|
|
|
+ prop="contactLinkName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :maxlength="20"
|
|
|
+ v-model="form.contactLinkName"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label=" 询价方email"
|
|
|
+ prop="contactEmail"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.contactEmail"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="报价方地址"
|
|
|
+ prop="quoteAddress"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.quoteAddress"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="报价方联系人"
|
|
|
+ prop="quoteLinkName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.quoteLinkName"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="是否接受拆单" prop="acceptUnpack" style="margin-bottom: 22px">
|
|
|
+ <el-select v-model="form.acceptUnpack" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in acceptUnpackoptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="询价方传真"
|
|
|
+ prop="contactFax"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.contactFax"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="报价方email"
|
|
|
+ prop="quoteEmail"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.quoteEmail"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="报价方名称"
|
|
|
+ prop="quoteName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.quoteName"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ <el-card
|
|
|
+ shadow="never"
|
|
|
+ header="报价单产品清单"
|
|
|
+ body-style="padding: 22px 20px 0 0;"
|
|
|
+ >
|
|
|
+ <inventoryTable
|
|
|
+ ref="inventoryTable"
|
|
|
+ @timeAll="getDetailTable"
|
|
|
+ :delDetailIds="delDetailIds"
|
|
|
+ ></inventoryTable>
|
|
|
+ </el-card>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="footer">
|
|
|
+ <el-button type="primary" @click="save">保存</el-button>
|
|
|
+ <el-button @click="cancel">返回</el-button>
|
|
|
+ </div>
|
|
|
+ <head-list ref="headRef" @changeParent="changeHead"></head-list>
|
|
|
+ <parentList ref="parentRef" classType="1" @changeParent="changeParent"></parentList>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {acceptUnpackoptions} from '@/enum/dict';
|
|
|
+import inventoryTable from './inventoryTable.vue'
|
|
|
+import {categoryData} from 'element-china-category-data';
|
|
|
+import fileUpload from '@/components/upload/fileUpload';
|
|
|
+import {cityData} from 'ele-admin/packages/utils/regions';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
+import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
+import {listOrganizations} from '@/api/system/organization';
|
|
|
+import parentList from '@/views/saleManage/contact/components/parentList.vue'
|
|
|
+import { getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/businessOpportunity';
|
|
|
+import headList from './head-list.vue'
|
|
|
+import {copyObj} from '@/utils/util';
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ categoryTreeList: Array
|
|
|
+ },
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ fileUpload,
|
|
|
+ inventoryTable,
|
|
|
+ deptSelect,
|
|
|
+ headList,
|
|
|
+ parentList,
|
|
|
+ personSelect
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ let formDef = {
|
|
|
+ id:'',
|
|
|
+ contactName: '',
|
|
|
+ contactId: 0,
|
|
|
+ name: '',
|
|
|
+ remark: '',
|
|
|
+ responsibleName: '',
|
|
|
+ responsibleId: '',
|
|
|
+ source: '',
|
|
|
+ status: 1
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ payWayOptions:[],
|
|
|
+ acceptUnpackoptions,
|
|
|
+ visible: false,
|
|
|
+ title: '',
|
|
|
+ row: {},
|
|
|
+ activeName: 'base',
|
|
|
+ formDef,
|
|
|
+ form: copyObj(formDef),
|
|
|
+ // removeBankList: [],
|
|
|
+ // removeLinkList: [],
|
|
|
+ tableBankData: [],
|
|
|
+ tableLinkData: [],
|
|
|
+
|
|
|
+ rules: {
|
|
|
+ contactName: [
|
|
|
+ { required: true, message: '请选择客户', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请输入客户名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ responsibleName: [
|
|
|
+ { required: true, message: '请选择负责人', trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+
|
|
|
+ options: {
|
|
|
+ cityData,
|
|
|
+ categoryData,
|
|
|
+ },
|
|
|
+ // 提交状态
|
|
|
+ loading: false,
|
|
|
+ // 是否是修改
|
|
|
+ isUpdate: false,
|
|
|
+
|
|
|
+ // 组织机构树形结构数据
|
|
|
+ groupTreeData: [],
|
|
|
+ // 组织机构平铺数据
|
|
|
+ groupData: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ //
|
|
|
+ getDetailTable (val) {
|
|
|
+ this.form.totalWorkHour = val;
|
|
|
+ },
|
|
|
+ //选择客户回调
|
|
|
+ changeParent(obj) {
|
|
|
+ this.$set( this.form, 'contactId', obj.id)
|
|
|
+ this.$set( this.form, 'contactName', obj.name)
|
|
|
+
|
|
|
+ },
|
|
|
+ //选择负责人回调
|
|
|
+ changeHead(obj) {
|
|
|
+ this.$set( this.form, 'responsibleId', obj.id)
|
|
|
+ this.$set( this.form, 'responsibleName', obj.name)
|
|
|
+ },
|
|
|
+ handParent() {
|
|
|
+ let item = {
|
|
|
+ id: this.form.contactId
|
|
|
+ }
|
|
|
+ this.$refs.parentRef.open(item)
|
|
|
+ },
|
|
|
+ handHead(){
|
|
|
+ let item = {
|
|
|
+ id: this.form.responsibleId
|
|
|
+ }
|
|
|
+ this.$refs.headRef.open(item)
|
|
|
+ },
|
|
|
+ async open(type, row, contactCategoryId) {
|
|
|
+ this.title = type==='add'?'新增':'修改';
|
|
|
+ this.row = row;
|
|
|
+ this.visible = true;
|
|
|
+ if (type == 'add') {
|
|
|
+ this.isUpdate = false;
|
|
|
+ } else {
|
|
|
+ this.isUpdate = true;
|
|
|
+ this.form=row
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ salesmanChange(val, info){
|
|
|
+ this.otherForm.salesmanName = info.name;
|
|
|
+ },
|
|
|
+ settlementModeChange(info){
|
|
|
+ this.otherForm.settlementModeName = info.dictValue;
|
|
|
+ },
|
|
|
+ ifChiefChange(value, idx){
|
|
|
+ if(value === 1){
|
|
|
+ this.tableLinkData.forEach(e => e.ifChief = 0);
|
|
|
+ this.tableLinkData[idx].ifChief = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ getValidate() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async save() {
|
|
|
+ try {
|
|
|
+ await this.getValidate();
|
|
|
+ // 表单验证通过,执行保存操作
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ if (!this.isUpdate) {
|
|
|
+ delete this.form.id;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.isUpdate) {
|
|
|
+ UpdateInformation(this.form)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addInformation(this.form)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } 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.form = copyObj(this.formDef)
|
|
|
+ this.visible = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|