|
@@ -1,115 +1,558 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button size="mini" type="primary" @click="dialogFormVisible = true">新 建</el-button>
|
|
|
- <el-dialog title="新 建" :visible.sync="dialogFormVisible" width="50%">
|
|
|
- <div slot="title" style="font-size: 15px">
|
|
|
- 新增报价单
|
|
|
+ <el-button size="small" type="primary" @click="dialogFormVisible = true">新 建</el-button>
|
|
|
+ <el-drawer
|
|
|
+ title="创建项目报价单"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ size="93%"
|
|
|
+ direction="rtl"
|
|
|
+ append-to-body
|
|
|
+ :show-close="false"
|
|
|
+ @close="onClose">
|
|
|
+ <div class="drawer__panel" style="margin-bottom: 0px">
|
|
|
+ <el-row style="margin-top: 10px">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" size="mini" label-position="right">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="报价类型:" label-width="90px" >
|
|
|
+ <el-input v-model="form.type" autocomplete="off" placeholder="报价类型" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="是否特价:" label-width="90px" >
|
|
|
+ <el-input v-model="form.specialOffer" autocomplete="off" placeholder="是否特价" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" >
|
|
|
+ <el-form-item label="项目名称:" label-width="90px" prop="projectname">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="580"
|
|
|
+ trigger="click"
|
|
|
+ v-model="projectShow"
|
|
|
+ @show="projectList">
|
|
|
+ <el-table :data="project.projectData" @row-click="projectData">
|
|
|
+ <el-table-column
|
|
|
+ label="项目编号"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.projectnum?scope.row.projectnum:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="项目名称"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.projectname?scope.row.projectname:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="地址"
|
|
|
+ width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ width="60">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="projectData(scope.row)">选择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChangeProject"
|
|
|
+ @current-change="handleCurrentChangeProject"
|
|
|
+ :current-page="project.currentPage"
|
|
|
+ :total="project.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-input slot="reference" v-model="form.projectname" autocomplete="off" placeholder="请选择项目" @input="selectProject"></el-input>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" >
|
|
|
+ <el-form-item label="项目编号:" label-width="90px" >
|
|
|
+ <el-input v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="客户名称:" label-width="90px" prop="enterprisename">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="580"
|
|
|
+ trigger="click"
|
|
|
+ v-model="customerShow"
|
|
|
+ @show="customerList">
|
|
|
+ <el-table :data="customer.customerData" @row-click="customerData">
|
|
|
+ <el-table-column
|
|
|
+ label="客户编号"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="客户名称"
|
|
|
+ width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="地址"
|
|
|
+ width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChangeCustomer"
|
|
|
+ @current-change="handleCurrentChangeCustomer"
|
|
|
+ :current-page="customer.currentPage"
|
|
|
+ :total="customer.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-input slot="reference" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" @input="selectCustomer"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="报价日期:" label-width="90px">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.billdate"
|
|
|
+ style="width: 100%"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"
|
|
|
+ :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="有效期:" label-width="90px" >
|
|
|
+ <el-date-picker
|
|
|
+ v-model="date"
|
|
|
+ style="width: 100%"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="联系人:" label-width="90px" prop="name">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="580"
|
|
|
+ trigger="click"
|
|
|
+ v-model="contactsShow"
|
|
|
+ @show="contactsList">
|
|
|
+ <el-table :data="contacts.contactsData" @row-click="contactsData">
|
|
|
+ <el-table-column
|
|
|
+ label="姓名"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.name?scope.row.name:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="手机号"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.phonenumber?scope.row.phonenumber:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="邮箱"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.email?scope.row.email:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="地址"
|
|
|
+ width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChangeContacts"
|
|
|
+ @current-change="handleCurrentChangeContacts"
|
|
|
+ :current-page="contacts.currentPage"
|
|
|
+ :total="contacts.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-input slot="reference" v-model="form.name" autocomplete="off" placeholder="请选择联系人" @input="selectContacts"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="手机号:" label-width="90px" >
|
|
|
+ <el-input v-model="form.phonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="6">
|
|
|
+ <el-form-item label="总金额:" label-width="90px" >
|
|
|
+ <el-input v-model="form.totalPrice" autocomplete="off" placeholder="总金额" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>-->
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div >
|
|
|
+ <el-divider></el-divider>
|
|
|
</div>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-form :model="form" :rules="rules" ref="form" label-width="120px" label-position="right" size="mini">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="项目名称" prop="projectname">
|
|
|
- <el-input v-model="form.projectname" placeholder="请输入项目名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="折扣率" prop="discountrate">
|
|
|
- <el-input v-model="form.discountrate" placeholder="请输入折扣率"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="地址" prop="address">
|
|
|
- <el-input v-model="form.address" placeholder="请输入地址"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="有效日期" prop="invaliddate">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.invaliddate"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- @change="timeChange">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="备注" prop="remarks">
|
|
|
- <el-input type="textarea" v-model="form.remarks" placeholder="请输入备注"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-form>
|
|
|
- </el-row>
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
|
|
|
- <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
|
|
|
+ <div style="margin:30px 20px 20px 20px">
|
|
|
+ <quotedPriceProduct :sa_projectid="form.sa_projectid" :type="form.type" ref="quoterPrice" @checkFormImport="onCheckFormImport" @checkForm="onSubmit" @productData="productDataChange"></quotedPriceProduct>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
+ <el-button :disabled="form.sa_quotedpriceid === 0" size="small" type="primary" @click="getSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import quotedPriceProduct from '@/SDrpManagement/QuotedPrice/components/quotedPriceProduct'
|
|
|
export default {
|
|
|
name: "add",
|
|
|
- inject:['detailData'],
|
|
|
- components:{},
|
|
|
+ props:["data"],
|
|
|
+ components:{quotedPriceProduct},
|
|
|
data(){
|
|
|
return {
|
|
|
dialogFormVisible:false,
|
|
|
+ projectShow:false,
|
|
|
+ customerShow:false,
|
|
|
+ contactsShow:false,
|
|
|
+ projectParam:{
|
|
|
+ "id": 20221020143502,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "type":0, // 1:我负责的;2:我参与的;3:我下属负责的;4:我下属参与的
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "startdate": "",
|
|
|
+ "enddate": "",
|
|
|
+ "status":"",//跟进中、已成交、已失败
|
|
|
+ "projecttype":"",
|
|
|
+ "stagename":"",
|
|
|
+ "tag":""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ project:{
|
|
|
+ projectData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ },
|
|
|
+ customerParam:{
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "type":4,
|
|
|
+ "sa_projectid":""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ customer:{
|
|
|
+ customerData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ },
|
|
|
+ contactsParam:{
|
|
|
+ "id": "20221022165503",
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "sys_enterpriseid":"",
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "workaddress": 0//0表示人,1表示地址
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ contacts:{
|
|
|
+ contactsData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() + 3600 * 1000 * 24 < Date.now() ;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ drawer:false,
|
|
|
+ isQuotedPrice:false,
|
|
|
+ date:[],
|
|
|
+ productObj:{},
|
|
|
form:{
|
|
|
- "sa_quotedpriceid":0, //sat_notice_classid<=0时 为新增
|
|
|
- "sys_enterpriseid": "",
|
|
|
- "sa_projectid": "",
|
|
|
- "discountrate": "",
|
|
|
- "remarks": "",
|
|
|
- "invaliddate": "",
|
|
|
- "projectname": "",
|
|
|
- "address": ""
|
|
|
+ totalPrice:'',
|
|
|
+ type:'',
|
|
|
+ projectnum:'',
|
|
|
+ enterprisename:'',
|
|
|
+ name:'',
|
|
|
+ phonenumber:'',
|
|
|
+ specialOffer:'否',
|
|
|
+ sa_quotedpriceid:0, //sat_notice_classid<=0时 为新增
|
|
|
+ sys_enterpriseid: "",
|
|
|
+ contactsid:8,
|
|
|
+ sa_projectid: "0",
|
|
|
+ discountrate: 0,
|
|
|
+ remarks: "",
|
|
|
+ invaliddate: "",
|
|
|
+ projectname: "",
|
|
|
+ address: "",
|
|
|
+ billdate:"",
|
|
|
+ enddate:'',
|
|
|
+ begdate:''
|
|
|
},
|
|
|
rules:{
|
|
|
projectname:[
|
|
|
- { required: true, message: '输入项目名称', trigger: 'blur'},
|
|
|
- ],
|
|
|
- invaliddate:[
|
|
|
- { required: true, message: '请选择报价有效期', trigger: 'blur'}
|
|
|
+ { required: true, message: '请选择项目', trigger: 'change'},
|
|
|
],
|
|
|
- discountrate:[
|
|
|
- { required: true, message: '整单折扣率,保留2位小数', trigger: 'blur'}
|
|
|
+ enterprisename:[
|
|
|
+ { required: true, message: '请选择客户', trigger: 'change'},
|
|
|
],
|
|
|
- }
|
|
|
+ name:[
|
|
|
+ { required: true, message: '请选择联系人', trigger: 'change'},
|
|
|
+ ]
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ onClose(){
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ /*this.$emit('addSuccess')*/
|
|
|
+ },
|
|
|
+ /*创建报价单,获取商品信息*/
|
|
|
onSubmit(){
|
|
|
- this.$refs['form'].validate(async (valid) => {
|
|
|
+ console.log(this.date)
|
|
|
+ if (this.date.length === 0){
|
|
|
+ this.form.begdate = ''
|
|
|
+ this.form.enddate = ''
|
|
|
+ }else {
|
|
|
+ this.form.begdate = this.date[0]
|
|
|
+ this.form.enddate = this.date[1]
|
|
|
+ }
|
|
|
+ console.log(this.form,"表单")
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
if (!valid) return false
|
|
|
- this.form.sys_enterpriseid = this.detailData().sys_enterpriseid
|
|
|
- this.form.sa_projectid = parseInt(this.$route.query.id)
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": "20221020164803",
|
|
|
+ "id": 20221020164803,
|
|
|
"version":1,
|
|
|
"content": this.form
|
|
|
})
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.$emit('onSuccess')
|
|
|
- this.$refs['form'].resetFields();
|
|
|
- this.dialogFormVisible = false
|
|
|
+ this.$refs.quoterPrice.quoterPrice(res.data.sa_quotedpriceid,this.form.type)
|
|
|
+ this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*导入创建报价单校验*/
|
|
|
+ onCheckFormImport(){
|
|
|
+ console.log(this.date)
|
|
|
+ if (this.date.length === 0){
|
|
|
+ this.form.begdate = ''
|
|
|
+ this.form.enddate = ''
|
|
|
+ }else {
|
|
|
+ this.form.begdate = this.date[0]
|
|
|
+ this.form.enddate = this.date[1]
|
|
|
+ }
|
|
|
+ console.log(this.form,"表单")
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221020164803,
|
|
|
+ "version":1,
|
|
|
+ "content": this.form
|
|
|
})
|
|
|
+ this.$refs.quoterPrice.quoterImport(res.data.sa_quotedpriceid,this.form.type)
|
|
|
+ this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
|
|
|
})
|
|
|
},
|
|
|
- timeChange(e) {
|
|
|
- if(!e) {
|
|
|
- this.form.invaliddate = ''
|
|
|
- }
|
|
|
- let result = this.changeTimeFormat(e.getTime())
|
|
|
-
|
|
|
- this.form.invaliddate = result
|
|
|
- },
|
|
|
- changeTimeFormat(time) {
|
|
|
- var date = new Date(time);
|
|
|
- var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
|
|
- var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
|
|
- return date.getFullYear() + "-" + month + "-" + currentDate
|
|
|
- }
|
|
|
+ /*提交*/
|
|
|
+ getSubmit(){
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ console.log(this.data)
|
|
|
+ if (this.date.length === 0){
|
|
|
+ this.form.begdate = ''
|
|
|
+ this.form.enddate = ''
|
|
|
+ }else {
|
|
|
+ this.form.begdate = this.date[0]
|
|
|
+ this.form.enddate = this.date[1]
|
|
|
+ }
|
|
|
+ console.log(this.form,"表单")
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221020164803,
|
|
|
+ "version":1,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,() => {
|
|
|
+ this.changeData(this.productObj)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*修改后的产品数据*/
|
|
|
+ productDataChange(val){
|
|
|
+ console.log(val,"修改后的产品数据")
|
|
|
+ let obj = val.map(e=>{
|
|
|
+ return {
|
|
|
+ sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
|
|
|
+ itemid:e.itemid,
|
|
|
+ oldprice:e.marketprice,
|
|
|
+ price:e.price,
|
|
|
+ discountrate:(e.discountrate/100).toFixed(4),
|
|
|
+ qty:e.qty
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.productObj = obj
|
|
|
+ },
|
|
|
+ async changeData(obj){
|
|
|
+ console.log(this.productObj,"数据")
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221021095403,
|
|
|
+ "content": {
|
|
|
+ "sa_quotedpriceid":this.form.sa_quotedpriceid, //sat_notice_classid<=0时 为新增
|
|
|
+ "items":obj
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(res)
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ },
|
|
|
+ async projectList(){
|
|
|
+ const res = await this.$api.requested(this.projectParam)
|
|
|
+ console.log(res)
|
|
|
+ this.project.projectData = res.data
|
|
|
+ this.project.total = res.total
|
|
|
+ this.project.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ async selectProject(){
|
|
|
+ console.log(this.form.projectname)
|
|
|
+ this.projectParam.content.where.condition = this.form.projectname
|
|
|
+ this.projectList()
|
|
|
+ },
|
|
|
+ async customerList(){
|
|
|
+ if (this.form.sa_projectid === '0' && this.form.type === '普通报价'){
|
|
|
+ this.customerParam.content.where.type = 2
|
|
|
+ }else {
|
|
|
+ this.customerParam.content.where.type = 4
|
|
|
+ this.customerParam.content.where.sa_projectid = this.form.sa_projectid
|
|
|
+ }
|
|
|
+ const res = await this.$api.requested(this.customerParam)
|
|
|
+ this.customer.customerData = res.data
|
|
|
+ this.customer.total = res.total
|
|
|
+ this.customer.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ selectCustomer(){
|
|
|
+ this.customerParam.content.where.condition = this.form.enterprisename
|
|
|
+ this.customerList()
|
|
|
+ },
|
|
|
+ async contactsList(){
|
|
|
+ this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
|
|
|
+ const res = await this.$api.requested(this.contactsParam)
|
|
|
+ this.contacts.contactsData = res.data
|
|
|
+ this.contacts.total = res.total
|
|
|
+ this.contacts.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ selectContacts(){
|
|
|
+ this.contactsParam.content.where.condition = this.form.name
|
|
|
+ this.contactsList()
|
|
|
+ },
|
|
|
+ /*项目选择信息*/
|
|
|
+ projectData(val){
|
|
|
+ this.form.sa_projectid = val.sa_projectid
|
|
|
+ this.form.projectname = val.projectname
|
|
|
+ this.form.projectnum = val.projectnum
|
|
|
+ this.form.sys_enterpriseid = ''
|
|
|
+ this.form.enterprisename = ''
|
|
|
+ this.form.contactsid = ''
|
|
|
+ this.form.name = ''
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ this.projectShow = false
|
|
|
+ },
|
|
|
+ /*客户选择信息*/
|
|
|
+ customerData(val){
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
|
+ this.form.contactsid = ''
|
|
|
+ this.form.name = ''
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ this.customerShow = false
|
|
|
+ },
|
|
|
+ /*联系人选择信息*/
|
|
|
+ contactsData(val){
|
|
|
+ this.form.contactsid = val.contactsid
|
|
|
+ this.form.name = val.name
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
+ this.contactsShow = false
|
|
|
+ },
|
|
|
+ /*项目分页*/
|
|
|
+ handleSizeChangeProject(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.projectParam.content.pageSize = val
|
|
|
+ this.projectList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeProject(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.projectParam.content.pageNumber = val
|
|
|
+ this.projectList()
|
|
|
+ },
|
|
|
+ /*客户分页*/
|
|
|
+ handleSizeChangeCustomer(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.projectParam.content.pageSize = val
|
|
|
+ this.customerList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeCustomer(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.projectParam.content.pageNumber = val
|
|
|
+ this.customerList()
|
|
|
+ },
|
|
|
+ /*联系人分页*/
|
|
|
+ handleSizeChangeContacts(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.projectParam.content.pageSize = val
|
|
|
+ this.contactsList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeContacts(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.projectParam.content.pageNumber = val
|
|
|
+ this.contactsList()
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ const date = new Date()
|
|
|
+ console.log(date)
|
|
|
+ this.form.billdate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
|
|
+ this.form.sa_projectid = this.data.sa_projectid
|
|
|
+ this.form.projectname = this.data.projectname
|
|
|
+ this.form.projectnum = this.data.projectnum
|
|
|
+ this.form.type = '项目报价'
|
|
|
+ console.log(this.form)
|
|
|
}
|
|
|
}
|
|
|
</script>
|