|
@@ -1,237 +1,246 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-button size="mini" :type="btnType?btnType:'text'" @click="dialogFormVisible = true" >编 辑</el-button>
|
|
|
|
|
|
+ <el-button size="mini" :type="btnType?btnType:'text'" @click="onShow" >编 辑</el-button>
|
|
<el-drawer
|
|
<el-drawer
|
|
title="创建报价单"
|
|
title="创建报价单"
|
|
- :visible.sync="dialogFormVisible"
|
|
|
|
|
|
+ :visible.sync="drawer"
|
|
size="50%"
|
|
size="50%"
|
|
direction="rtl"
|
|
direction="rtl"
|
|
append-to-body
|
|
append-to-body
|
|
@close="onClose">
|
|
@close="onClose">
|
|
- <div class="drawer__panel">
|
|
|
|
- <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="项目名称:" >
|
|
|
|
- <el-input v-model="form.projectname" placeholder="请选择项目" style="width: 100%" @focus="projectList"></el-input>
|
|
|
|
|
|
+ <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="11">
|
|
|
|
+ <el-form-item label="报价类型:" label-width="90px" >
|
|
|
|
+ <el-input v-model="form.quotedpricetype" autocomplete="off" placeholder="报价类型" disabled></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="项目编号:" >
|
|
|
|
- <el-input v-model="form.projectnum" placeholder="项目编号" style="width: 100%" disabled></el-input>
|
|
|
|
|
|
+ <el-col :offset="2" :span="11">
|
|
|
|
+ <el-form-item label="是否特价:" label-width="90px" >
|
|
|
|
+ <el-input v-model="form.specialoffer === 0?'否':'是'" autocomplete="off" placeholder="是否特价" disabled></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="收件单位:" prop="enterprisename">
|
|
|
|
- <el-input v-model="form.enterprisename" placeholder="请选择收件单位" style="width: 100%" @focus="enterpriseList"></el-input>
|
|
|
|
|
|
+ <el-col :span="11" v-if="isQuotedPrice">
|
|
|
|
+ <el-form-item label="项目名称:" label-width="90px" prop="projectname">
|
|
|
|
+ <el-input v-model="form.projectname" autocomplete="off" placeholder="请选择项目" @focus="project" @projectList="projectList"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="收件人:" prop="name">
|
|
|
|
- <el-input v-model="form.name" placeholder="请选择收件人" style="width: 100%" @focus="contactsList"></el-input>
|
|
|
|
|
|
+ <el-col :offset="2" :span="11" v-if="isQuotedPrice">
|
|
|
|
+ <el-form-item label="项目编号:" label-width="90px" >
|
|
|
|
+ <el-input v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="收件手机号:" >
|
|
|
|
- <el-input v-model="form.phonenumber" placeholder="联系方式" style="width: 100%" disabled></el-input>
|
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
+ <el-form-item label="客户:" label-width="90px" prop="enterprisename">
|
|
|
|
+ <el-input v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" @focus="customer" @customerList="customerList"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="报价单有效期:" >
|
|
|
|
|
|
+ <el-col :offset="2" :span="11">
|
|
|
|
+ <el-form-item label="报价日期:" label-width="90px">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
- style="width: 100%"
|
|
|
|
- v-model="form.invaliddate"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- type="daterange"
|
|
|
|
- range-separator="至"
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
- end-placeholder="结束日期">
|
|
|
|
|
|
+ v-model="form.billdate"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ type="date"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
+ :picker-options="pickerOptions">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="24">
|
|
|
|
- <p>商品明细报价</p>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24">
|
|
|
|
- <el-divider></el-divider>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="整单折扣(系数)" >
|
|
|
|
- <el-input v-model="form.discountrate" placeholder="保留两位小数" style="width: 50%"></el-input>
|
|
|
|
- <div>
|
|
|
|
- <div style="float: left;color:red">
|
|
|
|
- <span>*</span>
|
|
|
|
- </div>
|
|
|
|
- <span style="font-size: 10px;float: left"> 若无商品明细折扣信息,则以整单折扣计算;若有商品明细折扣信息,则以商品明细折扣计算</span>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
+ <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-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12" >
|
|
|
|
- <el-button size="small" @click="dialogProjectVisible = false" type="info" class="inline-16" style="float: right">删除</el-button>
|
|
|
|
- <el-button size="small" @click="dialogProjectVisible = false" type="primary" class="el-icon-plus inline-16" style="float: right">添加</el-button>
|
|
|
|
|
|
+ <el-col :offset="2" :span="11">
|
|
|
|
+ <el-form-item label="联系人:" label-width="90px" prop="name">
|
|
|
|
+ <el-input v-model="form.contactsname" autocomplete="off" placeholder="联系人" @focus="contacts" @contactsList="contactsList"></el-input>
|
|
|
|
+ </el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="24">
|
|
|
|
- <product></product>
|
|
|
|
|
|
+ <el-col :span="11">
|
|
|
|
+ <el-form-item label="手机号:" label-width="90px" >
|
|
|
|
+ <el-input v-model="form.contactsphonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-form>
|
|
</el-form>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div >
|
|
|
|
+ <el-divider></el-divider>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="margin:30px 20px 20px 20px">
|
|
|
|
+ <quoted_price_product :id="form.sa_projectid" ref="quoterPrice" @checkForm="onSubmit"></quoted_price_product>
|
|
|
|
+ </div>
|
|
<div class="fixed__btn__panel">
|
|
<div class="fixed__btn__panel">
|
|
<el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
|
|
<el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
|
|
<el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
<el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
</el-drawer>
|
|
</el-drawer>
|
|
- <project :visible="visibleProject" :index="index" v-if="visibleProject" @onProject="onProject"></project>
|
|
|
|
- <enterprise :visible="visibleEnterprise" :index="index" :sa_projectid="form.sa_projectid" v-if="visibleEnterprise" @onEnterprise="onEnterprise"></enterprise>
|
|
|
|
- <contacts :visible="visibleContacts" :index="index" :sys_enterpriseid="form.sys_enterpriseid" v-if="visibleContacts" @onContacts="onContacts"></contacts>
|
|
|
|
|
|
+ <project_table v-if="projectDrawer" :projectDrawer="projectDrawer" @projectData="projectData" @projectList="projectList"></project_table>
|
|
|
|
+ <customer_table v-if="customerDrawer" :customerDrawer="customerDrawer" :id="form.sa_projectid" :isQuotedPrice="isQuotedPrice" @customerData="customerData" @customerList="customerList"></customer_table>
|
|
|
|
+ <contacts_table v-if="contactsDrawer" :contactsDrawer="contactsDrawer" :id="form.sys_enterpriseid" @contactsData="contactsData" @contactsList="contactsList"></contacts_table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import layoutTable from "@/components/table/index3";
|
|
|
|
-import project from "@/SDrpManagement/QuotedPrice/detail/components/project";
|
|
|
|
-import enterprise from "@/SDrpManagement/QuotedPrice/detail/components/enterprise";
|
|
|
|
-import contacts from "@/SDrpManagement/QuotedPrice/detail/components/contacts";
|
|
|
|
-import product from "@/SDrpManagement/QuotedPrice/detail/components/product";
|
|
|
|
|
|
+import project_table from "@/SDrpManagement/QuotedPrice/components/projectTable";
|
|
|
|
+import customer_table from "@/SDrpManagement/QuotedPrice/components/customerTable";
|
|
|
|
+import contacts_table from "@/SDrpManagement/QuotedPrice/components/contactsTable";
|
|
|
|
+import quoted_price_product from "@/SDrpManagement/QuotedPrice/components/quotedPriceProduct";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "edit",
|
|
name: "edit",
|
|
props:['data','btnType'],
|
|
props:['data','btnType'],
|
|
data(){
|
|
data(){
|
|
return {
|
|
return {
|
|
- visibleProject:false,
|
|
|
|
- visibleEnterprise:false,
|
|
|
|
- visibleContacts:false,
|
|
|
|
- dialogFormVisible:false,
|
|
|
|
- dialogProjectVisible:false,
|
|
|
|
- tableHieght:320,
|
|
|
|
- tablecols:[],
|
|
|
|
- list:[],
|
|
|
|
- total:0,
|
|
|
|
- currentPage:0,
|
|
|
|
- index:'',
|
|
|
|
|
|
+ pickerOptions: {
|
|
|
|
+ disabledDate(time) {
|
|
|
|
+ return time.getTime() + 3600 * 1000 * 24 < Date.now() ;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ drawer:false,
|
|
|
|
+ projectDrawer:false,
|
|
|
|
+ customerDrawer:false,
|
|
|
|
+ contactsDrawer:false,
|
|
|
|
+ isQuotedPrice:false,
|
|
|
|
+ date:[],
|
|
form:{
|
|
form:{
|
|
|
|
+ type:'',
|
|
|
|
+ projectnum:'',
|
|
|
|
+ enterprisename:'',
|
|
|
|
+ name:'',
|
|
|
|
+ phonenumber:'',
|
|
|
|
+ specialOffer:'否',
|
|
sa_quotedpriceid:0, //sat_notice_classid<=0时 为新增
|
|
sa_quotedpriceid:0, //sat_notice_classid<=0时 为新增
|
|
sys_enterpriseid: "",
|
|
sys_enterpriseid: "",
|
|
- enterprisename:"",
|
|
|
|
|
|
+ contactsid:8,
|
|
sa_projectid: "0",
|
|
sa_projectid: "0",
|
|
- contactsid:"",
|
|
|
|
- name:"",
|
|
|
|
- phonenumber:"",
|
|
|
|
- discountrate:"" ,
|
|
|
|
|
|
+ discountrate: 0,
|
|
remarks: "",
|
|
remarks: "",
|
|
invaliddate: "",
|
|
invaliddate: "",
|
|
projectname: "",
|
|
projectname: "",
|
|
address: "",
|
|
address: "",
|
|
- projectnum:""
|
|
|
|
|
|
+ billdate:"",
|
|
|
|
+ enddate:'',
|
|
|
|
+ begdate:''
|
|
},
|
|
},
|
|
rules:{
|
|
rules:{
|
|
- enterprisename: [
|
|
|
|
- { required: true, message: '单位不能为空', trigger: 'change' },
|
|
|
|
|
|
+ projectname:[
|
|
|
|
+ { required: true, message: '请选择项目', trigger: 'change'},
|
|
],
|
|
],
|
|
- name: [
|
|
|
|
- { required: false, message: '联系人不能为空', trigger: 'change' },
|
|
|
|
|
|
+ enterprisename:[
|
|
|
|
+ { required: true, message: '请选择客户', trigger: 'change'},
|
|
],
|
|
],
|
|
|
|
+ name:[
|
|
|
|
+ { required: true, message: '请选择联系人', trigger: 'change'},
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
- projectData:[],
|
|
|
|
- params:{
|
|
|
|
- "id": 20221020143502,
|
|
|
|
- "content": {
|
|
|
|
- "pageNumber": 1,
|
|
|
|
- "pageSize": 10,
|
|
|
|
- "type":0, // 1:我负责的;2:我参与的;3:我下属负责的;4:我下属参与的
|
|
|
|
- "where": {
|
|
|
|
- "condition": ""
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- components:{
|
|
|
|
- layoutTable,project,enterprise,contacts,product
|
|
|
|
- },
|
|
|
|
|
|
+ components:{project_table,customer_table,contacts_table,quoted_price_product},
|
|
methods:{
|
|
methods:{
|
|
|
|
+ onShow(){
|
|
|
|
+ this.drawer = true
|
|
|
|
+ console.log(this.data,"报价单")
|
|
|
|
+ this.form = this.data
|
|
|
|
+ if (this.form.typeData === '项目报价'){
|
|
|
|
+ this.isQuotedPrice = true
|
|
|
|
+ }else {
|
|
|
|
+ this.isQuotedPrice = false
|
|
|
|
+ }
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ this.$refs.quoterPrice.productData(this.data.sa_quotedpriceid)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onClose(){
|
|
|
|
+ this.drawer = false
|
|
|
|
+ this.$emit('addSuccess')
|
|
|
|
+ },
|
|
onSubmit(){
|
|
onSubmit(){
|
|
- console.log(this.form)
|
|
|
|
- this.$refs['form'].validate(async (valid) => {
|
|
|
|
|
|
+ console.log(this.data)
|
|
|
|
+ if (this.data.length !== 0){
|
|
|
|
+ this.form.begdate = this.date[0]
|
|
|
|
+ this.form.enddate = this.date[1]
|
|
|
|
+ }else {
|
|
|
|
+ this.form.begdate = ''
|
|
|
|
+ this.form.enddate = ''
|
|
|
|
+ }
|
|
|
|
+ console.log(this.form,"表单")
|
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
if (!valid) return false
|
|
if (!valid) return false
|
|
const res = await this.$api.requested({
|
|
const res = await this.$api.requested({
|
|
"id": 20221020164803,
|
|
"id": 20221020164803,
|
|
"version":1,
|
|
"version":1,
|
|
- "content":this.form
|
|
|
|
- })
|
|
|
|
- this.tool.showMessage(res,()=> {
|
|
|
|
- console.log(res)
|
|
|
|
- this.$refs['form'].resetFields();
|
|
|
|
- this.$emit("onSuccess")
|
|
|
|
- this.dialogFormVisible = false
|
|
|
|
|
|
+ "content": this.form
|
|
})
|
|
})
|
|
|
|
+ console.log(res,"报价单id一")
|
|
|
|
+ /*this.$refs.quoterPrice.quoterPrice(res.data.sa_quotedpriceid,this.form.type)*/
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- projectList(){
|
|
|
|
- this.visibleProject = true
|
|
|
|
|
|
+ getSubmit(){
|
|
|
|
+ this.drawer = false
|
|
|
|
+ this.$emit('addSuccess')
|
|
},
|
|
},
|
|
- /*收件单位*/
|
|
|
|
- enterpriseList(){
|
|
|
|
- console.log(this.form.projectname)
|
|
|
|
- this.visibleEnterprise = true
|
|
|
|
|
|
+ project(){
|
|
|
|
+ this.projectDrawer = true
|
|
},
|
|
},
|
|
- /*联系人*/
|
|
|
|
- contactsList(){
|
|
|
|
- console.log(this.form.sys_enterpriseid)
|
|
|
|
- this.visibleContacts = true
|
|
|
|
|
|
+ customer(){
|
|
|
|
+ this.customerDrawer = true
|
|
},
|
|
},
|
|
- handleSizeChange(val) {
|
|
|
|
- // console.log(`每页 ${val} 条`);
|
|
|
|
- this.params.content.pageSize = val
|
|
|
|
- this.projectList()
|
|
|
|
|
|
+ contacts(){
|
|
|
|
+ this.contactsDrawer = true
|
|
},
|
|
},
|
|
- handleCurrentChange(val) {
|
|
|
|
- // console.log(`当前页: ${val}`);
|
|
|
|
- this.params.content.pageNumber = val
|
|
|
|
- this.projectList()
|
|
|
|
|
|
+ customerList(){
|
|
|
|
+ this.customerDrawer = false
|
|
},
|
|
},
|
|
- onProject(data){
|
|
|
|
- this.visible = false
|
|
|
|
- console.log("获取")
|
|
|
|
- console.log(data)
|
|
|
|
- /*this.form = data*/
|
|
|
|
- this.form.sa_projectid = data.sa_projectid
|
|
|
|
- this.form.projectname = data.projectname
|
|
|
|
- this.form.projectnum = data.projectnum
|
|
|
|
- this.form.address = data.address
|
|
|
|
- this.index = data.index
|
|
|
|
|
|
+ projectList(){
|
|
|
|
+ this.projectDrawer = false
|
|
},
|
|
},
|
|
- onEnterprise(data){
|
|
|
|
- this.visible = false
|
|
|
|
- console.log("企业信息")
|
|
|
|
- console.log(data)
|
|
|
|
- this.form.sys_enterpriseid = data.sys_enterpriseid
|
|
|
|
- this.form.enterprisename = data.enterprisename
|
|
|
|
-
|
|
|
|
|
|
+ contactsList(){
|
|
|
|
+ this.contactsDrawer = false
|
|
},
|
|
},
|
|
- onContacts(data){
|
|
|
|
- this.visible = false
|
|
|
|
- console.log("联系人信息")
|
|
|
|
- console.log(data)
|
|
|
|
- this.form.contactsid = data.contactsid
|
|
|
|
- this.form.name = data.name
|
|
|
|
- this.form.phonenumber = data.phonenumber
|
|
|
|
|
|
+ /*项目选择信息*/
|
|
|
|
+ projectData(val){
|
|
|
|
+ this.projectDrawer = false
|
|
|
|
+ this.form.sa_projectid = val.sa_projectid
|
|
|
|
+ this.form.projectname = val.projectname
|
|
|
|
+ this.form.projectnum = val.projectnum
|
|
},
|
|
},
|
|
- checkboxCallBack(data) {
|
|
|
|
- console.log("选择12354")
|
|
|
|
- console.log(data)
|
|
|
|
- this.projectData = data
|
|
|
|
|
|
+ /*客户选择信息*/
|
|
|
|
+ customerData(val){
|
|
|
|
+ this.contactsDrawer = false
|
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
},
|
|
},
|
|
- onClose(){
|
|
|
|
- this.dialogFormVisible = false
|
|
|
|
- this.$refs['form'].resetFields()
|
|
|
|
- }
|
|
|
|
|
|
+ /*联系人选择信息*/
|
|
|
|
+ contactsData(val){
|
|
|
|
+ this.contactsDrawer = false
|
|
|
|
+ this.form.contactsid = val.contactsid
|
|
|
|
+ this.form.name = val.name
|
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ console.log(this.data,"报价单")
|
|
|
|
+
|
|
|
|
+ /* const date = new Date()
|
|
|
|
+ console.log(date)
|
|
|
|
+ this.form.billdate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
|
|
|
+ console.log(this.form)*/
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.tablecols = this.tool.tabelCol(this.$route.name).projectTable.tablecols
|
|
|
|
|
|
+ console.log(this.data,"获取项目报价")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|