|
@@ -408,7 +408,7 @@
|
|
|
<el-row v-if="dialogStatus==='special'">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="申购类型:" prop="purchaseType">
|
|
|
- <!-- <el-radio v-model="createTemp.purchaseType" label="1" @change="changeType()">暂估</el-radio> -->
|
|
|
+ <el-radio v-model="createTemp.purchaseType" label="1" @change="changeType()">暂估</el-radio>
|
|
|
<!-- <el-radio v-model="createTemp.purchaseType" label="2" @change="changeType()">垫付</el-radio> -->
|
|
|
<el-radio v-model="createTemp.purchaseType" label="3" @change="changeType()">赠品</el-radio>
|
|
|
</el-form-item>
|
|
@@ -490,7 +490,7 @@
|
|
|
<span v-if="createTemp.providerId == '' || parseFloat(createTemp.purchaseType) > 0">{{ scope.row.reportery }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column v-if="dialogStatus==='special'" label="价格" prop="price" align="center" min-width="150">
|
|
|
+ <el-table-column v-if="createTemp.purchaseType == '1'" label="价格" prop="price" align="center" min-width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="createTemp.purchaseType == '1'" v-for="item in scope.row.pricearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
|
|
|
<el-tooltip class="item" effect="dark" placement="top-start">
|
|
@@ -498,33 +498,16 @@
|
|
|
<div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <!-- <span v-if="createTemp.purchaseType == '1'">{{ scope.row.price }}</span> -->
|
|
|
- <el-form v-else :model="scope.row" :rules="rules">
|
|
|
- <el-form-item prop="price">
|
|
|
- <el-input v-model="scope.row.price" style="margin-top:15px" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="使用周期" min-width="120px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="item in scope.row.lifeCyclearr">
|
|
|
- <el-tooltip class="item" effect="dark" placement="top-start">
|
|
|
- <div slot="content">{{item}}</div>
|
|
|
- <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="合同差异项" min-width="120px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="item in scope.row.contractVarianceItemarr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
|
|
|
- <el-tooltip class="item" effect="dark" placement="top-start">
|
|
|
- <div slot="content">{{item}}</div>
|
|
|
- <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if="createTemp.purchaseType == '3'" label="价格" prop="price" align="center" min-width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form :model="scope.row" :rules="rules">
|
|
|
+ <el-form-item prop="price">
|
|
|
+ <el-input v-model="scope.row.price" style="margin-top:15px" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="申购数量" min-width="100px" align="center" valign="middle">
|
|
|
<template slot-scope="scope">
|
|
@@ -1530,13 +1513,13 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs['createTemp'].clearValidate()
|
|
|
})
|
|
|
- this.getBigPartpurchase()
|
|
|
+ this.getBigPartpurchase(0)
|
|
|
},
|
|
|
- getBigPartpurchase(){
|
|
|
+ getBigPartpurchase(type){
|
|
|
let data = {
|
|
|
name:'getBigPartpurchase',
|
|
|
parammaps:{
|
|
|
- purchaseType:0,
|
|
|
+ purchaseType:type,
|
|
|
pastureId:parseInt(Cookies.get('pastureid'))
|
|
|
}
|
|
|
}
|
|
@@ -1759,13 +1742,15 @@ export default {
|
|
|
if(this.dialogStatus==='special' && this.createTemp.purchaseType == '3'){
|
|
|
this.$set(item,'price','0')
|
|
|
this.$set(item,'amount','0')
|
|
|
+ }
|
|
|
+ if(this.dialogStatus==='special' && this.createTemp.purchaseType == '1'){
|
|
|
+ var pricearr = item.price.split(",")
|
|
|
+ this.$set(item,'pricearr',pricearr)
|
|
|
+ var lifeCyclearr = item.lifeCycle.split(",")
|
|
|
+ this.$set(item,'lifeCyclearr',lifeCyclearr)
|
|
|
+ var contractVarianceItemarr = item.contractVarianceItem.split(",")
|
|
|
+ this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
|
|
|
}
|
|
|
- var pricearr = item.price.split(",")
|
|
|
- this.$set(item,'pricearr',pricearr)
|
|
|
- var lifeCyclearr = item.lifeCycle.split(",")
|
|
|
- this.$set(item,'lifeCyclearr',lifeCyclearr)
|
|
|
- var contractVarianceItemarr = item.contractVarianceItem.split(",")
|
|
|
- this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
|
|
|
this.listAdd.unshift(item)
|
|
|
this.$forceUpdate()
|
|
|
}
|
|
@@ -2806,7 +2791,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handle_specialSubscription(){
|
|
|
- this.resetCreateTemp()
|
|
|
+ this.resetCreateTemp()
|
|
|
+ this.createTemp.purchaseType = '1'
|
|
|
this.edit = 1
|
|
|
this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
|
|
|
this.getCreateDepartDownList()
|
|
@@ -2814,9 +2800,12 @@ export default {
|
|
|
this.dialogFormVisible2 = true
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs['createTemp'].clearValidate()
|
|
|
- })
|
|
|
- this.getCreateNumber()
|
|
|
-
|
|
|
+ })
|
|
|
+ if(this.createTemp.purchaseType == 1){
|
|
|
+ this.getBigPartpurchase(parseInt(this.createTemp.purchaseType))
|
|
|
+ }else{
|
|
|
+ this.getCreateNumber()
|
|
|
+ }
|
|
|
},
|
|
|
getProviderList(){
|
|
|
let data = {
|
|
@@ -2832,7 +2821,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- changeType(){
|
|
|
+ changeType(){
|
|
|
+ if(this.createTemp.purchaseType == 1){
|
|
|
+ this.getBigPartpurchase(parseInt(this.createTemp.purchaseType))
|
|
|
+ }
|
|
|
this.listAdd = []
|
|
|
this.$set(this.createTemp,'providerId','')
|
|
|
this.$set(this.createTemp,'providerName','')
|
|
@@ -2911,39 +2903,70 @@ export default {
|
|
|
this.$message({ type: 'error', message: '请选择垫付人', duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
- }
|
|
|
- let url = 'authdata/spare/parts/requisitions'
|
|
|
- for(let i=0;i<this.listAdd.length;i++){
|
|
|
- this.$set(this.listAdd[i],'contractId',String(this.listAdd[i].contractId))
|
|
|
- }
|
|
|
- let data = {
|
|
|
- "pastureId": parseInt(this.createTemp.pastureId),
|
|
|
- "departmentId": parseInt(this.createTemp.departmentId),
|
|
|
- 'departmentName':this.createTemp.departmentName,
|
|
|
- "orderNumber": this.createTemp.orderNumber,
|
|
|
- "createTime": this.createTemp.createTime,
|
|
|
- "employeId": this.createTemp.employeId,
|
|
|
- "providerName": this.createTemp.providerName,
|
|
|
- "purchaseType": parseInt(this.createTemp.purchaseType),
|
|
|
- "spot_list":this.listAdd
|
|
|
- }
|
|
|
- if(this.createTemp.purchaseType == '1' || this.createTemp.purchaseType == '3'){
|
|
|
- data.providerId = this.createTemp.providerId
|
|
|
- data.providerName = this.providerList.find(obj => obj.id == this.createTemp.providerId).providerName
|
|
|
- }
|
|
|
- if(this.createTemp.funderId){
|
|
|
- data.funderId = this.createTemp.funderId
|
|
|
- }
|
|
|
- postJson(url, data).then(response => {
|
|
|
- if (response.msg !== 'fail') {
|
|
|
- this.get_table_data()
|
|
|
- this.dialogFormVisible = false
|
|
|
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
- } else {
|
|
|
- failproccess(response, this.$notify)
|
|
|
- }
|
|
|
- })
|
|
|
- return true
|
|
|
+ }
|
|
|
+ if(this.createTemp.purchaseType == 1){
|
|
|
+ if(this.createTemp.markBackend){
|
|
|
+ console.log('有数据-走新保存')
|
|
|
+ let url = 'authdata/partpurchase/edit'
|
|
|
+ let dataArr = []
|
|
|
+ for(let i =0 ;i<this.listAdd.length;i++){
|
|
|
+ let obj = {
|
|
|
+ "id": parseFloat(this.listAdd[i].id),
|
|
|
+ "bigId": parseFloat(this.createTemp.bigId),
|
|
|
+ "pastureId": parseFloat(this.listAdd[i].pastureId),
|
|
|
+ "partId": parseFloat(this.listAdd[i].partId),
|
|
|
+ "partCode": this.listAdd[i].partCode.toString(),
|
|
|
+ "partName": this.listAdd[i].partName.toString(),
|
|
|
+ "specification": this.listAdd[i].specification,
|
|
|
+ "amount": parseFloat(this.listAdd[i].amount),
|
|
|
+ "unit": this.listAdd[i].unit.toString(),
|
|
|
+ "brandId": parseFloat(this.listAdd[i].brandId),
|
|
|
+ "purpose": this.listAdd[i].purpose.toString(),
|
|
|
+ "price": this.listAdd[i].price.toString(),
|
|
|
+ "contractId": this.listAdd[i].contractId.toString(),
|
|
|
+ "lifeCycle": this.listAdd[i].lifeCycle.toString(),
|
|
|
+ "contractVarianceItem": this.listAdd[i].contractVarianceItem.toString(),
|
|
|
+ "departmentId": this.createTemp.departmentId.toString(),
|
|
|
+ "date": this.createTemp.createTime.toString(),
|
|
|
+ "employeId": parseFloat(this.createTemp.employeId)
|
|
|
+ }
|
|
|
+ if(this.listAdd[i].storageAmount){
|
|
|
+ obj.storageAmount = parseFloat(this.listAdd[i].storageAmount)
|
|
|
+ }else{
|
|
|
+ obj.storageAmount = 0
|
|
|
+ }
|
|
|
+ if(this.listAdd[i].reject){
|
|
|
+ obj.reject = this.listAdd[i].reject.toString()
|
|
|
+ }else{
|
|
|
+ obj.reject = ''
|
|
|
+ }
|
|
|
+ if(this.listAdd[i].explain){
|
|
|
+ obj.explain = this.listAdd[i].explain.toString()
|
|
|
+ }else{
|
|
|
+ obj.explain = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ dataArr.push(obj)
|
|
|
+ }
|
|
|
+ let data = dataArr
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.get_table_data()
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ failproccess(response, this.$notify)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ console.log('无数据-走原有保存')
|
|
|
+ this.special_saveSave()
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ console.log('赠品-走原有保存')
|
|
|
+ this.special_saveSave()
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
this.$message({
|
|
|
title: '',
|
|
@@ -2954,6 +2977,40 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
},
|
|
|
+ special_saveSave(){
|
|
|
+ let url = 'authdata/spare/parts/requisitions'
|
|
|
+ for(let i=0;i<this.listAdd.length;i++){
|
|
|
+ this.$set(this.listAdd[i],'contractId',String(this.listAdd[i].contractId))
|
|
|
+ }
|
|
|
+ let data = {
|
|
|
+ "pastureId": parseInt(this.createTemp.pastureId),
|
|
|
+ "departmentId": parseInt(this.createTemp.departmentId),
|
|
|
+ 'departmentName':this.createTemp.departmentName,
|
|
|
+ "orderNumber": this.createTemp.orderNumber,
|
|
|
+ "createTime": this.createTemp.createTime,
|
|
|
+ "employeId": this.createTemp.employeId,
|
|
|
+ "providerName": this.createTemp.providerName,
|
|
|
+ "purchaseType": parseInt(this.createTemp.purchaseType),
|
|
|
+ "spot_list":this.listAdd
|
|
|
+ }
|
|
|
+ if(this.createTemp.purchaseType == '1' || this.createTemp.purchaseType == '3'){
|
|
|
+ data.providerId = this.createTemp.providerId
|
|
|
+ data.providerName = this.providerList.find(obj => obj.id == this.createTemp.providerId).providerName
|
|
|
+ }
|
|
|
+ if(this.createTemp.funderId){
|
|
|
+ data.funderId = this.createTemp.funderId
|
|
|
+ }
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if (response.msg !== 'fail') {
|
|
|
+ this.get_table_data()
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ failproccess(response, this.$notify)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ },
|
|
|
// 合单
|
|
|
form_edit1(row){
|
|
|
this.modifyTemp = Object.assign({}, row) // copy obj
|