This commit is contained in:
chenjianan
2019-05-21 20:13:19 +08:00
parent 8aded86549
commit bbbc1d04ee
4 changed files with 140 additions and 26 deletions

View File

@@ -1,14 +1,27 @@
import request from '@/utils/request' import request from '@/utils/request'
// 初始化供应商
export function initSupplier(num) {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT distinct 供应商流水号,供应商名称
FROM 采购管理_询价单_视图
where 询价单编号 not in(select 采购合同编号 from 采购管理_采购合同_采购部 where 是否启用 = 1) and 采购员流水号 = ${num}`
}
})
}
// 查询询价单列表 表1 // 查询询价单列表 表1
export function searchInquirySheet(check1, value1, check2, value2, check3, id) { export function searchInquirySheet(check1, value1, check2, value2, check3, id, check4, supplier) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '1', type: '1',
name: '采购管理_询价单_查询数据', name: '采购管理_询价单_查询数据',
param: `供应商名称_check=${check1}&供应商名称=${value1}&询价单编号_check=${check2}&询价单编号=${value2}&采购员流水号_check=${check3}&采购员流水号=${id}` param: `供应商名称_check=${check1}&供应商名称=${value1}&询价单编号_check=${check2}&询价单编号=${value2}&采购员流水号_check=${check3}&采购员流水号=${id}&供应商流水号_check=${check4}&供应商流水号=${supplier}`
} }
}) })
} }

View File

@@ -69,9 +69,9 @@
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag> <el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100"> <el-table-column label="任务分配时间" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }} {{ scope.row.任务分配时间.split(' ')[0] }}
</template> </template>
</el-table-column> </el-table-column>
<!--<el-table-column label="项目名称" align="center" min-width="100">--> <!--<el-table-column label="项目名称" align="center" min-width="100">-->
@@ -144,12 +144,12 @@
{{ Number(scope.row.滞货数量) }} {{ Number(scope.row.滞货数量) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" min-width="100"> <el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.备注 }} {{ scope.row.备注 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier"> <el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供货商 }} {{ scope.row.供货商 }}
</template> </template>
@@ -159,7 +159,7 @@
<div class="block"> <div class="block">
<el-pagination <el-pagination
:current-page="pageCurrent11" :current-page="pageCurrent11"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 50, 100, 150]"
:page-size="pageSize11" :page-size="pageSize11"
:total="total11" :total="total11"
style="display:inline-block;width:50%" style="display:inline-block;width:50%"
@@ -236,9 +236,9 @@
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag> <el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100"> <el-table-column label="任务分配时间" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }} {{ scope.row.任务分配时间.split(' ')[0] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目名称" align="center" min-width="100"> <el-table-column label="项目名称" align="center" min-width="100">
@@ -281,12 +281,12 @@
{{ scope.row.零件数量 }} {{ scope.row.零件数量 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" min-width="100"> <el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.备注 }} {{ scope.row.备注 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier"> <el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供货商 }} {{ scope.row.供货商 }}
</template> </template>
@@ -296,7 +296,7 @@
<div class="block"> <div class="block">
<el-pagination <el-pagination
:current-page="pageCurrent12" :current-page="pageCurrent12"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 50, 100, 150]"
:page-size="pageSize12" :page-size="pageSize12"
:total="total12" :total="total12"
style="display:inline-block;width:50%" style="display:inline-block;width:50%"
@@ -806,7 +806,8 @@ export default {
total12: 0, total12: 0,
pageCurrent12: 1, pageCurrent12: 1,
pageSize12: 10, pageSize12: 10,
supplierFilters: [{ text: '', value: '' }], remarkFilters: [],
supplierFilters: [],
tableData2: [], // 询价单列表 tableData2: [], // 询价单列表
total2: 0, total2: 0,
pageCurrent2: 1, pageCurrent2: 1,
@@ -1026,6 +1027,9 @@ export default {
selectable(row, index) { // 控制某行是否可选 selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改 return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
}, },
filterHandler0(value, row) { // 筛选备注
return row['备注'] === value
},
filterHandler(value, row) { // 筛选供货商 filterHandler(value, row) { // 筛选供货商
return row['供货商'] === value return row['供货商'] === value
}, },
@@ -1040,6 +1044,18 @@ export default {
searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue).then(response => { searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue).then(response => {
this.tableData11 = response.data.rows this.tableData11 = response.data.rows
this.total11 = response.data.total this.total11 = response.data.total
const remark = []
const supplier = []
this.remarkFilters = []
this.supplierFilters = []
response.data.rows.map(v => {
if (!remark.includes(v.备注)) {
remark.push(v.备注)
supplier.push(v.供货商)
this.remarkFilters.push({ text: v.备注, value: v.备注 })
this.supplierFilters.push({ text: v.供货商, value: v.供货商 })
}
})
}) })
}, },
handleSizeChange11(val) { // 标准件和外购件列表分页 handleSizeChange11(val) { // 标准件和外购件列表分页
@@ -1062,6 +1078,18 @@ export default {
searchPart(this.pageCurrent12, this.pageSize12, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.partNum, check2, this.partName, check3, this.partSpec, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue).then(response => { searchPart(this.pageCurrent12, this.pageSize12, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.partNum, check2, this.partName, check3, this.partSpec, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue).then(response => {
this.tableData12 = response.data.rows this.tableData12 = response.data.rows
this.total12 = response.data.total this.total12 = response.data.total
const remark = []
const supplier = []
this.remarkFilters = []
this.supplierFilters = []
response.data.rows.map(v => {
if (!remark.includes(v.备注)) {
remark.push(v.备注)
supplier.push(v.供货商)
this.remarkFilters.push({ text: v.备注, value: v.备注 })
this.supplierFilters.push({ text: v.供货商, value: v.供货商 })
}
})
}) })
}, },
handleSizeChange12(val) { // 基本件列表分页 handleSizeChange12(val) { // 基本件列表分页

View File

@@ -3,6 +3,17 @@
<el-card> <el-card>
<el-form label-width="90px" label-position="right"> <el-form label-width="90px" label-position="right">
<el-row> <el-row>
<el-col :span="6">
<el-form-item label="供应商:">
<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @change="supplierChange">
<el-option
v-for="item in supplier"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="合同编号:"> <el-form-item label="合同编号:">
<el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange"> <el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange">
@@ -14,11 +25,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="供应商:">
<el-input v-model="supplierName" size="small" readonly/>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="合同名称:"> <el-form-item label="合同名称:">
<el-input v-model="contractName" size="small"/> <el-input v-model="contractName" size="small"/>
@@ -129,6 +135,9 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-tooltip content="一键删除交货期" placement="right">
<el-button type="danger" icon="el-icon-date" size="small" @click="deleteAllDate()"/>
</el-tooltip>
<span>①选择合同模板</span> <span>①选择合同模板</span>
<el-radio-group v-model="demoRadio" size="small" @change="demoChange"> <el-radio-group v-model="demoRadio" size="small" @change="demoChange">
<el-radio-button label="模板1"/> <el-radio-button label="模板1"/>
@@ -156,7 +165,7 @@
<script> <script>
import Tinymce from '@/components/Tinymce' import Tinymce from '@/components/Tinymce'
import { searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo } from '@/api/PurchasingCenter/CreatePurchaseContract' import { initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo } from '@/api/PurchasingCenter/CreatePurchaseContract'
import { convertCurrency } from '@/vendor/int2Chinese' import { convertCurrency } from '@/vendor/int2Chinese'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { sleep } from '@/utils/tool' import { sleep } from '@/utils/tool'
@@ -167,6 +176,7 @@ export default {
inject: ['reload'], inject: ['reload'],
data() { data() {
return { return {
supplier: [],
year: '', year: '',
month: '', month: '',
day: '', day: '',
@@ -226,7 +236,21 @@ export default {
this.fetchData() this.fetchData()
}, },
methods: { methods: {
deleteAllDate() {
this.tableData1.map(v => {
v.交货期 = ''
})
},
fetchData() { fetchData() {
initSupplier(this.id).then(res => {
this.supplier = []
for (let i = 0; i < res.data.length; i++) {
this.supplier.push({
value: res.data[i].供应商流水号,
label: res.data[i].供应商名称
})
}
})
searchBaseInfo(this.id).then(res => { searchBaseInfo(this.id).then(res => {
this.fax2 = res.data[0] ? res.data[0].传真 : '' this.fax2 = res.data[0] ? res.data[0].传真 : ''
this.postCode2 = '224053' this.postCode2 = '224053'
@@ -235,7 +259,8 @@ export default {
this.account2 = res.data[0] ? res.data[0].帐号 : '' this.account2 = res.data[0] ? res.data[0].帐号 : ''
this.bank2 = res.data[0] ? res.data[0].开户行 : '' this.bank2 = res.data[0] ? res.data[0].开户行 : ''
}) })
searchInquirySheet(0, 0, 0, 0, 1, this.id).then(response => { // 初始化询价单号 searchInquirySheet(0, 0, 0, 0, 1, this.id, 0, 0).then(response => { // 初始化询价单号
this.contractNums = []
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({ this.contractNums.push({
value: response.data[i].询价单流水号, value: response.data[i].询价单流水号,
@@ -263,6 +288,31 @@ export default {
this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
this.$refs.tinymce.initTinymce() this.$refs.tinymce.initTinymce()
}, },
supplierChange() {
let check
this.supplierValue ? check = 1 : check = 0
searchInquirySheet(0, 0, 0, 0, 1, this.id, check, this.supplierValue).then(response => { // 初始化询价单号
this.contractNums = []
this.contractNumValue = ''
for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({
value: response.data[i].询价单流水号,
label: response.data[i].询价单编号,
supplierName: response.data[i].供应商名称,
supplierValue: response.data[i].供应商流水号,
supplierAddress: response.data[i].地址,
legalPerson: response.data[i].企业性质, // 法人
trustee: response.data[i].注册资本 || '', // 受托人
bank1: response.data[i].开户行 || '', // 开户行
account1: response.data[i].帐号 || '', // 帐号
taxCode1: response.data[i].税号 || '', // 税号
phone1: response.data[i].电话号码 || '', // 电话
fax1: response.data[i].传真 || '', // 传真
postCode1: response.data[i].货期 || '' // 邮编
})
}
})
},
contractChange() { // 选择合同select contractChange() { // 选择合同select
for (let i = 0; i < this.contractNums.length; i++) { for (let i = 0; i < this.contractNums.length; i++) {
if (this.contractNums[i].value === this.contractNumValue) { if (this.contractNums[i].value === this.contractNumValue) {
@@ -572,7 +622,6 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// console.log(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content)
doneContract(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content).then(response => { doneContract(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('合同生成成功') this.$message.success('合同生成成功')

View File

@@ -46,6 +46,11 @@
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag> <el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务分配时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.任务分配时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="100"> <el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.机床图号 }} {{ scope.row.机床图号 }}
@@ -96,11 +101,6 @@
{{ scope.row.待采购数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }} {{ scope.row.待采购数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="100"> <el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.备注 }} {{ scope.row.备注 }}
@@ -192,6 +192,11 @@
{{ scope.row.供货商 }} {{ scope.row.供货商 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="参考价格" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.参考价格 }}
</template>
</el-table-column>
<el-table-column label="当前库存量" min-width="90" align="center"> <el-table-column label="当前库存量" min-width="90" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.当前库存量 }} {{ scope.row.当前库存量 }}
@@ -974,6 +979,9 @@ export default {
this.disable = true this.disable = true
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => {
!v.单价 ? v.单价 = v.参考价格 : v.单价
})
}) })
} else { this.$message.error('数据占用,删除失败') } } else { this.$message.error('数据占用,删除失败') }
}) })
@@ -1041,7 +1049,11 @@ export default {
this.offlineContractNum = row.离线合同流水号 this.offlineContractNum = row.离线合同流水号
this.离线合同状态 = row.离线合同状态 this.离线合同状态 = row.离线合同状态
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
console.log(response.data)
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => {
!v.单价 ? v.单价 = v.参考价格 : v.单价
})
}) })
Number(row.离线合同状态) !== 1 ? this.disable = true : this.disable = false // 是否为编辑模式 Number(row.离线合同状态) !== 1 ? this.disable = true : this.disable = false // 是否为编辑模式
}, },
@@ -1083,6 +1095,9 @@ export default {
this.$message.success('选入成功') this.$message.success('选入成功')
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => {
!v.单价 ? v.单价 = v.参考价格 : v.单价
})
}) })
} else { this.$message.error('选入失败') } } else { this.$message.error('选入失败') }
}) })
@@ -1099,6 +1114,9 @@ export default {
this.$message.success('移除成功') this.$message.success('移除成功')
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => {
!v.单价 ? v.单价 = v.参考价格 : v.单价
})
}) })
} else { this.$message.error('移除失败') } } else { this.$message.error('移除失败') }
}) })
@@ -1135,6 +1153,9 @@ export default {
this.searchTable2() this.searchTable2()
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => {
!v.单价 ? v.单价 = v.参考价格 : v.单价
})
}) })
} else { this.$message.error('离线合同保存失败') } } else { this.$message.error('离线合同保存失败') }
}) })
@@ -1171,6 +1192,9 @@ export default {
this.searchTable2() this.searchTable2()
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => {
!v.单价 ? v.单价 = v.参考价格 : v.单价
})
this.disable = true // 是否为编辑模式 this.disable = true // 是否为编辑模式
}) })
} else { this.$message.error('离线合同生成失败') } } else { this.$message.error('离线合同生成失败') }