Commit b9777807 by 严立

竞价更新

parent 6755508d
......@@ -63,7 +63,6 @@ let output = {
if (funcDataType === 'object') {
let funcResultData = JSON.parse(funcResult)
switch (Number(funcResultData.code)) {
case 10001:
console.log('token overdue')
......
......@@ -58,6 +58,13 @@ let output = {
} else {
iVue.$message.error(funcInterceptorsResponse.response.message)
}
} else {
let funcInterceptorsResponse = iInterceptors.response(funcConfigure, funcXMLHttpRequest.responseText)
if (funcInterceptorsResponse.state) {
funcResolve(funcInterceptorsResponse.response)
} else {
iVue.$message.error(funcInterceptorsResponse.response.message)
}
}
}
}).catch((funcError) => {
......@@ -94,6 +101,13 @@ let output = {
} else {
iVue.$message.error(funcInterceptorsResponse.response.message)
}
} else {
let funcInterceptorsResponse = iInterceptors.response(funcConfigure, funcXMLHttpRequest.responseText)
if (funcInterceptorsResponse.state) {
funcResolve(funcInterceptorsResponse.response)
} else {
iVue.$message.error(funcInterceptorsResponse.response.message)
}
}
}
}).catch((funcError) => {
......
......@@ -37,6 +37,24 @@
}
},
computed: {
areaSelection: function () {
return this.$store.state.areaSelection
},
},
watch: {
areaSelection: {
handler: function (funcNewValue, funcOldValue) {
if (funcNewValue.length > 0) {
this.initSelect()
}
},
deep: true,
immediate: true,
},
},
created: function () {
this.setArea()
this.setCity()
......
......@@ -27,11 +27,11 @@
},
computed: {
componentSkill: function () {
return this.$store.state.componentSkill
selectionSkill: function () {
return this.$store.state.selectionSkill
},
componentSkillData: function () {
return this.$store.state.componentSkillData
dictionarySkill: function () {
return this.$store.state.dictionarySkill
}
},
......@@ -43,21 +43,22 @@
deep: true,
immediate: true,
},
componentSkill: {
selectionSkill: {
handler: function (funcNewValue, funcOldValue) {
if (funcNewValue.length > 0 && this.skillAll.length > 0) {
console.log('selectionSkill', funcNewValue)
if (funcNewValue.length > 0) {
this.selectionIndex = funcNewValue[this.identity]
this.isReady()
if (this.skillAll.length > 0) this.isReady()
}
},
deep: true,
immediate: true,
},
componentSkillData: {
dictionarySkill: {
handler: function (funcNewValue, funcOldValue) {
if (funcNewValue.length > 0) {
this.skillAll = funcNewValue
this.isReady()
if (this.selectionIndex && this.selectionIndex.length > 0) this.isReady()
}
},
deep: true,
......@@ -83,14 +84,9 @@
}
funcList.push(funcItem)
}
// console.log('funcList', funcList)
// console.log('funcSelectionIndex', funcSelectionIndex)
funcSkillOption.push(funcList)
funcSkillItem.push(funcList[funcSelectionIndex])
// console.log(funcSkillItem)
// 判断是否需要继续遍历
if (funcSkillItem[funcSkillItem.length - 1].isChildren) {
let funcSelectionIndex = funcLevel
......@@ -119,9 +115,9 @@
},
saveSelection: function () {
let funcSaveSelection = this.$store.getters.componentSkill
let funcSaveSelection = this.$store.getters.selectionSkill
funcSaveSelection[this.identity] = this.selectionIndex
this.$store.commit('componentSkill', funcSaveSelection)
this.$store.commit('selectionSkill', funcSaveSelection)
},
returnSelectionId: function () {
......
......@@ -22,8 +22,8 @@ export default new Vuex.Store({
contractSelection: {},
// 专家注册组件
componentSkill: [],
componentSkillData: [],
selectionSkill: [], // 技能选择缓存
dictionarySkill: [], // 技能数据字典
......@@ -94,11 +94,11 @@ export default new Vuex.Store({
state.contractSelection = value
},
componentSkill: function (state, value) {
state.componentSkill = value
selectionSkill: function (state, value) {
state.selectionSkill = value
},
componentSkillData: function (state, value) {
state.componentSkillData = value
dictionarySkill: function (state, value) {
state.dictionarySkill = value
},
redirectPath: function (state, value) {
......@@ -179,12 +179,12 @@ export default new Vuex.Store({
return state.contractSelection
},
componentSkill: function (state) {
return state.componentSkill
selectionSkill: function (state) {
return state.selectionSkill
},
componentSkillData: function (state) {
return state.componentSkillData
dictionarySkill: function (state) {
return state.dictionarySkill
},
......
......@@ -61,35 +61,21 @@
<!-- 合同列表 - 竞价 -->
<div v-if="[0].indexOf(noticeType) >= 0 && tableShow" class="info-item">
<div v-for="(item, index) in componentContract" :key="index">
<el-table :data="[componentContract[index]]" stripe :show-header="!index" :header-cell-style="tableHeaderStyle">
<el-table-column label="合同包" width="80" align="center">
<template>
<div class="global-cursor quote-record col">
<span>{{index + 1}}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="object" label="标的"></el-table-column>
<el-table-column prop="requirement" label="参数要求"></el-table-column>
<el-table-column prop="quantity" label="数量" align="center"></el-table-column>
<el-table-column prop="budget" label="限价(元)" align="center"></el-table-column>
<el-table-column align="center">
<template slot-scope="scope">
<div class="global-cursor row">
<span class="global-color-blue" @click="onQueryQuoteRecord(index, scope.row)">报价记录</span>
<span v-if="scope.row.isWin" class="is-win global-color-green">中标</span>
</div>
</template>
</el-table-column>
</el-table>
<div v-if="quoteRecordActive === index" class="quote-record-list">
<div v-for="(item, index) in quoteRecordList" :key="index" class="row">
<span>{{'报价时间:' + item.time}}</span>
<span>{{'报价价格:' + item.price + ' 元'}}</span>
</div>
</div>
</div>
<el-table :data="componentContract" stripe :header-cell-style="tableHeaderStyle">
<el-table-column type="index" label="合同包" width="80" align="center"></el-table-column>
<el-table-column prop="object" label="标的"></el-table-column>
<el-table-column prop="requirement" label="参数要求"></el-table-column>
<el-table-column prop="quantity" label="数量" align="center"></el-table-column>
<el-table-column prop="budget" label="限价(元)" align="center"></el-table-column>
<el-table-column align="center">
<template slot-scope="scope">
<div class="global-cursor row">
<span class="global-color-blue" @click="onQueryQuoteRecord(scope.row)">报价记录</span>
<span v-if="scope.row.isWin" class="is-win global-color-green">中标</span>
</div>
</template>
</el-table-column>
</el-table>
</div>
<!-- 竞价说明 -->
......@@ -129,7 +115,7 @@
<!-- 竞价报价 -->
<el-dialog title="我要报价" :visible.sync="winQuote" :lock-scroll="false" width="1000px" :close-on-click-modal="false">
<div v-if="winOfferSelect">
<div v-if="winQuoteSelection">
<div class="offer-progress row">
<div class="offer-progress-select offer-progress-active row con-c align-c">
<span>选择合同包</span>
......@@ -151,7 +137,7 @@
</span>
</div>
<div v-if="winOfferPrice">
<div v-if="winQuoteInput">
<div class="offer-progress row">
<div class="offer-progress-price row con-c align-c">
<span>选择合同包</span>
......@@ -185,6 +171,15 @@
<!-- 竞价报价记录 -->
<el-dialog title="提示" :visible.sync="winQuoteRecord" :lock-scroll="false" width="400px" :close-on-click-modal="false">
<div class="row con-c">
<span>报价记录</span>
</div>
</el-dialog>
<!-- 下载标书 -->
<el-dialog title="下载标书" :visible.sync="winDocument" :lock-scroll="false" width="1000px" :close-on-click-modal="false">
<el-table :data="componentContract" stripe :header-cell-style="tableHeaderStyle" @selection-change="(selection) => onTableSelectionChange('document', selection)">
......@@ -271,8 +266,9 @@
winContract: false,
winDocument: false,
winQuote: false,
winOfferSelect: false,
winOfferPrice: false,
winQuoteInput: false,
winQuoteRecord: false,
winQuoteSelection: false,
windowChangeTimer: 0,
}
......@@ -433,32 +429,34 @@
},
onQueryQuoteRecord: function (funcIndex, funcItem) {
this.quoteRecordList = []
this.quoteRecordActive = funcIndex
let funcParam = {
'pageNo': 1,
'pageSize': 5,
'biddingPackageId': funcItem.id,
}
iRequest.request(iHost.base + 'bid/zBiddingPackageOffer/packageHaveBidLogs', funcParam, 'json', 'post')
.then((funcResponse) => {
let funcRawData = funcResponse.page.list
let funcList = []
for (let i = 0, len = funcRawData.length; i < len; i++) {
let funcItem = {
'time': funcRawData[i].createDate,
'price': funcRawData[i].price,
}
funcList.push(funcItem)
}
this.quoteRecordList = funcList
if (this.quoteRecordList.length === 0) {
this.quoteRecordList.push({ 'time': '暂无报价', 'price': 0 })
}
})
onQueryQuoteRecord: function (funcItem) {
console.log(funcItem)
this.winQuoteRecord = true
// this.quoteRecordList = []
// this.quoteRecordActive = funcIndex
// let funcParam = {
// 'pageNo': 1,
// 'pageSize': 5,
// 'biddingPackageId': funcItem.id,
// }
// iRequest.request(iHost.base + 'bid/zBiddingPackageOffer/packageHaveBidLogs', funcParam, 'json', 'post')
// .then((funcResponse) => {
// let funcRawData = funcResponse.page.list
// let funcList = []
// for (let i = 0, len = funcRawData.length; i < len; i++) {
// let funcItem = {
// 'time': funcRawData[i].createDate,
// 'price': funcRawData[i].price,
// }
// funcList.push(funcItem)
// }
// this.quoteRecordList = funcList
// if (this.quoteRecordList.length === 0) {
// this.quoteRecordList.push({ 'time': '暂无报价', 'price': 0 })
// }
// })
},
onInterceptQuoteRecord: function () {
......@@ -595,16 +593,16 @@
*/
onQuote: function () {
this.winQuote = true
this.winOfferSelect = true
this.winOfferPrice = false
this.winQuoteSelection = true
this.winQuoteInput = false
this.tableSelection = []
this.tableQuote = []
this.tableQuoteBuffer = []
},
onPricePrevious: function () {
this.winOfferSelect = true
this.winOfferPrice = false
this.winQuoteSelection = true
this.winQuoteInput = false
this.tableSelection = []
this.tableQuote = []
this.tableQuoteBuffer = []
......@@ -613,8 +611,8 @@
onPriceNext: function (funcType) {
switch (funcType) {
case 'offer':
this.winOfferSelect = false
this.winOfferPrice = true
this.winQuoteSelection = false
this.winQuoteInput = true
break
case 'submit':
......
......@@ -73,13 +73,22 @@ let output = function (thisVue, id, type, isPreview) {
// 计算 a 的索引权重
let funcIndex = a.index.toString().split('-')
let funcA = Number(funcIndex[0]) * funcMainWeight
if (funcIndex[1]) funcA = funcA + Number(funcIndex[1])
if (funcIndex[1]) {
a.isChild = true
funcA = funcA + Number(funcIndex[1])
} else {
a.isChild = false
}
// 计算 b 的索引权重
funcIndex = b.index.toString().split('-')
let funcB = Number(funcIndex[0]) * funcMainWeight
if (funcIndex[1]) funcB = funcB + Number(funcIndex[1])
if (funcIndex[1]) {
b.isChild = true
funcB = funcB + Number(funcIndex[1])
} else {
b.isChild = false
}
return funcA - funcB
})
......@@ -91,6 +100,16 @@ let output = function (thisVue, id, type, isPreview) {
'budget': funcRawData[i].fixedPrice, // 预算金额
'quantity': funcRawData[i].num, // 标的数量
'requirement': funcRawData[i].requirement, // 竞价参数要求
'isChild': funcRawData[i].isChild,
}
if (!funcItem.isChild) {
if (funcRawData[i + 1] && funcRawData[i + 1].isChild) {
funcItem.haveChild = true
} else {
funcItem.haveChild = false
}
} else {
funcItem.haveChild = false
}
funcPackage.push(funcItem)
}
......
......@@ -146,8 +146,8 @@
</div>
<!-- 竞价报价 -->
<el-dialog title="我要报价" :visible.sync="winOffer" :lock-scroll="false" width="1200px" :close-on-click-modal="false">
<div v-if="winOfferSelect">
<el-dialog title="我要报价" :visible.sync="winQuote" :lock-scroll="false" width="1000px" :close-on-click-modal="false">
<div v-if="winQuoteSelection">
<div class="offer-progress row">
<div class="offer-progress-select offer-progress-active row con-c align-c">
<span>选择合同包</span>
......@@ -156,7 +156,7 @@
<span>填写报价</span>
</div>
</div>
<el-table :data="componentContract" key="select" stripe :header-cell-style="tableHeaderStyle" @selection-change="(selection) => onTableSelectionChange('offer', selection)">
<el-table :data="componentContract" key="select" stripe :header-cell-style="tableHeaderStyle" :row-class-name="setChildHide" @selection-change="selectionQuote">
<el-table-column type="selection" width="60" align="center" :selectable="onTableUnableSelection"></el-table-column>
<el-table-column prop="index" label="合同包" width="120" align="center"></el-table-column>
<el-table-column prop="object" label="标的" min-width="100"></el-table-column>
......@@ -165,11 +165,11 @@
</el-table>
<span slot="footer" class="dialog-footer row con-c align-c">
<el-button v-if="tableSelection.length === 0" disable class="dialog-disable-button">确 定</el-button>
<el-button v-if="tableSelection.length >= 1" class="dialog-button" @click="onPriceNext('offer')">确 定</el-button>
<el-button v-if="tableSelection.length >= 1" class="dialog-button" @click="onQuoteNext()">确 定</el-button>
</span>
</div>
<div v-if="winOfferPrice">
<div v-if="winQuoteInput">
<div class="offer-progress row">
<div class="offer-progress-price row con-c align-c">
<span>选择合同包</span>
......@@ -178,34 +178,40 @@
<span>填写报价</span>
</div>
</div>
<el-table :data="tableQuoteBuffer" key="offer" stripe :header-cell-style="tableHeaderStyle" @selection-change="(selection) => onTableSelectionChange('price', selection)">
<el-table :data="tableQuote" key="offer" stripe :header-cell-style="tableHeaderStyle" @selection-change="selectionQuote">
<el-table-column prop="index" label="合同包" width="120" align="center"></el-table-column>
<el-table-column prop="object" label="标的" min-width="100"></el-table-column>
<el-table-column prop="requirement" label="参数要求" min-width="230"></el-table-column>
<el-table-column prop="requirement" label="参数要求" min-width="200" align="center"></el-table-column>
<el-table-column prop="quantity" label="数量" width="120" align="center"></el-table-column>
<el-table-column prop="price" label="报价金额(元)" min-width="100" align="center">
<template slot-scope="scope">
<div class="quote-table col">
<div v-if="Boolean(scope.row.haveChild)" class="quote-table col">
<span> </span>
<span >{{scope.row.price}}</span>
<span class="global-color-red">{{scope.row.tip}}</span>
</div>
<div v-if="!Boolean(scope.row.haveChild)" class="quote-table col">
<span> </span>
<el-input size="small" v-model="scope.row.price" maxlength="14" @change="(value) => { onQuoteInput(value, scope.$index, scope.row) }"></el-input>
<span class="global-color-red">{{scope.row.tip}}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="300" align="center">
<el-table-column prop="price" label="备注" min-width="30" align="center">
<template slot-scope="scope">
<div class="quote-table col">
<span> </span>
<el-input size="small" v-model="scope.row.remark" maxlength="50" @change="(value) => { onQuoteInput(value, scope.$index, scope.row) }"></el-input>
<span class="global-color-red">{{scope.row.tip}}</span>
<div v-if="Boolean(scope.row.haveChild)" class="quote-table col">
<i class="el-icon-edit-outline"></i>
</div>
<div v-if="!Boolean(scope.row.haveChild)" class="quote-table col">
<i class="el-icon-edit-outline" @click="onQuoteNote(scope.row, scope.$index)"></i>
</div>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer row con-c align-c">
<el-button class="global-routine-button" @click="onPricePrevious()">上一步</el-button>
<el-button class="global-routine-button" @click="onQuotePrevious()">上一步</el-button>
<el-button v-if="tableSelection.length === 0" disable class="dialog-disable-button">提交报价</el-button>
<el-button v-if="tableSelection.length >= 1" class="dialog-button" @click="onPriceNext('submit')">提交报价</el-button>
<el-button v-if="tableSelection.length >= 1" class="dialog-button" @click="onQuoteSubmit()">提交报价</el-button>
</span>
</div>
</el-dialog>
......@@ -252,6 +258,14 @@
<el-button class="dialog-button" @click="winTip = false">确定</el-button>
</span>
</el-dialog>
<el-dialog title="填写报价备注" :visible.sync="winQuoteNote" :lock-scroll="false" width="400px" :close-on-click-modal="false">
<el-input type="textarea" v-model="tableNote" maxlength="500" :autosize="{ minRows: 4 }" show-word-limit></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="winQuoteNote = false">取 消</el-button>
<el-button type="primary" @click="onQuoteNoteSubmit()">确 定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
......@@ -322,8 +336,9 @@
background: '#F2F2F2'
},
maxQuote: 1000000000000,
tableQuote: [], // 报价数据提交
tableQuoteBuffer: [], // 报价填写数据缓存
tableQuote: [], // 竞价合同数据
tableNote: '', // 竞价注释
tableNoteIndex: 0, // 竞价注释索引
isbuy: false,
isSignIn: false,
......@@ -333,9 +348,10 @@
winTip: false,
winContract: false,
winDocument: false,
winOffer: false,
winOfferSelect: false,
winOfferPrice: false,
winQuote: false,
winQuoteInput: false,
winQuoteSelection: false, // 竞价合同选择
winQuoteNote: false, // 竞价 - 报价备注
}
},
......@@ -368,8 +384,6 @@
this.componentFile = funcFile
this.componentNotice = funcOther
console.log(JSON.stringify(this.componentContract))
// 竞价公告查询最新报价
if ([0].indexOf(funcProject.noticeType) >= 0) {
iRequest.request(iHost.base + 'bid/zBiddingProject/recentQuotation', { 'projectId': funcProject.projectId }, 'json', 'post')
......@@ -421,6 +435,14 @@
}
},
setChildHide: function (funcRow, funcIndex) {
if (funcRow.row.isChild) {
return 'table-row-hide'
} else {
return ''
}
},
/**
* 报名
* @function
......@@ -550,8 +572,6 @@
* @returns
*/
onTableSelectionChange: function (funcType, funcSelection) {
console.log(funcSelection)
switch (funcType) {
case 'contract':
let funcContractSelection = {}
......@@ -573,28 +593,6 @@
case 'document':
this.tableSelection = funcSelection
break
case 'offer':
this.tableSelection = funcSelection
this.tableQuoteBuffer = []
for (let i = 0, len = funcSelection.length; i < len; i++) {
let funcItem = {
'index': funcSelection[i].index,
'id': funcSelection[i].id,
'name': funcSelection[i].name,
'price': '',
'object': funcSelection[i].object,
'budget': funcSelection[i].budget,
'quantity': funcSelection[i].quantity,
'requirement': funcSelection[i].requirement,
'tip': '',
'remark': ''
}
this.tableQuoteBuffer.push(funcItem)
console.log(JSON.stringify(this.tableQuoteBuffer))
this.tableQuote[i] = { 'packageId': funcItem.id, 'price': '' }
}
break
}
},
......@@ -629,66 +627,138 @@
// 供应身份而且通过审核
if (this.$store.getters.info.identity === 2 && this.$store.getters.info.register === 1) {
this.winOffer = true
this.winOfferSelect = true
this.winOfferPrice = false
this.winQuote = true
this.winQuoteInput = false
this.winQuoteSelection = true
this.tableQuote = []
this.tableQuoteBuffer = []
this.tableSelection = []
}
},
onPricePrevious: function () {
this.winOfferSelect = true
this.winOfferPrice = false
/**
* 竞价 - 填写报价窗口下一步
* @function
* @returns
*/
onQuoteNext: function () {
this.winQuoteInput = true
this.winQuoteSelection = false
},
/**
* 竞价 - 填写报价窗口上一步
* @function
* @returns
*/
onQuotePrevious: function () {
this.winQuoteInput = false
this.winQuoteSelection = true
this.tableQuote = []
this.tableQuoteBuffer = []
this.tableSelection = []
},
onPriceNext: function (funcType) {
switch (funcType) {
case 'offer':
this.winOfferSelect = false
this.winOfferPrice = true
break
/**
* 竞价 - 选择合同集合
* @function
* @param {number} funcValue
* @param {number} funcIndex
* @param {object} funcItem
* @returns
*/
selectionQuote: function (funcSelection) {
if (funcSelection.length === 0) return
let funcSelectionBuffer = []
// 点击全选时删除子包
for (let i = 0, l = funcSelection.length; i < l; i++) {
let funcRegExp = new RegExp('^[0-9]+$', 'g')
if (funcRegExp.test(funcSelection[i].index)) {
funcSelectionBuffer.push(funcSelection[i])
}
}
case 'submit':
if (this.tableQuote.length === 0) {
this.$message.error('请填写完整报价信息')
return
funcSelection = funcSelectionBuffer
funcSelectionBuffer = []
// 勾选主包时添加子包
for (let i = 0, l = funcSelection.length; i < l; i++) {
for (let ii = 0, ll = this.componentContract.length; ii < ll; ii++) {
if (funcSelection[i].index === this.componentContract[ii].index || this.componentContract[ii].index.indexOf(funcSelection[i].index + '-') >= 0) {
funcSelectionBuffer.push(this.componentContract[ii])
}
}
}
// 重新按照索引排序
funcSelectionBuffer.sort(function(a, b) {
let funcMainWeight = 1000
// 计算 a 的索引权重
let funcIndex = a.index.toString().split('-')
let funcA = Number(funcIndex[0]) * funcMainWeight
if (funcIndex[1]) {
a.isChild = true
funcA = funcA + Number(funcIndex[1])
} else {
a.isChild = false
}
for (let i = 0, len = this.tableQuote.length; i < len; i++) {
if (!this.tableQuote[i]) {
this.$message.error('请填写完整报价信息')
return
}
// 计算 b 的索引权重
funcIndex = b.index.toString().split('-')
let funcB = Number(funcIndex[0]) * funcMainWeight
if (funcIndex[1]) {
b.isChild = true
funcB = funcB + Number(funcIndex[1])
} else {
b.isChild = false
}
return funcA - funcB
})
if (this.tableQuote[i].price === '') {
this.$message.error('请输入报价金额')
return
}
}
funcSelection = funcSelectionBuffer
this.tableSelection = funcSelection
this.tableQuote = []
for (let i = 0, len = funcSelection.length; i < len; i++) {
let funcItem = {
'index': funcSelection[i].index,
'id': funcSelection[i].id,
'name': funcSelection[i].name,
'price': '',
'object': funcSelection[i].object,
'budget': funcSelection[i].budget,
'quantity': funcSelection[i].quantity,
'requirement': funcSelection[i].requirement,
'tip': '',
'remark': '',
'isChild': funcSelection[i].isChild,
'haveChild': funcSelection[i].haveChild,
}
this.tableQuote.push(funcItem)
}
let funcParam = {
'biddingProjectId': this.componentProject.projectId,
'biddingOffers': JSON.stringify(this.tableQuote)
}
console.log(JSON.stringify(funcSelection))
},
let funcOther = iRequest.request(iHost.base + 'bid/zBiddingProject/biddingOffer', funcParam, 'json', 'post')
.then((funcResponse) => {
this.winOffer = false
this.$message({ message: '报价成功!', type: 'success' })
})
.catch((funcError) => {
this.$message.error(funcError.message)
})
break
}
onQuoteNote: function (funcItem, funcIndex) {
this.winQuoteNote = true
this.tableNoteIndex = funcIndex
this.tableNote = this.tableQuote[this.tableNoteIndex].remark
},
onQuoteNoteSubmit: function () {
this.tableQuote[this.tableNoteIndex].remark = this.tableNote
this.winQuoteNote = false
},
/**
* 竞价 - 填写报价
* @function
* @param {number} funcValue
* @param {number} funcIndex
* @param {object} funcItem
* @returns
*/
onQuoteInput: function (funcValue, funcIndex, funcItem) {
// 校验输入数值
if (!iRuleAtom.isMoney(funcValue)) {
funcItem.tip = '请输入正确金额格式'
this.tableQuote[funcIndex] = undefined
......@@ -712,7 +782,90 @@
this.tableQuote[funcIndex] = undefined
return
}
this.tableQuote[funcIndex] = { 'packageId': funcItem.id, 'price': funcValue }
if (funcItem.isChild) {
// 计算主包价格
let funcPrice = 0
let funcChildStart = funcIndex - 1
let funcChildEnd = funcIndex + 1
while (this.tableQuote[funcChildStart].isChild) {
if (this.tableQuote[funcChildStart].price) {
funcPrice = funcPrice + Number(this.tableQuote[funcChildStart].price)
}
funcChildStart = funcChildStart - 1
}
while (this.tableQuote[funcChildEnd] && this.tableQuote[funcChildEnd].isChild) {
if (this.tableQuote[funcChildEnd].price) {
funcPrice = funcPrice + Number(this.tableQuote[funcChildEnd].price)
}
funcChildEnd = funcChildEnd + 1
}
this.tableQuote[funcChildStart].price = Number(funcPrice) + Number(funcItem.price)
console.log(JSON.stringify(this.tableQuote))
}
},
/**
* 竞价 - 提交报价
* @function
* @returns
*/
onQuoteSubmit: function () {
if (this.tableQuote.length === 0) {
this.$message.error('请填写完整报价信息')
return
}
for (let i = 0, len = this.tableQuote.length; i < len; i++) {
if (!this.tableQuote[i]) {
this.$message.error('请填写完整报价信息')
return
}
if (this.tableQuote[i].price === '') {
this.$message.error('请输入报价金额')
return
}
}
console.log(JSON.parse(JSON.stringify(this.tableQuote)))
let funcQuoteData = []
let funcMainContract = -1
for (let i = 0, l = this.tableQuote.length; i < l; i++) {
if (!this.tableQuote[i].isChild) {
let funcItem = {
'packageId': this.tableQuote[i].id,
'price': Number(this.tableQuote[i].price),
'subpackageOffers': []
}
funcQuoteData.push(funcItem)
funcMainContract = funcMainContract + 1
} else {
let funcItem = {
'packageId': this.tableQuote[i].id,
'price': Number(this.tableQuote[i].price),
'remark': this.tableQuote[i].remark,
}
funcQuoteData[funcMainContract].subpackageOffers.push(funcItem)
}
}
console.log(JSON.stringify(funcQuoteData))
let funcParam = {
'biddingProjectId': this.componentProject.projectId,
'biddingOffers': JSON.stringify(funcQuoteData)
}
let funcOther = iRequest.request(iHost.base + 'bid/zBiddingProject/biddingOffer', funcParam, 'json', 'post')
.then((funcResponse) => {
this.winQuote = false
this.$message({ message: '报价成功!', type: 'success' })
})
.catch((funcError) => {
this.$message.error(funcError.message)
})
},
}
}
......@@ -726,6 +879,10 @@
background: @colorWhite;
box-shadow:0px 0px 20px 0px rgba(41,41,41,0.05);
.table-row-hide {
display: none;
}
.dialog-button {
width: 160px;
height: 52px;
......
......@@ -450,14 +450,14 @@
// 重置区域选择数据
this.$store.commit('areaSelection', [])
this.$store.commit('componentSkill', [])
this.$store.commit('componentSkillData', [])
this.$store.commit('selectionSkill', [])
},
init: function () {
console.log('init')
iRequest.request(iHost.base + 'bid/common/getApiProjectTypeOptions', {}, 'json', 'get')
.then((funcResponse) => {
this.$store.commit('componentSkillData', funcResponse)
this.$store.commit('dictionarySkill', funcResponse)
})
},
......@@ -638,8 +638,9 @@
funcParam.multipleStatement = funcOfficial.join('|')
// 设置职称证书
// 以实际存在的技能组件数量为准
let funcSkillId = []
for (let i = 0, len = this.formRegister.skillId.length; i < len; i++) {
for (let i = 0, len = this.skillQuantity; i < len; i++) {
funcSkillId.push(this.formRegister.skillId[i].join(','))
}
funcParam.projectTypeIds = funcSkillId.join('|')
......@@ -781,10 +782,12 @@
* @returns
*/
onSkillInsert: function () {
if (this.skillQuantity < 5) this.skillQuantity = this.skillQuantity + 1
let funcComponentSkill = this.$store.getters.componentSkill
funcComponentSkill.push([0, 0, 0, 0, 0])
this.$store.commit('componentSkill', funcComponentSkill)
if (this.skillQuantity < 5) {
this.skillQuantity = this.skillQuantity + 1
let funcSelectionSkill = this.$store.getters.selectionSkill
funcSelectionSkill.push([0, 0, 0, 0, 0])
this.$store.commit('selectionSkill', funcSelectionSkill)
}
},
/**
......
......@@ -365,6 +365,7 @@
// 设置区域标识
this.formRegister.areaArray = funcResponse.area.split(',')
this.$store.commit('areaSelection', this.formRegister.areaArray)
console.log(JSON.stringify(this.formRegister.areaArray))
let funImageUrl
// 设置入库声明图片
......@@ -431,7 +432,7 @@
let funcSkillDictionary = iRequest.request(iHost.base + 'bid/common/getApiProjectTypeOptions', {}, 'json', 'get')
.then((funcResponse) => {
this.skillAll = funcResponse
this.$store.commit('componentSkillData', this.skillAll)
if (!this.$store.state.dictionarySkill.length) this.$store.commit('dictionarySkill', this.skillAll)
})
Promise.all([ funcInfo, funcSkillDictionary ])
......@@ -481,8 +482,7 @@
// 重置区域选择数据
this.$store.commit('areaSelection', [])
this.$store.commit('componentSkill', [])
this.$store.commit('componentSkillData', {})
this.$store.commit('selectionSkill', [])
},
setSelectionSkill: function () {
......@@ -518,9 +518,7 @@
funcSelectionIndex[i].push(0)
}
}
console.log(JSON.stringify(funcSelectionIndex))
this.$store.commit('componentSkill', funcSelectionIndex)
this.$store.commit('selectionSkill', funcSelectionIndex)
},
/**
......@@ -566,11 +564,10 @@
// 设置职称证书
let funcSkillId = []
for (let i = 0, len = this.formRegister.skillId.length; i < len; i++) {
for (let i = 0, len = this.skillQuantity; i < len; i++) {
funcSkillId.push(this.formRegister.skillId[i].join(','))
}
funcParam.projectTypeIds = funcSkillId.join('|')
console.log(JSON.stringify(funcParam))
iRequest.request(iHost.base + 'bid/zUserExpert/saveUserInfo', funcParam, 'json', 'post')
.then((funcResponse) => {
this.$message({ message: '修改已提交,请等待审核', type: 'success' })
......@@ -646,10 +643,12 @@
* @returns
*/
onSkillInsert: function () {
if (this.skillQuantity < 5) this.skillQuantity = this.skillQuantity + 1
let funcComponentSkill = this.$store.getters.componentSkill
funcComponentSkill.push([])
this.$store.commit('componentSkill', funcComponentSkill)
if (this.skillQuantity < 5) {
this.skillQuantity = this.skillQuantity + 1
let funcSelectionSkill = this.$store.getters.selectionSkill
funcSelectionSkill.push([0, 0, 0, 0, 0])
this.$store.commit('selectionSkill', funcSelectionSkill)
}
},
/**
......
......@@ -292,7 +292,7 @@
let funcSkillDictionary = iRequest.request(iHost.base + 'bid/common/getApiProjectTypeOptions', {}, 'json', 'get')
.then((funcResponse) => {
this.skillRawData = funcResponse
this.$store.commit('componentSkillData', this.skillRawData)
if (!this.$store.state.dictionarySkill.length) this.$store.commit('dictionarySkill', this.skillRawData)
})
Promise.all([ funcInfo, funcSkillDictionary ])
......@@ -355,7 +355,7 @@
funcSkillIndexArray.push(funcSkillIndex)
}
this.$store.commit('componentSkill', funcSkillIndexArray)
this.$store.commit('selectionSkill', funcSkillIndexArray)
for (let i = 0, l = funcSkillItemArray.length; i < l; i++) {
let funcSkillText = []
for (let ii = 0, ll = funcSkillItemArray[i].length; ii < ll; ii++) {
......@@ -370,6 +370,7 @@
},
onChange: function () {
this.$router.push('/specialist/infochange')
},
onChangeRecord: function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment