|
@@ -7,7 +7,7 @@
|
|
|
<div style="height:90%;overflow:auto">
|
|
<div style="height:90%;overflow:auto">
|
|
|
<Form :label-width='100' class="content">
|
|
<Form :label-width='100' class="content">
|
|
|
<FormItem label='项目编码:'>
|
|
<FormItem label='项目编码:'>
|
|
|
- <Input placeholder="请输入项目编码" v-model="formData.order_no" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
|
|
|
|
|
+ <Input placeholder="请输入项目编码" v-model="formData.order_no" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2" :disabled='$route.query.type!=1'/>
|
|
|
<span class="form_span" v-else>{{formData.order_no}}</span>
|
|
<span class="form_span" v-else>{{formData.order_no}}</span>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
<FormItem label='项目名称:'>
|
|
<FormItem label='项目名称:'>
|
|
@@ -27,7 +27,7 @@
|
|
|
<span class="form_span" v-else>{{formData.connect_phone}}</span>
|
|
<span class="form_span" v-else>{{formData.connect_phone}}</span>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
<FormItem label='项目阶段:'>
|
|
<FormItem label='项目阶段:'>
|
|
|
- <Select filterable clearable multiple v-model="formData.phase" placeholder="请选择" class="form_item" v-if="$route.query.type!=4">
|
|
|
|
|
|
|
+ <Select filterable clearable multiple v-model="formData.phase" placeholder="请选择" class="form_item" v-if="$route.query.type!=4" @on-change='changePhase'>
|
|
|
<Option v-for="(item,index) in agreementList" :key="index" :value="item.id" :label="item.title"></Option>
|
|
<Option v-for="(item,index) in agreementList" :key="index" :value="item.id" :label="item.title"></Option>
|
|
|
</Select>
|
|
</Select>
|
|
|
<span class="form_span" v-else>{{getPhase()}}</span>
|
|
<span class="form_span" v-else>{{getPhase()}}</span>
|
|
@@ -52,6 +52,10 @@
|
|
|
<Input v-model="formData.customer_id" placeholder="请输入金螳螂ID" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
<Input v-model="formData.customer_id" placeholder="请输入金螳螂ID" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
|
<span class="form_span" v-else>{{formData.customer_id}}</span>
|
|
<span class="form_span" v-else>{{formData.customer_id}}</span>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
|
|
+ <FormItem label='投标金额:'>
|
|
|
|
|
+ <Input v-model="formData.bid_price" placeholder="请输入投标金额" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
|
|
|
+ <span class="form_span" v-else>{{formData.bid_price}}</span>
|
|
|
|
|
+ </FormItem>
|
|
|
<FormItem label='合同金额:'>
|
|
<FormItem label='合同金额:'>
|
|
|
<Input placeholder="请输入合同金额" v-model="formData.agreement_price" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
<Input placeholder="请输入合同金额" v-model="formData.agreement_price" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
|
<span class="form_span" v-else>{{formData.agreement_price}}</span>
|
|
<span class="form_span" v-else>{{formData.agreement_price}}</span>
|
|
@@ -97,9 +101,21 @@
|
|
|
</Form>
|
|
</Form>
|
|
|
<Card>
|
|
<Card>
|
|
|
<p slot="title">
|
|
<p slot="title">
|
|
|
- 图号
|
|
|
|
|
|
|
+ 清单
|
|
|
</p>
|
|
</p>
|
|
|
- <div slot="extra" v-if="$route.query.type!=4">
|
|
|
|
|
|
|
+ <div slot="extra" v-if="$route.query.type!=4" style="display:flex">
|
|
|
|
|
+
|
|
|
|
|
+ <Upload
|
|
|
|
|
+ v-if="$route.query.type!=3||$route.query.type!=4"
|
|
|
|
|
+ multiple
|
|
|
|
|
+ :headers="headers"
|
|
|
|
|
+ :show-upload-list="false"
|
|
|
|
|
+ :on-success="handleTotalTableSuccess"
|
|
|
|
|
+ :action="$store.state.ip+'/api/upload_image'"
|
|
|
|
|
+ style="margin-right:10px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Button type="primary" size='small'>批量上传图片</Button>
|
|
|
|
|
+ </Upload>
|
|
|
<Button type="primary" style="margin-right:10px" @click="totalDel" size='small'>批量删除</Button>
|
|
<Button type="primary" style="margin-right:10px" @click="totalDel" size='small'>批量删除</Button>
|
|
|
<Upload
|
|
<Upload
|
|
|
style="display:inline"
|
|
style="display:inline"
|
|
@@ -111,22 +127,45 @@
|
|
|
:action="$store.state.ip + '/api/contract_import'"
|
|
:action="$store.state.ip + '/api/contract_import'"
|
|
|
>
|
|
>
|
|
|
<Button type="primary" style="margin-right:10px;" size='small'
|
|
<Button type="primary" style="margin-right:10px;" size='small'
|
|
|
- >图号导入</Button
|
|
|
|
|
|
|
+ >导入</Button
|
|
|
>
|
|
>
|
|
|
</Upload>
|
|
</Upload>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <Table :data='tableData' :columns='$route.query.type==1||$route.query.type==2?tableColumns:editTableColumns' border max-height='620' @on-selection-change='handleSelect'>
|
|
|
|
|
|
|
+ <Table :data='tableData' :columns='$route.query.type==1||$route.query.type==2?tableColumns:editTableColumns' border max-height='620' @on-selection-change='handleSelect' show-summary :summary-method="handleSummary">
|
|
|
<template slot="set" slot-scope="{index}">
|
|
<template slot="set" slot-scope="{index}">
|
|
|
<a @click="del(index)">删除</a>
|
|
<a @click="del(index)">删除</a>
|
|
|
</template>
|
|
</template>
|
|
|
- <template slot="agreement_price" slot-scope="{row,index}">
|
|
|
|
|
- <Input v-model="tableData[index].agreement_price" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
|
|
|
- <span v-else>{{row.agreement_price}}</span>
|
|
|
|
|
|
|
+ <template slot="bp_id" slot-scope="{row,index}">
|
|
|
|
|
+ <Select v-model="row.bp_id" @on-change='selectBpId($event,index)' filterable clearable :transfer='true'>
|
|
|
|
|
+ <Option v-for="(item,index) in bp_list" :key="index" :value="item.id" :label='item.title'/>
|
|
|
|
|
+ </Select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template slot="product_img" slot-scope="{row,index}">
|
|
|
|
|
+ <div>
|
|
|
|
|
+
|
|
|
|
|
+ <Upload
|
|
|
|
|
+ v-if="!row.product_img&&($route.query.type!=3||$route.query.type!=4)"
|
|
|
|
|
+ :headers="headers"
|
|
|
|
|
+ :show-upload-list="false"
|
|
|
|
|
+ :on-success="handleTableSuccess"
|
|
|
|
|
+ :action="$store.state.ip+'/api/upload_image'">
|
|
|
|
|
+ <a @click="updTableImg(index)">上传</a>
|
|
|
|
|
+ </Upload>
|
|
|
|
|
+ <div v-show="row.product_img" class="img_box">
|
|
|
|
|
+ <img @click="looks(row.product_img,true)" :src="$store.state.ip + row.product_img" alt="" class="img_table_content"/>
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-if="$route.query.type!=4"
|
|
|
|
|
+ size="20"
|
|
|
|
|
+ @click="delTableItems(row,index)"
|
|
|
|
|
+ class="delete-img"
|
|
|
|
|
+ type="ios-close-circle"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
- <template slot="quantity_price" slot-scope="{row,index}">
|
|
|
|
|
- <Input v-model="tableData[index].quantity_price" clearable v-if="$route.query.type==1||$route.query.type==2"/>
|
|
|
|
|
- <span v-else>{{row.quantity_price}}</span>
|
|
|
|
|
|
|
+ <template slot="total_bid_price" slot-scope="{row,index}">
|
|
|
|
|
+ <Input v-model="row.total_bid_price" @on-change='changeTotalBidPrice($event,index)' type="number" @on-blur='checkPrice(row,index)'/>
|
|
|
</template>
|
|
</template>
|
|
|
</Table>
|
|
</Table>
|
|
|
</Card>
|
|
</Card>
|
|
@@ -145,6 +184,8 @@
|
|
|
export default {
|
|
export default {
|
|
|
data(){
|
|
data(){
|
|
|
return{
|
|
return{
|
|
|
|
|
+ tableIndex:null,
|
|
|
|
|
+ bp_list:[],
|
|
|
showPicIndex:null,
|
|
showPicIndex:null,
|
|
|
showList:[],
|
|
showList:[],
|
|
|
list:[],
|
|
list:[],
|
|
@@ -153,6 +194,7 @@ export default {
|
|
|
selectData:[],
|
|
selectData:[],
|
|
|
agreementList:[{title:'立项',is_show:false,id:1},{title:'评审',is_show:false,id:2},{title:'报价',is_show:false,id:3},{title:'投标',is_show:false,id:4},{title:'中标',is_show:false,id:5},{title:'废标',is_show:false,id:6}],
|
|
agreementList:[{title:'立项',is_show:false,id:1},{title:'评审',is_show:false,id:2},{title:'报价',is_show:false,id:3},{title:'投标',is_show:false,id:4},{title:'中标',is_show:false,id:5},{title:'废标',is_show:false,id:6}],
|
|
|
formData:{
|
|
formData:{
|
|
|
|
|
+ bid_price:'',
|
|
|
order_no:'',
|
|
order_no:'',
|
|
|
project_title:'',
|
|
project_title:'',
|
|
|
project_address:'',
|
|
project_address:'',
|
|
@@ -169,29 +211,105 @@ export default {
|
|
|
},
|
|
},
|
|
|
tableData:[],
|
|
tableData:[],
|
|
|
tableColumns:[
|
|
tableColumns:[
|
|
|
- {type:'selection',minWidth:80,align:'center'},
|
|
|
|
|
- {title:'序号',type:'index',align:'center',minWidth:80},
|
|
|
|
|
- {title:'图号',minWidth:100,align:'center',key:'url_number'},
|
|
|
|
|
|
|
+ {type:'selection',minWidth:80,align:'center',key:'select'},
|
|
|
|
|
+ {title:'序号',type:'index',align:'center',minWidth:80,key:'index'},
|
|
|
|
|
+ {title:'区域',minWidth:100,align:'center',key:'region'},
|
|
|
|
|
+ {title:'产品分类',minWidth:100,align:'center',key:'bp_id',slot:'bp_id'},
|
|
|
{title:'产品名称',minWidth:100,align:'center',key:'product_title'},
|
|
{title:'产品名称',minWidth:100,align:'center',key:'product_title'},
|
|
|
- {title:'平方数',minWidth:100,align:'center',key:'area'},
|
|
|
|
|
- {title:'合同金额',minWidth:100,align:'center',key:'agreement_price',slot:'agreement_price'},
|
|
|
|
|
- {title:'核量金额',minWidth:100,align:'center',key:'quantity_price',slot:'quantity_price'},
|
|
|
|
|
- {title:'操作',minWidth:100,align:'center',key:'set',slot:'set'},
|
|
|
|
|
|
|
+ {title:'产品图片',minWidth:100,align:'center',key:'product_img',slot:'product_img'},
|
|
|
|
|
+ {title:'产品特征',minWidth:100,align:'center',key:'product_feature'},
|
|
|
|
|
+ {title:'计量单位',minWidth:100,align:'center',key:'unit'},
|
|
|
|
|
+ {title:'工程量',minWidth:100,align:'center',key:'num'},
|
|
|
|
|
+ {title:'投标单价',minWidth:100,align:'center',key:'bid_price'},
|
|
|
|
|
+ {title:'投标金额',minWidth:100,align:'center',key:'total_bid_price',slot:'total_bid_price'},
|
|
|
|
|
+ {title:'操作',minWidth:100,align:'center',key:'set',slot:'set'}
|
|
|
],
|
|
],
|
|
|
editTableColumns:[
|
|
editTableColumns:[
|
|
|
- {title:'序号',type:'index',align:'center',minWidth:80},
|
|
|
|
|
- {title:'图号',minWidth:100,align:'center',key:'url_number'},
|
|
|
|
|
|
|
+ {title:'序号',type:'index',align:'center',minWidth:80,key:'index'},
|
|
|
|
|
+ {title:'区域',minWidth:100,align:'center',key:'region'},
|
|
|
|
|
+ {title:'产品分类',minWidth:100,align:'center',key:'bp_id'},
|
|
|
{title:'产品名称',minWidth:100,align:'center',key:'product_title'},
|
|
{title:'产品名称',minWidth:100,align:'center',key:'product_title'},
|
|
|
- {title:'平方数',minWidth:100,align:'center',key:'area'},
|
|
|
|
|
- {title:'合同金额',minWidth:100,align:'center',key:'agreement_price',slot:'agreement_price'},
|
|
|
|
|
- {title:'核量金额',minWidth:100,align:'center',key:'quantity_price',slot:'quantity_price'},
|
|
|
|
|
|
|
+ {title:'产品图片',minWidth:100,align:'center',key:'product_img'},
|
|
|
|
|
+ {title:'产品特征',minWidth:100,align:'center',key:'product_feature'},
|
|
|
|
|
+ {title:'计量单位',minWidth:100,align:'center',key:'unit'},
|
|
|
|
|
+ {title:'工程量',minWidth:100,align:'center',key:'num'},
|
|
|
|
|
+ {title:'投标单价',minWidth:100,align:'center',key:'bid_price'},
|
|
|
|
|
+ {title:'投标金额',minWidth:100,align:'center',key:'total_bid_price'}
|
|
|
|
|
+
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ created(){
|
|
|
|
|
+ (this.$route.query.type==1||this.$route.query.type==2)&&this.axios.get('/api/basics_product_index').then(res=>{
|
|
|
|
|
+ this.bp_list = res.data.data
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
mounted(){
|
|
mounted(){
|
|
|
this.$route.query.type!=1&&this.initData();
|
|
this.$route.query.type!=1&&this.initData();
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
|
|
+ checkPrice(row,index){
|
|
|
|
|
+ if(row.total_bid_price<0){
|
|
|
|
|
+ row.total_bid_price = '0.00';
|
|
|
|
|
+ this.tableData[index].total_bid_price = '0.00'
|
|
|
|
|
+ }else{
|
|
|
|
|
+ row.total_bid_price = Number(row.total_bid_price).toFixed(2);
|
|
|
|
|
+ this.tableData[index].total_bid_price=Number(this.tableData[index].total_bid_price).toFixed(2);
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ changeTotalBidPrice(e,index){
|
|
|
|
|
+ this.tableData[index].total_bid_price = e.target.value;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSummary ({ columns, data }) {
|
|
|
|
|
+ const sums = {};
|
|
|
|
|
+ columns.forEach((column, index) => {
|
|
|
|
|
+ const key = column.key;
|
|
|
|
|
+ if (key === 'index') {
|
|
|
|
|
+ sums[key] = {
|
|
|
|
|
+ key,
|
|
|
|
|
+ value: '合计'
|
|
|
|
|
+ };
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const values = data.map(item => Number(item[key]));
|
|
|
|
|
+ if (key=='total_bid_price') {
|
|
|
|
|
+ const v = values.reduce((prev, curr) => {
|
|
|
|
|
+ const value = Number(curr);
|
|
|
|
|
+ if (!isNaN(value)) {
|
|
|
|
|
+ return prev + curr;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return prev;
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+ sums[key] = {
|
|
|
|
|
+ key,
|
|
|
|
|
+ value: (v*1).toFixed(2)
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.formData.bid_price = (v*1).toFixed(2);
|
|
|
|
|
+ if(this.formData.phase.indexOf(5)>=0){
|
|
|
|
|
+ this.formData.agreement_price = this.formData.bid_price;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ sums[key] = {
|
|
|
|
|
+ key,
|
|
|
|
|
+ value:''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return sums;
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ selectBpId(e,index){
|
|
|
|
|
+ this.tableData[index].bp_id = e;
|
|
|
|
|
+ },
|
|
|
|
|
+ changePhase(e){
|
|
|
|
|
+ if(e.indexOf(5)>=0){
|
|
|
|
|
+ this.formData.agreement_price = this.formData.bid_price;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
getPhase(){
|
|
getPhase(){
|
|
|
let arr = [];
|
|
let arr = [];
|
|
|
arr = this.agreementList.filter(v=>{
|
|
arr = this.agreementList.filter(v=>{
|
|
@@ -206,6 +324,10 @@ export default {
|
|
|
delItems(n, arr) {
|
|
delItems(n, arr) {
|
|
|
arr.splice(n, 1);
|
|
arr.splice(n, 1);
|
|
|
},
|
|
},
|
|
|
|
|
+ delTableItems(row,index){
|
|
|
|
|
+ row.product_img = '';
|
|
|
|
|
+ this.tableData[index].product_img = '';
|
|
|
|
|
+ },
|
|
|
looks(img,type) {
|
|
looks(img,type) {
|
|
|
if(!type){
|
|
if(!type){
|
|
|
return
|
|
return
|
|
@@ -251,6 +373,30 @@ export default {
|
|
|
recordIndex(index){
|
|
recordIndex(index){
|
|
|
this.showPicIndex = index;
|
|
this.showPicIndex = index;
|
|
|
},
|
|
},
|
|
|
|
|
+ handleTotalTableSuccess(res,file){
|
|
|
|
|
+ if(file.name.indexOf('+')<0){
|
|
|
|
|
+ return this.$Message.error("请上传‘区域’+‘产品名称’的图片名称!")
|
|
|
|
|
+ }
|
|
|
|
|
+ if(res.code==200){
|
|
|
|
|
+ let content = file.name.split('.')[0];
|
|
|
|
|
+
|
|
|
|
|
+ let arr = content.split('+');
|
|
|
|
|
+ console.log(arr);
|
|
|
|
|
+ this.tableData.forEach((v,index)=>{
|
|
|
|
|
+ if(v.region===arr[0]&&v.product_title===arr[1]){
|
|
|
|
|
+ this.tableData[index].product_img = res.data.url;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleTableSuccess(res,file){
|
|
|
|
|
+ if(res.code==200){
|
|
|
|
|
+ this.tableData[this.tableIndex].product_img = res.data.url;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ updTableImg(index){
|
|
|
|
|
+ this.tableIndex = index;
|
|
|
|
|
+ },
|
|
|
handleSuccess(res,file){
|
|
handleSuccess(res,file){
|
|
|
if(res.code==200){
|
|
if(res.code==200){
|
|
|
let obj = {};
|
|
let obj = {};
|
|
@@ -331,13 +477,13 @@ export default {
|
|
|
res.data.forEach(v => {
|
|
res.data.forEach(v => {
|
|
|
let arr = [];
|
|
let arr = [];
|
|
|
arr = this.tableData.filter(x=>{
|
|
arr = this.tableData.filter(x=>{
|
|
|
- return x.url_number == v.url_number
|
|
|
|
|
|
|
+ return x.region == v.region&&x.product_title == v.product_title
|
|
|
})
|
|
})
|
|
|
if(arr.length==0){
|
|
if(arr.length==0){
|
|
|
data.push(v);
|
|
data.push(v);
|
|
|
}else{
|
|
}else{
|
|
|
this.tableData.forEach((ele,index)=>{
|
|
this.tableData.forEach((ele,index)=>{
|
|
|
- if(ele.url_number == v.url_number){
|
|
|
|
|
|
|
+ if(ele.region == v.region&&ele.product_title == v.product_title){
|
|
|
data.splice(index,1,v)
|
|
data.splice(index,1,v)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -440,6 +586,10 @@ export default {
|
|
|
width: 150px;
|
|
width: 150px;
|
|
|
height: 150px;
|
|
height: 150px;
|
|
|
}
|
|
}
|
|
|
|
|
+.img_table_content{
|
|
|
|
|
+ width: 50px;
|
|
|
|
|
+ height: 50px;
|
|
|
|
|
+}
|
|
|
.delete-img {
|
|
.delete-img {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
right: 0px;
|
|
right: 0px;
|
|
@@ -465,4 +615,7 @@ export default {
|
|
|
width: 100px;
|
|
width: 100px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+.img_box{
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|