采购、装配

This commit is contained in:
hedekun
2018-11-14 09:22:04 +08:00
parent f7eb22e5bb
commit 666c65dd0f
101 changed files with 14504 additions and 266 deletions

View File

@@ -0,0 +1,221 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" clearable style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>采购情况:</span>
<el-select v-model="purchaseStateValue" placeholder="采购情况" size="small" style="width: 100px">
<el-option
v-for="item in purchaseState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe>
<el-table-column align="center" label="采购情况" min-width="80px">
<template slot-scope="scope">
<el-tag v-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</div>
</template>
<script>
import { initProject, initBuyer, searchTable1 } from '@/api/PurchasingCenter/ContractStateSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购任务分配
data() {
return {
projectValue: '',
project: [],
materialName: '',
personValue: '',
person: [],
purchaseStateValue: 0,
purchaseState: [
{
value: 0,
label: '全部'
},
{
value: 1,
label: '未分配'
},
{
value: 2,
label: '未询价'
},
{
value: 3,
label: '已询价'
},
{
value: 4,
label: '已采购'
}
],
check1: 0,
check2: 0,
check3: 0,
tableData1: [],
pageCurrent1: 1,
pageSize1: 20,
total1: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() { // 初始化
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.project.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
initBuyer().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
text: response.data[i].姓名,
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() { // 查询
this.projectValue ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
this.personValue ? this.check3 = 1 : this.check3 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.materialName, this.check3, this.personValue, this.purchaseStateValue).then(response => {
console.log(response.data)
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
filterHandler(value, row) {
console.log(row, value)
return parseInt(row['人员编号']) === parseInt(value)
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,595 @@
<template>
<div class="app-container">
<el-card>
<el-form ref="form1" :model="form1" label-position="right" label-width="110px" class="searchForm">
<el-row>
<el-col :span="6">
<el-form-item label="合同号">
<el-select v-model="contractNumValue" placeholder="合同号" filterable clearable size="small" @change="stipulateArrivalTime='';searchTable1()">
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.supplierName }}</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同名称">
<el-input v-model="contractName" size="small"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="规定到货时间">
<el-date-picker
v-model="stipulateArrivalTime"
:picker-options="endDateOpt"
:disabled="Boolean(!contractNumValue)"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期"
@change="searchDemo();calcDay()"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="付款方式">
<el-select v-model="payMethodValue" placeholder="付款方式" size="small" @change="searchDemo();payMethodChange()">
<el-option
v-for="item in payMethod"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="第1次付款时间">
<el-select v-model="payTime1Value" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第2次付款时间">
<el-select v-model="payTime2Value" :disabled="disable2" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第3次付款时间">
<el-select v-model="payTime3Value" :disabled="disable3" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第4次付款时间">
<el-select v-model="payTime4Value" :disabled="disable4" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="第5次付款时间">
<el-select v-model="payTime5Value" :disabled="disable5" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运费">
<el-input v-model="freight" size="small"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="税率">
<el-input v-model="taxRate" size="small"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="币种">
<el-select v-model="currencyValue" placeholder="币种" size="small" clearable>
<el-option
v-for="item in currency"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="参考价格" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.参考价格 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.最低单价" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="发货天数" align="center" width="100">
<template slot-scope="scope">
<el-input v-model="deliveryDay[scope.$index]" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="物料计划到货时间" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="订货数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.订货数量 }}
</template>
</el-table-column>
<el-table-column label="金额" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.金额 }}
</template>
</el-table-column>
</el-table>
<el-button
type="primary"
size="small"
icon=""
style="margin-top:10px"
@click="calculateContractSum">计算合同总额</el-button>
<span>合同总额:</span>
<el-input v-model="contractSum" size="small"/>
</el-card>
<el-card>
<el-table
:data="tableData2"
:show-header="false"
highlight-current-row
border
height="280px"
style="width: 250px;display:inline-block;max-height: 280px;"
size="mini"
@row-click="searchDemo">
<el-table-column align="center" label="合同模板名称">
<template slot-scope="scope">
{{ scope.row.合同模板名称 }}
</template>
</el-table-column>
</el-table>
<el-input :rows="20" v-model="textArea" type="textarea" style="width:calc(99% - 250px);float:right;margin-bottom: 20px" resize="none"/>
<!--将新一般处理页添加至通讯服务器-->
<el-upload
ref="upload"
:before-upload="beforeUpload"
:file-list="fileList"
:auto-upload="false"
style="display: inline-block;width:250px"
class="upload-demo"
action="http://localhost:8022/submit/uploadFile0.ashx"
list-type="picture">
<el-button slot="trigger" size="small" type="primary" style="margin:10px 10px 0 10px">添加图纸附件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">生成采购合同</el-button>
</el-upload>
</el-card>
<!--<el-button style="margin-left: 10px;" size="small" type="success" @click="test">test</el-button>-->
</div>
</template>
<script>
import { searchInquirySheet, searchSheetContract, initPayMethod, initPayTimeNode, searchContractDemo, doneContract, insertFile } from '@/api/PurchasingCenter/CreateContract'
import { mapGetters } from 'vuex'
export default {
inject: ['reload'],
data() {
return {
fileName: '',
hasFile: 0,
searchView: '',
fileList: [],
minDate: null,
endDateOpt: { // 为了让规定到货时间早于物料计划到货时间
disabledDate: (time) => {
if (this.minDate) {
return time.getTime() > this.minDate
}
}
},
form1: {},
contractNumValue: '', // 合同流水号
contractNum: [],
contractNameNum: '', // 合同编号/询价单号
contractName: '产品购销合同', // 合同名称
supplierName: '', // 供应商名称
stipulateArrivalTime: '', // 规定到货时间
payMethodValue: '', // 付款方式流水号
payMethodName: '', // 付款方式名称
payMethod: [],
payTime: [],
payTime1Value: '', // 付款时间
payTime2Value: '', // 付款时间
payTime3Value: '', // 付款时间
payTime4Value: '', // 付款时间
payTime5Value: '', // 付款时间
payTime6Value: '', // 付款时间
freight: '', // 运费
taxRate: '', // 税率
currencyValue: '', // 币种
currency: [
{
label: '人民币',
value: 1
}, {
label: '美元',
value: 2
}, {
label: '英镑',
value: 3
}, {
label: '欧元',
value: 4
}
], // 币种
calculateWayValue: [], // 计算方式(不要了)
calculateWay: [
{
label: '个数',
value: 1
}, {
label: '重量',
value: 2
}
],
weight: [], // 重量(不要了)
disable2: true,
disable3: true,
disable4: true,
disable5: true,
disable6: true,
tableData1: [], // 物料表
contractSum: '', // 合同总额
deliveryDay: [], // 发货天数
tableData2: [], // 合同模板表
textArea: '',
paramRow: '', // 参数row
materialGroup: '', // 物料流水号组
numberGroup: '', // 数量组
priceGroup: '', // 单价组
dayGroup: '', // 发货天数组
payGroup: '', // 付款方式组
planGroup: '', // 计划付款时间组
taxGroup: '', // 税率组
currencyGroup: '', // 币种组
groupPartGroup: '', // 组件零件流水号组
calculateWayGroup: '', // 计算方式组(不要了)
weightGroup: '', // 重量组(不要了)
supplierValue: '',
groupNum1: [] // 防止渲染不出来的中间变量
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.fetchData()
},
methods: {
test() {
this.$refs.upload.submit() // 图片传本地
},
beforeUpload(file) { // 传成功前
this.fileName = file.name
},
submitUpload() { // 生成采购合同+传图片附件
for (let i = 0; i < this.contractNum.length; i++) { // 在生成合同处也有
if (this.contractNum[i].value === this.contractNumValue) {
this.contractNameNum = this.contractNum[i].label // 获取询价单号
this.supplierValue = this.contractNum[i].supplierValue // 获取供应商流水号
}
}
this.$refs.upload.submit() // 图片传本地
if (this.fileName !== '') { // 有附件,先向数据库中插入一条记录(记录合同编号及文件名)
insertFile(this.fileName, this.contractNameNum).then(response => {
if (response.data[0].result === '1') {
this.doneContract()
} else {
this.$message.error('附件名插入数据库失败')
}
})
} else { // 无附件,直接执行生成合同
this.doneContract()
}
this.contractNameNum = ''
this.fileName = ''
},
fetchData() {
searchInquirySheet(0, 0, 0, 0, 1, this.id).then(response => { // 初始化询价单号
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
value: response.data[i].询价单流水号,
label: response.data[i].询价单编号,
supplierName: response.data[i].供应商名称,
supplierValue: response.data[i].供应商流水号
})
}
})
searchContractDemo().then(response => { // 初始化合同模板
this.tableData2 = response.data
})
initPayMethod().then(response => { // 初始化付款方式
for (let i = 0; i < response.data.length; i++) {
this.payMethod.push({
label: response.data[i].付款方式内容,
value: response.data[i].付款方式流水号
})
}
})
initPayTimeNode().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.payTime.push({
label: response.data[i].付款时间节点名称,
value: response.data[i].付款时间节点流水号
})
}
})
},
payMethodChange() { // 付款方式改变
for (let i = 0; i < this.payMethod.length; i++) {
if (this.payMethod[i].value === this.payMethodValue) {
this.payMethodName = this.payMethod[i].label
}
}
const payTimeNum = this.payMethodName.split(':')
switch (payTimeNum.length) {
case 1:
this.disable2 = true
this.disable3 = true
this.disable4 = true
this.disable5 = true
this.disable6 = true
break
case 2:
this.disable2 = false
this.disable3 = true
this.disable4 = true
this.disable5 = true
this.disable6 = true
break
case 3:
this.disable2 = false
this.disable3 = false
this.disable4 = true
this.disable5 = true
this.disable6 = true
break
case 4:
this.disable2 = false
this.disable3 = false
this.disable4 = false
this.disable5 = true
this.disable6 = true
break
case 5:
this.disable2 = false
this.disable3 = false
this.disable4 = false
this.disable5 = false
this.disable6 = true
break
case 6:
this.disable2 = false
this.disable3 = false
this.disable4 = false
this.disable5 = false
this.disable6 = false
break
}
},
searchTable1() {
const numGroup = [] // 空数组,放物料的计划到货时间
searchSheetContract(this.contractNumValue).then(response => {
this.tableData1 = response.data
this.calcDay() // 先给表置0
for (let i = 0; i < response.data.length; i++) {
this.tableData1[i].金额 = parseFloat(this.tableData1[i].最低单价) * parseFloat(this.tableData1[i].订货数量)
numGroup.push(Date.parse(this.tableData1[i].物料计划到货时间))
}
this.minDate = new Date(Math.min(...numGroup))
}).then(() => {
this.groupNum1 = this.tableData1 // 给中间变量需要时重新push
})
this.calcDay() // 先给表置0
},
searchDemo(row = this.paramRow) {
for (let i = 0; i < this.payMethod.length; i++) {
if (this.payMethod[i].value === this.payMethodValue) {
this.payMethodName = this.payMethod[i].label
}
}
this.paramRow = row
searchContractDemo(this.paramRow.合同模板流水号).then(response => {
this.textArea = response.data[0].合同模板内容.replace('stipulateArrivalTime', this.stipulateArrivalTime).replace('payMethodName', this.payMethodName)
})
},
calcDay() { // 计算发货天数
this.deliveryDay = []
for (let i = 0; i < this.tableData1.length; i++) {
this.stipulateArrivalTime
? (this.deliveryDay[i] = parseInt((Date.parse(this.stipulateArrivalTime) - new Date()) / (1000 * 60 * 60 * 24)))
: (this.deliveryDay[i] = 0)
}
},
calculateContractSum() {
this.contractSum = 0
this.tableData1 = []
for (let i = 0; i < this.groupNum1.length; i++) {
this.groupNum1[i].金额 = parseFloat(this.groupNum1[i].最低单价) * parseFloat(this.groupNum1[i].订货数量)
this.contractSum += parseFloat(this.groupNum1[i].金额)
this.tableData1.push(this.groupNum1[i])
}
},
doneContract() { // 生成采购合同
for (let i = 0; i < this.contractNum.length; i++) {
if (this.contractNum[i].value === this.contractNumValue) {
this.contractNameNum = this.contractNum[i].label // 获取询价单号
this.supplierValue = this.contractNum[i].supplierValue // 获取供应商流水号
}
}
if (this.contractNum === '' || this.contractNum === null) {
this.$message.error('请选择生成合同的询价单')
} else if (this.stipulateArrivalTime === '' || this.stipulateArrivalTime === null) {
this.$message.error('请选择规定到货时间!')
} else {
for (let i = 0; i < this.deliveryDay.length; i++) {
if (parseInt(this.deliveryDay[i]) < 0) {
this.$message.error('规定到货日期不可小于当前日期')
return
}
}
this.materialGroup = ''
this.numberGroup = ''
this.priceGroup = ''
this.dayGroup = ''
this.payGroup = ''
this.planGroup = ''
this.taxGroup = ''
this.currencyGroup = ''
this.groupPartGroup = ''
for (let i = 0; i < this.tableData1.length; i++) {
this.materialGroup += this.tableData1[i].物料流水号 + ','
this.numberGroup += this.tableData1[i].订货数量 + ','
this.priceGroup += this.tableData1[i].最低单价 + ','
this.dayGroup += this.deliveryDay[i] + ','
this.taxGroup += this.taxRate + ','
this.currencyGroup += this.currencyValue + ','
this.groupPartGroup += this.tableData1[i].组件零件流水号 + ',' // fucking
}
for (let i = 0; i < this.payMethod.length; i++) {
if (this.payMethod[i].value === this.payMethodValue) {
this.payMethodName = this.payMethod[i].label
}
}
const payTimeNum = this.payMethodName.split(':')
if (payTimeNum.length > 1) {
for (let i = 0; i < payTimeNum.length; i++) {
switch (i) {
case 0:
this.planGroup += this.payTime1Value + ','
break
case 1:
this.planGroup += this.payTime2Value + ','
break
case 2:
this.planGroup += this.payTime3Value + ','
break
case 3:
this.planGroup += this.payTime4Value + ','
break
case 4:
this.planGroup += this.payTime5Value + ','
break
case 5:
this.planGroup += this.payTime6Value + ','
break
}
this.payGroup += payTimeNum[i] + ',' // 付款比例 付款方式 付款计划
}
} else {
this.payGroup = '10,' // 付款比例 付款方式 付款计划
this.planGroup = this.payTime1Value + ',' // 付款时间
}
this.materialGroup = this.materialGroup.substr(0, this.materialGroup.length - 1)
this.numberGroup = this.numberGroup.substr(0, this.numberGroup.length - 1)
this.priceGroup = this.priceGroup.substr(0, this.priceGroup.length - 1)
this.dayGroup = this.dayGroup.substr(0, this.dayGroup.length - 1)
this.payGroup = this.payGroup.substr(0, this.payGroup.length - 1)
this.planGroup = this.planGroup.substr(0, this.planGroup.length - 1)
this.taxGroup = this.taxGroup.substr(0, this.taxGroup.length - 1)
this.currencyGroup = this.currencyGroup.substr(0, this.currencyGroup.length - 1)
this.groupPartGroup = this.groupPartGroup.substr(0, this.groupPartGroup.length - 1)
doneContract(this.contractNameNum, this.contractName, this.stipulateArrivalTime, this.stipulateArrivalTime, this.payMethodName, this.supplierValue, this.textArea, this.freight, this.materialGroup, this.numberGroup, this.priceGroup, this.dayGroup, this.payGroup, this.planGroup, this.taxGroup, this.currencyGroup, this.calculateWayGroup, this.weightGroup, this.id, this.groupPartGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('生成合同成功')
this.reload()
} else { this.$message.error('生成合同失败') }
})
}
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
</style>

View File

@@ -0,0 +1,835 @@
<template>
<div class="app-container">
<el-card>
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading=""
:data="tableData1"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</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="70">
<template slot-scope="scope">
{{ scope.row.库存量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<span>询价单号:</span>
<el-input v-model="inquirySheetNum" placeholder="询价单号" size="small" clearable/>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
style="margin-left: 10px"
@click="createInquirySheet">创建单据</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-circle-plus-outline"
style="margin-left: 10px"
@click="addInquirySheet">追加物料</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData2" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="询价单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.询价单编号 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="电话号码" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.电话号码 }}
</template>
</el-table-column>
<el-table-column label="传真" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.传真 }}
</template>
</el-table-column>
<el-table-column label="电子信箱" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.电子信箱 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" @click="editInquirySheet(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="deleteInquirySheet(scope.row)">删除</el-button>
<el-button type="warning" size="mini" icon="el-icon-download" @click="exportInquirySheet(scope.row)">导出</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="询价单编号" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.询价单编号 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="outInquirySheet(scope.row)">移出</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px">
<el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm">
<el-row>
<el-col :span="12">
<el-form-item label="供应商名称">
<el-input v-model="supplierName" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业性质">
<el-input v-model="enterpriseNature" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="货期">
<el-input v-model="goodTime" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注册资本">
<el-input v-model="registeredCapital" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="税号">
<el-input v-model="taxNum" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电子邮箱">
<el-input v-model="EMail" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="地址">
<el-input v-model="address" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="账号">
<el-input v-model="account" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="开户行">
<el-input v-model="openingBank" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话号码">
<el-input v-model="phone" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="传真">
<el-input v-model="fax" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-button
type="success"
size="small"
icon="el-icon-search"
@click="searchSupplier">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-check"
@click="submitSelectSupplier">确定</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-delete"
@click="emptySupplierDetail">清空</el-button>
</el-col>
</el-row>
<el-table :data="tableData01" size="mini" style="width: 97%;max-height: 300px;margin-top:15px" height="200px" border @row-click="showSupplierDetail">
<el-table-column align="center" label="供应商名称" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="企业性质" min-width="100">
<template slot-scope="scope">
{{ scope.row.企业性质 }}
</template>
</el-table-column>
<el-table-column align="center" label="创立日期" min-width="100">
<template slot-scope="scope">
{{ scope.row.创立日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="注册资本" min-width="100">
<template slot-scope="scope">
{{ scope.row.注册资本 }}
</template>
</el-table-column>
</el-table>
</el-form>
</el-dialog>
<el-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px">
<el-form-item label="询价单号" prop="inquirySheetNum">
<el-input v-model="form2.inquirySheetNum" size="small"/>
</el-form-item>
<el-form-item label="供应商" prop="supplierName">
<el-input v-model="form2.supplierName" size="small" readonly>
<el-button slot="append" icon="el-icon-search" @click="dialogVisible1=true"/>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
v-show="title2==='创建询价单'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitCreateInquirySheet">确定</el-button>
<el-button
v-show="title2==='编辑询价单'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitEditInquirySheet">确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible3" title="物料变更选择" center style="min-height: 300px;" width="780px">
<span>物料名称:</span>
<el-input v-model="materialName0" placeholder="物料名称" size="small" clearable/>
<el-button type="success" size="small" icon="el-icon-search" @click="pageCurrent02=1;pageSize02=10;total02=0;searchMaterial()">查询</el-button>
<el-table :data="tableData02" size="mini" style="width: 97%;max-height: 300px;margin-top:15px" height="400px" border highlight-current-row @row-click="selectNewMaterial">
<el-table-column align="center" label="物料名称" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent02"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize02"
:total="total02"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange02"
@current-change="handleCurrentChange02"/>
</div>
<span style="font-size: large;color: red">将原物料替换为: {{ materialNew }}</span>
<!--<el-input v-model="materialNew" size="small" readonly style="margin: 10px 10px 0 10px"></el-input>-->
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" icon="el-icon-check" @click="submitMaterialChange">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchMaterial, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet, outInquirySheet, searchAllMaterial, materialChange } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
export default {
name: '', // 创建询价单
data() {
return {
check1: 0, // 询价状态
check2: 0, // 物料名称
check3: 0, // 供应商
check4: 0, // 询价单号
inquiryStateValue: '', // 询价状态
inquiryState: [{
label: '未询价',
value: 1
}, {
label: '已询价',
value: 3
}],
materialName: '',
tableData1: [], // 采购任务单明细
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
supplierFilters: [{ text: '', value: '' }],
tableData2: [], // 询价单列表
total2: 0,
pageCurrent2: 1,
pageSize2: 10,
tableData3: [], // 询价单明细
dialogVisible1: false,
inquirySheetNum: '', // 询价单号
inquirySheetFlowNum: '', // 询价单流水号
form1: {},
supplierCheck1: 0,
supplierCheck2: 0,
supplierCheck3: 0,
supplierCheck4: 0,
supplierCheck5: 0,
supplierCheck6: 0,
supplierCheck7: 0,
supplierCheck8: 0,
supplierCheck9: 0,
supplierCheck10: 0,
supplierCheck11: 0,
supplierCheck12: 0,
supplierValue: '', // 供应商流水号
supplierName: '', // 供应商名称
goodTime: '', // 货期
enterpriseNature: '', // 企业性质
createDate: '', // 创立日期
registeredCapital: '', // 注册资本
taxNum: '', // 税号
EMail: '', // 电子邮箱
address: '', // 地址
account: '', // 账号
openingBank: '', // 开户行
phone: '', // 电话号码
fax: '', // 传真
tableData01: [],
dialogVisible2: false,
form2: {
inquirySheetNumValue: '', // 询价单流水号
inquirySheetNum: '',
supplierName: '',
supplierValue: ''
},
rules2: { // 表单验证规则
inquirySheetNum: [{ required: true, message: '请填写询价单号' }],
supplierName: [{ required: true, message: '请选择供应商' }]
},
groupPartNum: [], // 组件零件流水号
allNum: [], // 总数量
dialogVisible3: false,
materialName0: '',
tableData02: [],
total02: 0,
pageCurrent02: 1,
pageSize02: 10,
materialNew: '', // 替换为新物料全称
materialOldValue: '',
materialNewValue: '',
groupPartNumValue: '', // 组件零件流水号
standardAndPurchaseValue: '', // 标准件和外购件流水号
title2: ''
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
},
selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
},
filterHandler(value, row) { // 筛选供货商
return row['供货商'] === value
},
searchTable1() { // 查询物料列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
searchMaterial(this.pageCurrent1, this.pageSize1, this.check1, this.inquiryStateValue, this.check2, this.materialName, this.id).then(response => {
this.tableData1 = response.data.rows
console.log(response.data.rows)
this.total1 = response.data.total
})
},
handleSizeChange1(val) { // 物料列表分页
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) { // 物料列表分页
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2() { // 查询询价单列表
this.supplierName ? this.check3 = 1 : this.check3 = 0
this.inquirySheetNum ? this.check4 = 1 : this.check4 = 0
searchCreateInquirySheet(this.pageCurrent2, this.pageSize2, this.check3, this.supplierName, this.check4, this.inquirySheetNum, this.id).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSizeChange2(val) { // 询价单列表分页
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) { // 询价单列表分页
this.pageCurrent2 = val
this.searchTable2()
},
createInquirySheet() { // 创建空单据--询价单
this.title2 = '创建询价单'
this.form2.inquirySheetNum = ''
this.form2.supplierValue = ''
this.form2.supplierName = ''
this.dialogVisible2 = true
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
},
submitCreateInquirySheet() { // 提交创建询价单
this.$refs['form2'].validate((valid) => {
if (valid) {
const numGroup1 = [] // 空数组,放现有的询价单号
searchCreateInquirySheet2().then(response => { // 先查询判断是否存在
for (let i = 0; i < response.data.length; i++) {
numGroup1.push(response.data[i].询价单编号)
}
}).then(() => {
if (numGroup1.indexOf(this.form2.inquirySheetNum) !== -1) {
this.$message.error('该询价单号已存在')
} else {
createInquirySheet(this.form2.inquirySheetNum, this.form2.supplierValue, '', this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('创建成功')
this.inquirySheetNum = ''
this.supplierName = ''
this.supplierValue = ''
this.dialogVisible2 = false
this.searchTable2()
} else { this.$message.error('操作失败') }
})
}
})
} else {
console.log('表单验证未通过')
return false
}
})
},
deleteInquirySheet(row) { // 删除询价单
this.$confirm('确定删除该询价单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteInquirySheet(row.询价单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.inquirySheetNum = ''
this.supplierName = ''
this.supplierValue = ''
this.searchTable1()
this.searchTable2()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
editInquirySheet(row) { // 编辑询价单
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.title2 = '编辑询价单'
this.form2.inquirySheetNumValue = row.询价单流水号
this.form2.inquirySheetNum = row.询价单编号
this.form2.supplierValue = row.供应商流水号
this.form2.supplierName = row.供应商名称
this.dialogVisible2 = true
},
submitEditInquirySheet() { // 提交编辑询价单
this.$refs['form2'].validate((valid) => {
if (valid) {
const numGroup1 = [] // 空数组,放现有的询价单号
const numGroup2 = [] // 空数组,放现有的询价单流水号
searchCreateInquirySheet2().then(response => { // 先查询判断是否存在
for (let i = 0; i < response.data.length; i++) {
numGroup1.push(response.data[i].询价单编号)
numGroup2.push(response.data[i].询价单流水号)
}
}).then(() => {
if (numGroup1.indexOf(this.form2.inquirySheetNum) !== -1 && numGroup1.indexOf(this.form2.inquirySheetNum) !== numGroup2.indexOf(parseInt(this.form2.inquirySheetNumValue))) {
this.$message.error('该询价单号已存在')
} else {
editInquirySheet(this.form2.inquirySheetNumValue, this.form2.inquirySheetNum, this.form2.supplierValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.inquirySheetNum = ''
this.supplierName = ''
this.supplierValue = ''
this.dialogVisible2 = false
this.searchTable2()
} else { this.$message.error('修改失败') }
})
}
})
} else {
console.log('表单验证未通过')
return false
}
})
},
exportInquirySheet(row) { // 导出询价单
alert('do not done')
},
handleSelectionChange(val) { // 表1多选
console.log(val)
this.groupPartNum = []
this.allNum = []
for (let i = 0; i < val.length; i++) {
this.groupPartNum[i] = val[i].组件零件流水号
this.allNum[i] = val[i].零件数量
}
},
addInquirySheet() { // 追加物料
const numGroup2 = [] // 空数组,放该询价单中已有的物料
if (this.inquirySheetNum === '' || this.inquirySheetNum === null) {
this.$message.error('请选择一个询价单')
} else {
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
for (let i = 0; i < response.data.length; i++) {
numGroup2.push(response.data[i].组件零件流水号)
}
}).then(() => {
let x = true // 为了只执行一次的中间变量
for (let i = 0; i < this.groupPartNum.length; i++) {
if (numGroup2.indexOf(parseInt(this.groupPartNum[i])) !== -1) {
if (x) {
this.$notify({
title: '注意',
message: '无法向该询价单中追加重复物料,已自动跳过',
type: 'warning'
})
x = false
}
} else {
addInquirySheet(this.inquirySheetFlowNum, this.groupPartNum[i], this.allNum[i], 0, '').then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('操作失败') }
})
}
}
})
}
},
outInquirySheet(row) {
outInquirySheet(row.询价单流水号, row.组件零件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('操作失败') }
})
},
searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据
this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '')
this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '')
this.createDate ? this.supplierCheck3 = 1 : (this.supplierCheck3 = 0, this.createDate = '')
this.registeredCapital ? this.supplierCheck4 = 1 : (this.supplierCheck4 = 0, this.registeredCapital = '')
this.taxNum ? this.supplierCheck5 = 1 : (this.supplierCheck5 = 0, this.taxNum = '')
this.EMail ? this.supplierCheck6 = 1 : (this.supplierCheck6 = 0, this.EMail = '')
this.address ? this.supplierCheck7 = 1 : (this.supplierCheck7 = 0, this.address = '')
this.account ? this.supplierCheck8 = 1 : (this.supplierCheck8 = 0, this.account = '')
this.openingBank ? this.supplierCheck9 = 1 : (this.supplierCheck9 = 0, this.openingBank = '')
this.phone ? this.supplierCheck10 = 1 : (this.supplierCheck10 = 0, this.phone = '')
this.fax ? this.supplierCheck11 = 1 : (this.supplierCheck11 = 0, this.fax = '')
this.goodTime ? this.supplierCheck12 = 1 : (this.supplierCheck12 = 0, this.goodTime = '')
searchSupplier(this.supplierCheck1, this.supplierName, this.supplierCheck2, this.enterpriseNature, this.supplierCheck3, this.createDate, this.supplierCheck4, this.registeredCapital, this.supplierCheck5, this.taxNum, this.supplierCheck6, this.EMail, this.supplierCheck7, this.address, this.supplierCheck8, this.account, this.supplierCheck9, this.openingBank, this.supplierCheck10, this.phone, this.supplierCheck11, this.fax, this.supplierCheck12, this.goodTime).then(response => {
this.tableData01 = response.data
})
},
showSupplierDetail(row) {
this.form2.supplierValue = row.供应商流水号
this.form2.supplierName = row.供应商名称
this.supplierValue = row.供应商流水号
this.supplierName = row.供应商名称
this.enterpriseNature = row.企业性质
this.createDate = row.创立日期
this.registeredCapital = row.注册资本
this.taxNum = row.税号
this.EMail = row.电子信箱
this.address = row.地址
this.account = row.帐号
this.openingBank = row.开户行
this.phone = row.电话号码
this.fax = row.传真
this.goodTime = row.货期
},
emptySupplierDetail() {
this.supplierValue = ''
this.supplierName = ''
this.enterpriseNature = ''
this.createDate = ''
this.registeredCapital = ''
this.taxNum = ''
this.EMail = ''
this.address = ''
this.account = ''
this.openingBank = ''
this.phone = ''
this.fax = ''
this.goodTime = ''
},
submitSelectSupplier() { // 确定选择供应商
this.dialogVisible1 = false
},
searchTable3(row) { // 查询该询价单中的物料
this.tableData3 = []
this.inquirySheetNum = row.询价单编号
this.inquirySheetFlowNum = row.询价单流水号
this.supplierValue = row.供应商流水号
this.supplierName = row.供应商名称
searchSheetDetail(row.询价单流水号).then(response => {
this.tableData3 = response.data
})
},
materialChange(row) { // 物料变更
this.dialogVisible3 = true
console.log(row)
this.groupPartNumValue = row.组件零件流水号
this.standardAndPurchaseValue = row.标准件和外购件流水号
this.materialOldValue = row.物料流水号
},
searchMaterial() {
searchAllMaterial(this.materialName0, this.pageCurrent02, this.pageSize02).then(response => {
this.tableData02 = response.data.result
this.total02 = parseInt(response.data.output[0].ItemCount)
})
},
handleSizeChange02(val) {
this.pageSize02 = val
this.searchMaterial()
},
handleCurrentChange02(val) {
this.pageCurrent02 = val
this.searchMaterial()
},
selectNewMaterial(row) {
this.materialNew = ''
this.materialNewValue = row.物料流水号
this.materialNew += row.物料名称 + ' ' + row.物料规格 + ' ' + row.物料型号
},
submitMaterialChange() {
materialChange(this.groupPartNumValue, this.standardAndPurchaseValue, this.materialOldValue, this.materialNewValue, this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('提交变更申请成功')
this.dialogVisible3 = false
this.searchTable1()
} else { this.$message.error('操作失败') }
})
console.log(this.groupPartNumValue, this.standardAndPurchaseValue, this.materialOldValue, this.materialNewValue)
},
tableRowClassName({ row, rowIndex }) {
if (parseInt(row.是否确认) === 0) {
return 'MistyRose'
}
return ''
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>
<style>
.el-table .green {
background: lightgreen;
}
.el-table .white {
background: whitesmoke;
}
.el-table .red {
background: Tomato!important;
}
.el-table .MistyRose {
background: MistyRose!important;
}
.el-table .gray {
background: lightgray;
}
</style>

View File

@@ -0,0 +1,304 @@
<template>
<div class="app-container">
<el-card>
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</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="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="已付金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.已付金额 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="审核" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApproval(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="请款时间" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
<el-table-column label="请款人" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="150" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="审核" align="center" width="320">
<template slot-scope="scope">
<el-popover placement="right" width="400" trigger="click">
<el-table :data="gridData" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="离线合同编号">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同总额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover>
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApprovalOffline(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApprovalOffline(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
</div>
</template>
<script>
import { initApproval, execApproval, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/PurchasingCenter/FundApproval'
import { mapGetters } from 'vuex'
export default {
name: '', // 财务审核
data() {
return {
tableData1: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
tableData2: [],
pageSize2: 10,
pageCurrent2: 1,
total2: 0,
gridData: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.searchTable1()
this.searchTable2()
},
searchTable1() {
initApproval(this.pageCurrent1, this.pageSize1, 1).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2() {
initApprovalOffline(this.pageCurrent2, this.pageSize2, 1).then(response => {
console.log(response.data.rows)
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
searchTable02(row) { // 查看详情(请款信息包含的合同)
searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
this.gridData = response.data
})
},
yesApproval(row) { // 通过审核
this.$confirm('确定审核通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
execApproval(row.采购科请款流水号, 1, '通过', this.id, 1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApproval(row) { // 不通过审核
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
execApproval(row.采购科请款流水号, 2, value, this.id, 1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
yesApprovalOffline(row) { // 通过审核
this.$confirm('确定审核通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApprovalOffline(row) { // 不通过审核
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,303 @@
<template>
<div class="app-container">
<el-card>
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</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="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="已付金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.已付金额 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="审批" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApproval(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="请款时间" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
<el-table-column label="请款人" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="150" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="审核" align="center" width="320">
<template slot-scope="scope">
<el-popover placement="right" width="400" trigger="click">
<el-table :data="gridData" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="离线合同编号">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同总额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover>
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApprovalOffline(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApprovalOffline(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
</div>
</template>
<script>
import { initApproval, execApproval, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/PurchasingCenter/FundApproval'
import { mapGetters } from 'vuex'
export default {
name: '', // 管理审批
data() {
return {
tableData1: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
tableData2: [],
pageSize2: 10,
pageCurrent2: 1,
total2: 0,
gridData: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.searchTable1()
this.searchTable2()
},
searchTable1() {
initApproval(this.pageCurrent1, this.pageSize1, 2).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2() {
initApprovalOffline(this.pageCurrent2, this.pageSize2, 2).then(response => {
console.log(response.data.rows)
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
searchTable02(row) { // 查看详情(请款信息包含的合同)
searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
this.gridData = response.data
})
},
yesApproval(row) { // 通过审批
this.$confirm('确定审批通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
execApproval(row.采购科请款流水号, 1, '通过', this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApproval(row) { // 不通过审批
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
execApproval(row.采购科请款流水号, 2, value, this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
yesApprovalOffline(row) { // 通过审核
this.$confirm('确定审核通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApprovalOffline(row) { // 不通过审核
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,304 @@
<template>
<div class="app-container">
<el-card>
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</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="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="已付金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.已付金额 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="付款" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApproval(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="请款时间" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
<el-table-column label="请款人" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="150" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="审核" align="center" width="320">
<template slot-scope="scope">
<el-popover placement="right" width="400" trigger="click">
<el-table :data="gridData" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="离线合同编号">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同总额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover>
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApprovalOffline(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApprovalOffline(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
</div>
</template>
<script>
import { initApproval, execApproval, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/PurchasingCenter/FundApproval'
import { mapGetters } from 'vuex'
export default {
name: '', // 出纳付款
data() {
return {
tableData1: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
tableData2: [],
pageSize2: 10,
pageCurrent2: 1,
total2: 0,
gridData: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.searchTable1()
this.searchTable2()
},
searchTable1() {
initApproval(this.pageCurrent1, this.pageSize1, 3).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2() {
initApprovalOffline(this.pageCurrent2, this.pageSize2, 3).then(response => {
console.log(response.data.rows)
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
searchTable02(row) { // 查看详情(请款信息包含的合同)
searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
this.gridData = response.data
})
},
yesApproval(row) { // 通过付款
this.$confirm('确定付款通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
execApproval(row.采购科请款流水号, 1, '通过', this.id, 3).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
// 记录付款金额及时间
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApproval(row) { // 不通过付款
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
execApproval(row.采购科请款流水号, 2, value, this.id, 3).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
yesApprovalOffline(row) { // 通过审核
this.$confirm('确定审核通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 3).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApprovalOffline(row) { // 不通过审核
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 3).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable2()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,224 @@
<template>
<div class="app-container">
<el-card>
<span>采购合同号:</span>
<el-select v-model="contractNum" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNums"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 300px" height="300px" stripe border @row-click="searchTable2">
<el-table-column align="center" label="采购合同编号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="采购合同名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="供应商" min-width="200px">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同总金额" min-width="100px">
<template slot-scope="scope">
{{ Number(scope.row.合同总金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="center" label="到票总金额" min-width="100px">
<template slot-scope="scope">
{{ Number(scope.row.到票总金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="center" label="到票情况" min-width="200px">
<template slot-scope="scope">
<el-progress :text-inside="true" :stroke-width="18" :percentage="parseFloat((100*(scope.row.到票总金额/scope.row.合同总金额)).toFixed(2))" status="success"/>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table v-loading="" :data="tableData2" size="mini" style="max-height: 200px;margin-top: 10px" height="200px" stripe border>
<el-table-column align="center" label="发票号" min-width="120px">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column align="center" label="开票时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.开票时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="开票金额" min-width="100px">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="传送人" min-width="80px">
<template slot-scope="scope">
{{ scope.row.传送人姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="接收人" min-width="80px">
<template slot-scope="scope">
{{ scope.row.接收人姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="采购合同号" min-width="120px">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="200px">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchContractInvoice, searchInvoice, initPerson, initContract } from '@/api/PurchasingCenter/InvoiceStateSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 到票情况查询
data() {
return {
contractNumValue: '',
contractNums: [],
supplierName: '',
invoiceNum: '',
invoiceTime: '',
transmitValue: '',
selectPerson: [], // 传送人接收人
recipientValue: '',
contractNum: '',
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData1: [],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
check5: 0,
tableData2: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
initPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectPerson.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() {
this.contractNum ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchContractInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.contractNum, this.check2, this.supplierName).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
searchInvoice(row.采购合同流水号).then(response => {
for (let j = 0; j < response.data.length; j++) {
if (response.data[j].开票时间 !== null) {
response.data[j].开票时间 = response.data[j].开票时间.substring(0, response.data[j].开票时间.indexOf(' '))
}
if (response.data[j].开票时间 === '1900/1/1') {
response.data[j].开票时间 = ''
}
}
this.tableData2 = response.data
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-top: 1px;
margin-bottom: 1px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,357 @@
<template>
<div class="app-container">
<el-card>
<span>请款时间段:</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
style="width: 300px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-goods" style="" @click="requestFund">请款</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" border style="max-height: 500px;" height="500px" size="mini" show-summary>
<el-table-column label="供应商" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="请款时间" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
<el-table-column label="请款人" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="请款付款情况" align="center">
<el-table-column label="审核情况内容" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.审核情况内容 }}
</template>
</el-table-column>
<el-table-column label="未通过审核原因" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审核原因 }}
</template>
</el-table-column>
<el-table-column label="审批情况内容" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.审批情况内容 }}
</template>
</el-table-column>
<el-table-column label="未通过审批原因" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审批原因 }}
</template>
</el-table-column>
<el-table-column label="付款情况" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.付款情况内容 }}
</template>
</el-table-column>
<el-table-column label="未付款原因" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.未付款原因 }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-popover placement="right" width="400" trigger="click">
<el-table :data="gridData" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="离线合同编号">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同总额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-left: 10px" @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover>
<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px" @click="cancelRequestFund(scope.row)">取消请款</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-dialog :visible.sync="dialogVisible2" title="离线合同请款" center style="min-height: 300px" width="1000px">
<span>供应商</span>
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small">
<el-option
v-for="item in supplier"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin: 0 10px 10px 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable01()">查询</el-button>
<el-table v-loading="" :data="tableData01" border style="max-height: 300px;" height="300px" size="mini" @selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" type="selection" align="center" width="50"/>
<el-table-column label="离线合同编号" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column label="离线合同名称" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.离线合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购员 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="合同总额" align="center" min-width="100" prop="合同总额" fixed="right">
<template slot-scope="scope">
{{ scope.row.合同总额 }}
</template>
</el-table-column>
</el-table>
<span>合计<el-input v-model="SUM" size="mini" style="width: 80px; margin: 10px 10px 0 10px"/></span>
<el-button type="primary" size="small" style="float:right;margin: 10px 10px 0 10px" icon="el-icon-check" @click="submitRequestFund">确定请款</el-button>
</el-dialog>
</div>
</template>
<script>
import { searchRequestFund, searchOfflineContract, submitRequestFund, searchRequsetFundDetail, cancelRequestFund } from '@/api/PurchasingCenter/OfflineContractRequestFund'
import { mapGetters } from 'vuex'
export default {
name: '', // 离线合同
data() {
return {
check1: 0,
check2: 0,
dateRange: '',
pickerOptions: {
shortcuts: [{
text: '上季度',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 30 * 3)
picker.$emit('pick', [start, end])
}
}, {
text: '过去半年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 366 / 2)
picker.$emit('pick', [start, end])
}
}, {
text: '过去一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 365)
picker.$emit('pick', [start, end])
}
}]
},
offlineContract: '',
supplierName0: '',
supplierValue: '',
supplier: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData1: [],
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
tableData01: [],
dialogVisible2: false,
SUM: 0,
contractGroup: [],
sumGroup: [],
gridData: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.supplier = []
searchOfflineContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.supplier.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商流水号
})
}
})
},
searchTable1() { // 查询请款表
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
searchRequestFund(this.pageCurrent1, this.pageSize1, this.check1, this.dateRange[0], this.dateRange[1]).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
requestFund() { // 请款
this.dialogVisible2 = true
this.supplierValue = ''
this.fetchData() // 重新获取供应商
this.tableData01 = []
},
searchTable01() { // 查询待请款
if (this.supplierValue) {
this.contractGroup = []
searchOfflineContract(this.supplierValue).then(response => {
this.tableData01 = response.data
})
} else {
this.$message.error('请选择供应商')
}
},
handleSelectionChange(val) {
this.SUM = 0
this.contractGroup = []
this.sumGroup = []
for (let i = 0; i < val.length; i++) {
this.SUM += parseFloat(val[i].合同总额)
this.contractGroup.push(val[i].离线合同流水号)
this.sumGroup.push(val[i].合同总额)
}
},
selectable(row, index) { // 控制某行是否可选
return parseInt(row.已请款) !== 1 // 已经请款
},
submitRequestFund() { // 确认请款
if (this.supplierValue && this.contractGroup.length !== 0) {
submitRequestFund(this.contractGroup, this.sumGroup, this.supplierValue, this.SUM, this.id).then(response => { // 离线合同流水号组=${contractGroup}&合同总额组=${sumGroup}&供应商流水号=${supplier}&请款金额=${money}&请款人=${person
if (response.data[0].result === '1') {
this.$message.success('请款成功')
this.searchTable1()
this.dialogVisible2 = false
} else { this.$message.error('请款失败') }
})
} else {
this.$message.error('请选择需要请款的合同')
}
},
searchTable02(row) { // 查看详情(请款信息包含的合同)
searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
this.gridData = response.data
})
},
cancelRequestFund(row) { // 取消请款
this.$confirm('确定取消请款?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
cancelRequestFund(row.离线合同请款流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('取消成功')
this.searchTable1()
} else { this.$message.error('取消失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.el-tag{
margin: 0
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
</style>

View File

@@ -0,0 +1,180 @@
<template>
<div class="app-container">
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" stripe border style="width: 100%;max-height: 500px;" height="500px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</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="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="70">
<template slot-scope="scope">
{{ Number(scope.row.总金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="欠款金额" align="center" min-width="70">
<template slot-scope="scope">
{{ Number(scope.row.欠款金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="已付金额" align="center" min-width="70">
<template slot-scope="scope">
{{ Number(scope.row.总金额 - scope.row.欠款金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="付款情况" align="center" min-width="150">
<template slot-scope="scope">
<el-progress
:text-inside="true"
:stroke-width="18"
:percentage="parseFloat((100*(scope.row.总金额 - scope.row.欠款金额)/scope.row.总金额).toFixed(2))"
status="success"/>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</div>
</template>
<script>
import { initPayState, searchPayState } from '@/api/PurchasingCenter/PayStateSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 付款情况查询
data() {
return {
check1: 0,
check2: 0,
contractNumValue: '',
contractNum: [],
supplierName: '',
tableData1: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
dialogVisible1: false
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initPayState().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable1() {
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchPayState(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,145 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" show-summary border style="width: 100%;max-height: 500px;" height="500px" size="mini">
<el-table-column label="项目名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="小计(元)" align="center" min-width="100" prop="金额">
<template slot-scope="scope">
{{ scope.row.金额 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initProject, searchProjectTotal } from '@/api/PurchasingCenter/ProjectTotalSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 项目总价查询
data() {
return {
projectValue: '',
project: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData1: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.project.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
searchTable1() {
if (this.projectValue) {
searchProjectTotal(this.projectValue).then(response => {
console.log(response.data)
this.tableData1 = response.data
})
} else {
this.$message.error('请选择项目')
}
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
.el-date-editor{
width:300px
}
</style>

View File

@@ -0,0 +1,397 @@
<template>
<div class="app-container">
<el-card>
<span>时间段:</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="searchTable3()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading=""
:data="tableData3"
:summary-method="getSummaries"
border
show-summary
style="width: 100%;max-height: 250px;margin-top: 10px"
height="250px"
size="mini">
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="付款时间节点" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款时间节点名称 }}
</template>
</el-table-column>
<el-table-column label="预付款时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.预付时间 }}
</template>
</el-table-column>
<el-table-column label="付款比例" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款比例.toFixed(1) }}
</template>
</el-table-column>
<el-table-column label="付款预算(元)" align="center" min-width="100" prop="预付金额">
<template slot-scope="scope">
{{ scope.row.预付金额.toFixed(2) }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading=""
:data="tableData1"
border
style="width: 100%;max-height: 250px;"
height="250px"
size="mini"
highlight-current-row
@row-click="searchTable2">
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</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">
<template slot-scope="scope">
{{ scope.row.规定到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="项目预验收日期" align="center" min-width="110">
<template slot-scope="scope">
{{ scope.row.项目预验收日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="项目终验收日期" align="center" min-width="110">
<template slot-scope="scope">
{{ scope.row.项目终验收日期.split(' ')[0] }}
</template>
</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="120">
<template slot-scope="scope">
{{ scope.row.货到用户现场日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="用户现场开通日期" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.用户现场开通日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="日期设置" align="center" width="100" fixed="right">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" @click="editDate(scope.row)">设置</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 180px;margin-top: 10px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="付款时间节点" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款时间节点名称 }}
</template>
</el-table-column>
<el-table-column label="付款时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.预付时间 }}
</template>
</el-table-column>
<el-table-column label="付款比例" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款比例.toFixed(1) }}
</template>
</el-table-column>
<el-table-column label="付款预算" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.预付金额.toFixed(2) }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogVisible1" title="设置日期" center style="min-height: 300px" width="500px">
<el-form ref="form1" :model="form1" label-position="left" label-width="130px">
<el-form-item label="项目预验收日期">
<el-date-picker v-model="form1.项目预验收日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="项目终验收日期">
<el-date-picker v-model="form1.项目终验收日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="发货日期">
<el-date-picker v-model="form1.发货日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="货到用户现场日期">
<el-date-picker v-model="form1.货到用户现场日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="用户现场开通日期">
<el-date-picker v-model="form1.用户现场开通日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
size="small"
icon="el-icon-check"
@click="submitEdit">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initContract, searchPayTimeNode, searchPayTimeNodeMoney, editPayTimeNodeOther, searchPurchaseBudget } from '@/api/PurchasingCenter/PurchaseBudgetSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购预算查询
data() {
return {
check: 0,
check1: 0,
check2: 0,
contractNumValue: '',
contractNum: [],
supplierName: '',
pickerOptions: {
shortcuts: [{
text: '未来一周',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '未来一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}]
},
dateRange: '',
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData2: [],
dialogVisible1: false,
form1: {
采购合同流水号: '',
项目预验收日期: '',
项目终验收日期: '',
发货日期: '',
货到用户现场日期: '',
用户现场开通日期: ''
},
tableData3: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable1() {
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchPayTimeNode(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
searchTable2(row) {
searchPayTimeNodeMoney(row.采购合同流水号).then(response => {
this.tableData2 = response.data
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
editDate(row) {
this.form1.采购合同流水号 = row.采购合同流水号
this.form1.项目预验收日期 = row.项目预验收日期
this.form1.项目终验收日期 = row.项目终验收日期
this.form1.发货日期 = row.发货日期
this.form1.货到用户现场日期 = row.货到用户现场日期
this.form1.用户现场开通日期 = row.用户现场开通日期
this.dialogVisible1 = true
},
submitEdit() {
editPayTimeNodeOther(this.form1.采购合同流水号, this.form1.项目预验收日期, this.form1.项目终验收日期, this.form1.发货日期, this.form1.货到用户现场日期, this.form1.用户现场开通日期).then(response => {
if (response.data[0].result === '1') {
this.$message.success('设置成功')
this.dialogVisible1 = false
this.searchTable1()
this.tableData2 = []
} else { this.$message.error('设置失败') }
})
},
searchTable3() {
this.dateRange ? this.check = 1 : (this.check = 0, this.dateRange = '')
searchPurchaseBudget(this.check, this.dateRange[0], this.dateRange[1]).then(response => {
this.tableData3 = response.data
})
},
getSummaries(param) { // 合计
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
} else if (index === 4) {
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
} else {
sums[index] = 'N/A'
}
}
})
if (!isNaN(sums[4])) {
sums[4] = sums[4].toFixed(2)
}
return sums
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
.el-date-editor{
width:300px
}
</style>

View File

@@ -0,0 +1,374 @@
<template>
<div class="app-container">
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" clearable size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width:180px"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="loading1"
:data="tableData1"
size="mini"
border
style="width: 100%;max-height: 300px;"
height="300px"
highlight-current-row
@row-click="searchTable2">
<el-table-column label="采购合同号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="预到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.预到货时间 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规定到货时间 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="300">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit-outline" @click="Open(scope.row)">审批</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<div style="width:900px;margin-left: 350px">
<el-card>
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">需方</td>
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
<td colspan="1" align="center">合同编号</td>
<td colspan="1" align="center">{{ contract }}</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">供方</td>
<td colspan="1" align="center">{{ supplier }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="1" align="center">江苏盐城</td>
</tr>
</table>
<div> 产品名称型号数量单价品牌</div>
<table id="2" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="4">
<tr id="tableHead" style="height: 40px">
<td colspan="1" align="center">物料名称</td>
<td colspan="1" align="center">物料规格</td>
<td colspan="1" align="center">物料型号</td>
<td colspan="1" align="center">发货天数</td>
<td colspan="1" align="center">数量</td>
<td colspan="1" align="center">单价</td>
<td colspan="1" align="center">总价</td>
</tr>
</tbody>
<tfoot>
<tr style="height: 40px">
<td colspan="6">运费</td>
<td colspan="1" align="center">{{ freight }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB }}(含0.17增值税) </td>
<td colspan="1" align="center">{{ TotalAmount }}</td>
</tr>
</tfoot>
</table>
<div id="23"/>
</el-card>
</div>
</el-card>
<el-dialog :visible.sync="dialogVisible3" title="审批" center style="min-height: 300px;" width="20%">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="审批是否通过" prop="审批是否通过" center>
<el-select v-model="form2.审批是否通过" size="small" @change="selectChange">
<el-option
v-for="item in approval"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="未通过原因" prop="未通过原因">
<el-input v-model="form2.未通过原因" :disabled="disabled" size="small"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="submitApproval('form2')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initContract, initBuyer, searchTable1, searchTable2, submitApproval } from '@/api/PurchasingCenter/PurchaseContractApproval'
export default {
data() {
return {
person: [],
personValue: '',
RMB: '',
TotalAmount: '',
check1: 0,
check2: 0,
check3: 0,
check4: 0,
startEndDate: '',
contract: '',
freight: '',
contractNumValue: '',
contractNum: [],
ProcurementContractNum: '',
supplier: '',
supplierName: '',
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData1: [],
loading1: false,
dialogVisible3: false,
returns: [],
tableData01: [],
submitDisable: true,
approval: [
{
value: 1,
label: '是'
},
{
value: 2,
label: '否'
}
],
disabled: true,
form2: {
审批是否通过: '',
未通过原因: ''
},
rules2: {},
tableData2: [],
textarea: ``,
contractValue: '' // 显示表2和变更合同用的变量
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initBuyer().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
text: response.data[i].姓名,
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable1() {
this.tableData2 = []
this.textarea = ``
this.loading1 = true
if (this.startEndDate === '' || this.startEndDate === null || this.startEndDate[0] === '' || this.startEndDate[1] === '') {
this.check1 = 0
this.startEndDate = ''
} else { this.check1 = 1 }
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
this.personValue ? this.check3 = 1 : this.check3 = 0
this.supplierName ? this.check4 = 1 : this.check4 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startEndDate[0], this.startEndDate[1], this.check2, this.contractNumValue, this.check3, this.personValue, this.check4, this.supplierName).then(response => {
this.loading1 = false
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].预到货时间 !== null) {
response.data.rows[j].预到货时间 = response.data.rows[j].预到货时间.substring(0, response.data.rows[j].预到货时间.indexOf(' '))
}
if (response.data.rows[j].规定到货时间 !== null) {
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
}
}
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
Open(row) {
this.dialogVisible3 = true
this.ProcurementContractNum = row.采购合同流水号
},
selectChange() {
if (this.form2.审批是否通过 === 2) {
this.disabled = false
}
},
submitApproval(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
submitApproval(this.ProcurementContractNum, this.form2.审批是否通过, this.form2.未通过原因).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审批成功')
this.dialogVisible3 = false
this.searchTable1()
} else { this.$message.error('审批失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
this.textarea = row.合同文本
this.supplier = row.供应商名称
this.contract = row.采购合同编号
this.freight = parseInt(row.总金额) - parseInt(row.总金额_小计)
this.RMB = row.总金额_文本
this.TotalAmount = row.总金额
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
document.getElementById('tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料规格
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].物料型号
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].发货天数
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].金额
}
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
</style>
<style>
.tableData{
height: 30px;
}
</style>

View File

@@ -0,0 +1,412 @@
<template>
<div class="app-container">
<el-card>
<span>时间段:</span>
<el-date-picker
v-model="startEndDate"
style="width:250px"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width:180px"/>
<span>审批情况:</span>
<el-select v-model="approvalValue" placeholder="审批情况" size="small" clearable>
<el-option
v-for="item in approval"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="loading1"
:data="tableData1"
:row-class-name="tableRowClassName"
size="mini"
border
style="width: 100%;max-height: 300px;"
height="300px"
highlight-current-row
@row-click="searchTable2">
<el-table-column label="采购合同号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规定到货时间 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="审批情况" align="center" min-width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.审批情况内容==='未审批'" type="warning" size="small">未审批</el-tag>
<el-tag v-if="scope.row.审批情况内容==='通过审批'" type="success" size="small">通过审批</el-tag>
<el-tag v-if="scope.row.审批情况内容==='不通过审批'" type="info" size="small">不通过审批</el-tag>
</template>
</el-table-column>
<el-table-column label="未通过原因" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.未通过原因 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<div style="float: left">
<b>二维码</b><br>
<img id="img">
</div>
<div style="width:900px;margin-left: 350px">
<el-card>
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">需方</td>
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
<td colspan="1" align="center">合同编号</td>
<td colspan="1" align="center">{{ contract }}</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">供方</td>
<td colspan="1" align="center">{{ supplier }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="1" align="center">江苏盐城</td>
</tr>
</table>
<div> 产品名称型号数量单价品牌</div>
<table id="2" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="4">
<tr id="tableHead" style="height: 40px">
<td colspan="1" align="center">物料名称</td>
<td colspan="1" align="center">物料规格</td>
<td colspan="1" align="center">物料型号</td>
<td colspan="1" align="center">发货天数</td>
<td colspan="1" align="center">数量</td>
<td colspan="1" align="center">单价</td>
<td colspan="1" align="center">总价</td>
</tr>
</tbody>
<tfoot>
<tr style="height: 40px">
<td colspan="6">运费</td>
<td colspan="1" align="center">{{ freight }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB }}(含0.17增值税) </td>
<td colspan="1" align="center">{{ TotalAmount }}</td>
</tr>
</tfoot>
</table>
<div id="23"/>
</el-card>
</div>
</el-card>
<el-card v-show="searchView">
<!--将新一般处理页添加至通讯服务器-->
<div>附件图</div>
<img v-if="searchView" :src="searchView">
</el-card>
</div>
</template>
<script>
import { initContract, initBuyer, searchTable1, searchTable2 } from '@/api/PurchasingCenter/PurchaseContractSearch'
import { searchFile } from '@/api/PurchasingCenter/CreateContract'
import QRCode from 'qrcode'
export default {
data() {
return {
searchView: '', // 图片预览
approval: [{
value: 0,
label: '全部'
}, {
value: 1,
label: '通过'
}, {
value: 2,
label: '未通过'
}, {
value: 3,
label: '未审批'
}],
approvalValue: '',
RMB: '',
TotalAmount: '',
check1: 0,
check2: 0,
check3: 0,
check4: 0,
check5: 0,
startEndDate: '',
contract: '',
freight: '',
contractNumValue: '',
contractNum: [],
ProcurementContractNum: '',
personValue: '',
person: [],
supplier: '',
supplierName: '',
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData1: [],
loading1: false,
returns: [],
tableData01: [],
tableData02: [],
submitDisable: true,
tableData2: [],
textarea: ``,
contractValue: '' // 显示表2和变更合同用的变量
}
},
created() {
this.fetchData()
},
mounted() {
this.useqrcode()
},
methods: {
useqrcode() {
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
}
QRCode.toDataURL('知道这是啥吗你就扫', opts, function(err, url) {
if (err) throw err
const img = document.getElementById('img')
img.src = url
})
},
searchPic() {
// 读取图片时查找合同流水号获取其下所有图片id根据拼接成的路径查询图片显示出来。
searchFile(this.contract).then(response => {
console.log(response.data)
if (response.data.length !== 0) {
this.searchView = 'http://localhost:8022/Img/' + response.data[0].文件名
} else {
this.searchView = ''
}
})
},
fetchData() {
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
initBuyer().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
text: response.data[i].姓名,
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() {
this.tableData2 = []
this.textarea = ``
this.loading1 = true
if (this.startEndDate === '' || this.startEndDate === null || this.startEndDate[0] === '' || this.startEndDate[1] === '') {
this.check1 = 0
this.startEndDate = ''
} else { this.check1 = 1 }
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
this.personValue ? this.check3 = 1 : this.check3 = 0
this.supplierName ? this.check4 = 1 : this.check4 = 0
if (this.approvalValue === '' || this.approvalValue === 0) {
this.check5 = 0
} else {
this.check5 = 1
}
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startEndDate[0], this.startEndDate[1], this.check2, this.contractNumValue, this.check3, this.personValue, this.check4, this.supplierName, this.check5, this.approvalValue).then(response => {
this.loading1 = false
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].操作日期 !== null) {
response.data.rows[j].操作日期 = response.data.rows[j].操作日期.substring(0, response.data.rows[j].操作日期.indexOf(' '))
}
if (response.data.rows[j].规定到货时间 !== null) {
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
}
}
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
tableRowClassName({ row, rowIndex }) {
// if (row.审批情况流水号 === '1') {
// return 'adopt'
// } else if (row.审批情况流水号 === '2') {
// return 'NotThrough'
// }
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
this.textarea = row.合同文本
this.supplier = row.供应商名称
this.contract = row.采购合同编号
this.searchPic() // 显示图片
this.freight = parseInt(row.总金额) - parseInt(row.总金额_小计)
this.RMB = row.总金额_文本
this.TotalAmount = row.总金额
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
document.getElementById('tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料规格
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].物料型号
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].发货天数
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].金额
}
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>
<style>
.tableData{
height: 30px;
}
.el-table .adopt{
background: limegreen;
}
.el-table .NotThrough{
background: palevioletred;
}
</style>

View File

@@ -0,0 +1,169 @@
<template>
<div class="app-container">
<el-card>
<el-table :data="tableData1" highlight-current-row height="550" style="width: 100%;" size="mini" border>
<el-table-column label="序号" type="index" align="center" width="50"/>
<el-table-column label="项目名称" align="center" width="200px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="申请人" align="center" width="80px">
<template slot-scope="scope">
{{ scope.row.申请人姓名 }}
</template>
</el-table-column>
<el-table-column label="原物料" align="center">
<el-table-column label="原物料名称" align="center" min-width="150px">
<template slot-scope="scope">
{{ scope.row.原物料名称 }}
</template>
</el-table-column>
<el-table-column label="原物料规格" align="center" min-width="150px">
<template slot-scope="scope">
{{ scope.row.原物料规格 }}
</template>
</el-table-column>
<el-table-column label="原物料型号" align="center" min-width="150px">
<template slot-scope="scope">
{{ scope.row.原物料型号 }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="新物料" align="center">
<el-table-column label="新物料名称" align="center" min-width="150px">
<template slot-scope="scope">
{{ scope.row.新物料名称 }}
</template>
</el-table-column>
<el-table-column label="新物料规格" align="center" min-width="150px">
<template slot-scope="scope">
{{ scope.row.新物料规格 }}
</template>
</el-table-column>
<el-table-column label="新物料型号" align="center" min-width="150px">
<template slot-scope="scope">
{{ scope.row.新物料型号 }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="是否同意修改" width="200px" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
class="el-icon-edit"
@click="handleEdit1(scope.$index, scope.row)">同意</el-button>
<el-button
size="mini"
type="danger"
class="el-icon-edit"
@click="handleEdit2(scope.$index, scope.row)">不同意</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading1"
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</div>
</template>
<script>
import { searchTable, edit } from '@/api/PurchasingCenter/PurchaseMaterielModify'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购物料修改
data() {
return {
loading1: false,
tableData1: [], // 表格数据
total1: null, // 总条数
pageSize1: 10, // 每页显示条数
pageCurrent1: 1
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.searchTable()
},
methods: {
searchTable() {
this.loading1 = true
this.tableData1 = []
searchTable(this.pageCurrent1, this.pageSize1).then(response => {
console.log(response.data)
if (response.data.total === 0) {
this.loading1 = false
} else {
this.tableData1 = response.data.rows
this.total1 = response.data.total
}
}).then(() => {
this.loading1 = false
})
},
handleEdit1(index, row) {
edit(row.组件零件流水号, row.标准件和外购件流水号, row.物料变更记录流水号, 1, this.id, row.原物料流水号).then(response => {
if (response.data[0].result === '1') {
this.$message({
type: 'success',
message: '信息更新成功!'
})
this.searchTable()
} else {
this.$message.error('信息更新失败')
}
})
},
handleEdit2(index, row) {
edit(row.组件零件流水号, row.标准件和外购件流水号, row.物料变更记录流水号, 2, this.id, row.原物料流水号).then(response => {
if (response.data[0].result === '1') {
this.$message({
type: 'success',
message: '信息更新成功!'
})
this.searchTable()
} else {
this.$message.error('信息更新失败')
}
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable()
}
}
}
</script>
<style scoped>
span{
margin: 10px 0 10px 10px;
}
.el-card{
margin-bottom: 15px;
}
</style>

View File

@@ -0,0 +1,252 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="primary"
size="small"
icon="el-icon-menu"
style="margin-left: 10px"
@click="allocateTask">分配</el-button>
</el-card>
<el-card>
<el-table
v-loading=""
:data="tableData1"
size="mini"
style="max-height: 600px"
height="600px"
border
stripe
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="150px">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</div>
</template>
<script>
import { initProject, initBuyer, searchTable1, allocateTask } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购任务分配
data() {
return {
projectValue: '',
project: [],
materialName: '',
allocateStateValue: 0,
allocateState: [
{
value: 0,
label: '全部'
},
{
value: 1,
label: '未分配'
},
{
value: 2,
label: '已分配'
}
],
personValue: '',
person: [],
check1: 0,
check2: 0,
tableData1: [],
standardAndPurchase: [],
pageCurrent1: 1,
pageSize1: 20,
total1: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() { // 初始化
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.project.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
initBuyer().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
text: response.data[i].姓名,
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() { // 查询
this.projectValue ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.materialName, this.allocateStateValue).then(response => {
console.log(response.data)
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSelectionChange1(val) { // 多选
this.standardAndPurchase = []
for (let i = 0; i < val.length; i++) {
this.standardAndPurchase.push(val[i].标准件和外购件流水号)
}
},
selectable(row) { // 多选禁用
return row.人员编号 === '' || row.人员编号 === null
},
allocateTask() { // 分配任务
if (!this.personValue) {
this.$message.error('请选择采购员')
} else if (this.standardAndPurchase.length === 0) {
this.$message.error('请选择需分配的物料')
} else {
this.$confirm('此操作执行后不可修改,是否确定分配?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
allocateTask(this.standardAndPurchase, this.personValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
},
filterHandler(value, row) {
console.log(row, value)
return parseInt(row['人员编号']) === parseInt(value)
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,420 @@
<template>
<div class="app-container">
<el-card>
<span>发票号:</span>
<el-input v-model="invoiceNum" size="small" clearable/>
<!--<span>开票时间:</span>-->
<!--<el-date-picker v-model="invoiceTime" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>-->
<span>采购合同号:</span>
<el-select v-model="contractNum" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNums"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>传送人:</span>
<el-select v-model="transmitValue" placeholder="传送人" size="small" filterable clearable style="width:100px">
<el-option
v-for="item in selectPerson"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>接收人:</span>
<el-select v-model="recipientValue" placeholder="接收人" size="small" filterable clearable style="width:100px">
<el-option
v-for="item in selectPerson"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-circle-plus-outline"
style="margin-left: 10px"
@click="addTable1()">增加</el-button>
<el-button
type="warning"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
>导出</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 400px" height="400px" stripe border>
<el-table-column align="center" label="发票号" min-width="120px">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column align="center" label="开票时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.开票时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="开票金额" min-width="100px">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="采购合同编号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="采购合同名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="供应商" min-width="200px">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="总金额" min-width="100px">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="传送人" min-width="80px">
<template slot-scope="scope">
{{ scope.row.传送人姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="接收人" min-width="80px">
<template slot-scope="scope">
{{ scope.row.接收人姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="200px">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="200px">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
icon="el-icon-edit"
@click="editTable1(scope.row)">编辑</el-button>
<el-button
type="danger"
size="mini"
icon="el-icon-delete"
@click="deleteTable1(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="25%">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px">
<el-form-item label="采购合同号" prop="contractNum">
<el-select v-model="form1.contractNum" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNums"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发票号" prop="invoiceNum">
<el-input v-model="form1.invoiceNum" size="small"/>
</el-form-item>
<el-form-item label="开票时间" prop="invoiceTime">
<el-date-picker v-model="form1.invoiceTime" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="开票金额" prop="money">
<el-input v-model="form1.money" size="small" placeholder="开票金额"/>
</el-form-item>
<el-form-item label="传送人" prop="sendPerson">
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled filterable clearable style="width:100px">
<el-option
v-for="item in selectPerson"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="接收人" prop="receivePerson">
<el-select v-model="form1.receivePersonValue" placeholder="接收人" size="small" filterable clearable style="width:100px">
<el-option
v-for="item in selectPerson"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form1.remark" size="small"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1 = false">取消</el-button>
<el-button v-show="title1==='增加'" size="small" type="primary" @click="submitAdd1('form1')">确定</el-button>
<el-button v-show="title1==='编辑'" size="small" type="primary" @click="submitEdit1('form1')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchInvoice, addInvoice, editInvoice, deleteInvoice, initPerson, initContract } from '@/api/PurchasingCenter/ReceiptConnectionSheet'
import { mapGetters } from 'vuex'
export default {
name: '', // 发票交接单
data() {
return {
contractNumValue: '',
contractNums: [],
invoiceNum: '',
invoiceTime: '',
transmitValue: '',
selectPerson: [], // 传送人接收人
recipientValue: '',
contractNum: '',
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData1: [],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
check5: 0,
dialogVisible1: false,
title1: '',
form1: {
contractNum: '',
invoiceNum: '',
invoiceNumValue: '',
invoiceTime: '',
money: '',
sendPersonValue: '',
receivePersonValue: '',
remark: ''
},
rules1: {
contractNum: [
{ required: true, message: '请选择合同号', trigger: 'change' }
],
invoiceNum: [
{ required: true, message: '请输入发票号', trigger: 'blur' }
]
}
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
initPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectPerson.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() {
this.invoiceNum ? this.check1 = 1 : this.check1 = 0
this.invoiceTime ? this.check2 = 1 : this.check2 = 0
this.transmitValue ? this.check3 = 1 : this.check3 = 0
this.recipientValue ? this.check4 = 1 : this.check4 = 0
this.contractNum ? this.check5 = 1 : this.check5 = 0
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.invoiceTime, this.check3, this.transmitValue, this.check4, this.recipientValue, this.check5, this.contractNum).then(response => {
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].开票时间 !== null) {
response.data.rows[j].开票时间 = response.data.rows[j].开票时间.substring(0, response.data.rows[j].开票时间.indexOf(' '))
}
if (response.data.rows[j].开票时间 === '1900/1/1') {
response.data.rows[j].开票时间 = ''
}
}
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
addTable1() {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.title1 = '增加'
this.dialogVisible1 = true
this.form1.contractNum = ''
this.form1.invoiceNum = ''
this.form1.invoiceTime = ''
this.form1.money = ''
this.form1.sendPersonValue = Number(this.id)
this.form1.receivePersonValue = ''
this.form1.remark = ''
},
submitAdd1(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
const myDate = new Date()
const year = myDate.getFullYear()
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const nowDate = year + '-' + month + '-' + date
addInvoice(this.form1.contractNum, this.form1.invoiceNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark, nowDate).then(response => {
console.log(response.data)
if (response.data.result[0].result === '1') {
this.$message.success('增加成功')
this.dialogVisible1 = false
this.searchTable1()
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
editTable1(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.title1 = '编辑'
this.dialogVisible1 = true
this.form1.contractNum = parseInt(row.采购合同流水号)
this.form1.invoiceNum = row.发票号
this.form1.invoiceNumValue = row.发票流水号
this.form1.invoiceTime = row.开票时间
this.form1.money = row.开票金额
this.form1.sendPersonValue = parseInt(row.传送人)
this.form1.receivePersonValue = parseInt(row.接收人)
this.form1.remark = row.备注
console.log(row.开票时间)
if (row.开票时间 === '1900/1/1') {
this.form1.invoiceTime = null
}
if (parseInt(row.传送人) === 0) {
this.form1.sendPersonValue = ''
}
if (parseInt(row.接收人) === 0) {
this.form1.receivePersonValue = ''
}
},
submitEdit1(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
editInvoice(this.form1.invoiceNumValue, this.form1.contractNum, this.form1.invoiceNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark).then(response => {
console.log(this.form1.invoiceNumValue, this.form1.contractNum, this.form1.invoiceNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark)
console.log(response.data)
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogVisible1 = false
this.searchTable1()
} else { this.$message.error('编辑失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
deleteTable1(row) {
console.log(row)
this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteInvoice(row.发票流水号).then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.dialogVisible1 = false
this.searchTable1()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-top: 1px;
margin-bottom: 1px;
}
</style>

View File

@@ -0,0 +1,130 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="projectValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="searchProject()">查询</el-button>
</el-card>
<el-card style="margin-top: 15px">
<el-table
:data="tableData1"
style="width: 100%"
height="440"
size="mini"
show-summary
highlight-current-row
border>
<el-table-column align="center" label="项目名称">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="单价">
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column align="center" label="小计(元)" prop="小计">
<template slot-scope="scope">
{{ scope.row.小计 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>
import { initProject, searchReceiveCheck } from '@/api/PurchasingCenter/ReceiveCheck'
export default {
data() {
return {
projectValue: '', // 项目名称
project: [],
tableData1: [],
check1: '',
pageCurrent: 1,
pageSize: 10,
total: 0,
form: {
项目名称: '',
物料名称: '',
物料规格: '',
物料型号: '',
数量: '',
单价: '',
小计: ''
}
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
},
searchProject() { // 查询
if (!this.projectValue) {
this.$message.error('请选择项目')
} else {
searchReceiveCheck(this.pageCurrent, this.pageSize, 1, this.projectValue).then(response => {
this.tableData1 = response.data.rows
this.total = response.data.total
})
}
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.searchProject()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchProject()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,675 @@
<template>
<div class="app-container">
<el-card>
<el-form ref="form1" :model="form1" label-position="right" label-width="110px" class="searchForm">
<el-row>
<el-col style="width: 300px">
<el-form-item label="供应商名称">
<el-input v-model="supplierName" placeholder="供应商名称" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="企业性质">
<el-input v-model="businessNature" placeholder="企业性质" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="创立日期">
<el-date-picker v-model="creationDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd" size="small" type="date" placeholder="选择日期"/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="注册资本">
<el-input v-model="registeredCapital" placeholder="注册资本" size="small" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 300px">
<el-form-item label="税号">
<el-input v-model="taxNumber" placeholder="税号" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="电子信箱">
<el-input v-model="email" placeholder="电子信箱" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="电话号码">
<el-input v-model="telephone" placeholder="电话号码" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="开户行">
<el-input v-model="bank" placeholder="开户行" size="small" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 300px">
<el-form-item label="帐号">
<el-input v-model="account" placeholder="帐号" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="地址">
<el-input v-model="address" placeholder="地址" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px">
<el-form-item label="传真">
<el-input v-model="fax" placeholder="传真" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 350px">
<el-form-item label="货期">
<el-input v-model="deliveryPeriod" placeholder="货期" size="small" clearable/>
</el-form-item>
</el-col>
<el-col style="width: 300px;margin-top:2px">
<el-button type="success" size="small" icon="el-icon-search" @click="pageCurrent = 1;fetchData()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd()">增加</el-button>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card>
<div style="display: inline-block;margin-bottom: 20px">供应商列表</div>
<el-table :data="List" highlight-current-row border style="width: 100%;max-height: 400px;" height="400" size="mini" @row-click="rowClick">
<el-table-column label="供应商名称" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="开户行" align="center" width="250">
<template slot-scope="scope">
{{ scope.row.开户行 }}
</template>
</el-table-column>
<el-table-column label="帐号" align="center" width="170">
<template slot-scope="scope">
{{ scope.row.帐号 }}
</template>
</el-table-column>
<el-table-column label="税号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.税号 }}
</template>
</el-table-column>
<el-table-column label="电话号码" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.电话号码 }}
</template>
</el-table-column>
<el-table-column label="电子信箱" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.电子信箱 }}
</template>
</el-table-column>
<el-table-column label="地址" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.地址 }}
</template>
</el-table-column>
<el-table-column label="传真" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.传真 }}
</template>
</el-table-column>
<el-table-column label="企业性质" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.企业性质 }}
</template>
</el-table-column>
<el-table-column label="创立日期" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.创立日期 }}
</template>
</el-table-column>
<el-table-column label="注册资本" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.注册资本 }}
</template>
</el-table-column>
<el-table-column label="货期" align="center">
<template slot-scope="scope">
{{ scope.row.货期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<div style="display: inline-block;margin-bottom: 20px;width:90%">供应商联系人列表</div>
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-bottom:10px;float:right" @click="handleAdd2()">增加</el-button>
<el-table :data="List1" border size="mini">
<el-table-column label="姓名" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="职务" align="center">
<template slot-scope="scope">
{{ scope.row.职务 }}
</template>
</el-table-column>
<el-table-column label="电话" align="center" >
<template slot-scope="scope">
{{ scope.row.电话 }}
</template>
</el-table-column>
<el-table-column label="手机" align="center" >
<template slot-scope="scope">
{{ scope.row.手机 }}
</template>
</el-table-column>
<el-table-column label="传真" align="center" >
<template slot-scope="scope">
{{ scope.row.传真 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="handleEdit2(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete2(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="供应商名称" prop="供应商名称">
<el-input
v-model="form.供应商名称"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业性质" prop="企业性质">
<el-input
v-model="form.企业性质"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="创立日期" prop="创立日期">
<el-date-picker
v-model="form.创立日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="选择日期"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注册资本" prop="注册资本">
<el-input
v-model="form.注册资本"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="税号" prop="税号">
<el-input
v-model="form.税号"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开户行" prop="开户行">
<el-input
v-model="form.开户行"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="帐号" prop="帐号">
<el-input
v-model="form.帐号"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电子信箱" prop="电子信箱">
<el-input
v-model="form.电子信箱"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="地址" prop="地址">
<el-input
v-model="form.地址"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话号码" prop="电话号码">
<el-input
v-model="form.电话号码"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="传真" prop="传真">
<el-input
v-model="form.传真"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="货期" prop="货期">
<el-input
v-model="form.货期"
size="small"
style="width: 200px;"
clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button v-show="title==='增加'" type="primary" @click="submitAdd('form')">确定</el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog :title="title2" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="80px" class="demo-ruleForm">
<el-form-item label="姓名" prop="姓名">
<el-input v-model="form2.姓名" size="small" clearable/>
</el-form-item>
<el-form-item label="职务" prop="职务">
<el-input v-model="form2.职务" size="small" clearable/>
</el-form-item>
<el-form-item label="电话" prop="电话">
<el-input v-model="form2.电话" size="small" clearable/>
</el-form-item>
<el-form-item label="手机" prop="手机">
<el-input v-model="form2.手机" size="small" clearable/>
</el-form-item>
<el-form-item label="传真" prop="传真">
<el-input v-model="form2.传真" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button v-show="title2==='增加'" type="primary" @click="submitAdd2('form2')">确定</el-button>
<el-button v-show="title2==='编辑'" type="primary" @click="submitEdit2('form2')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchData, addTable, editTable, deleteData, getName, addPerson, editPerson, deletePerson } from '@/api/PurchasingCenter/SupplierManagement'
export default {
data() {
return {
form1: {},
supplierName: '',
businessNature: '',
creationDate: '',
registeredCapital: '',
taxNumber: '',
email: '',
address: '',
account: '',
bank: '',
telephone: '',
fax: '',
deliveryPeriod: '',
check1: 0,
check2: 0,
check3: 0,
check4: 0,
check5: 0,
check6: 0,
check7: 0,
check8: 0,
check9: 0,
check10: 0,
check11: 0,
check12: 0,
List: [],
pageCurrent: 1,
pageSize: 10,
total: 0,
title: '',
dialogFormVisible: false,
form: {
供应商名称: '',
企业性质: '',
创立日期: '',
注册资本: '',
税号: '',
开户行: '',
帐号: '',
电子信箱: '',
地址: '',
电话号码: '',
传真: '',
货期: ''
},
rules: {
供应商名称: [{ required: true, message: '请填写供应商名称', change: 'blur' }]
},
supplierSerialNumber: '',
List1: [],
dialogFormVisible2: false,
title2: '',
form2: {
姓名: '',
职务: '',
电话: '',
手机: '',
传真: '',
供应商流水号: '',
供应商联系人流水号: ''
},
rules2: {
姓名: [{ required: true, message: '请填写联系人姓名', change: 'blur' }]
}
}
},
methods: {
fetchData() {
this.List1 = []
this.supplierName ? this.check1 = 1 : this.check1 = 0
this.businessNature ? this.check2 = 1 : this.check2 = 0
this.creationDate ? this.check3 = 1 : this.check3 = 0
this.registeredCapital ? this.check4 = 1 : this.check4 = 0
this.taxNumber ? this.check5 = 1 : this.check5 = 0
this.bank ? this.check6 = 1 : this.check6 = 0
this.account ? this.check7 = 1 : this.check7 = 0
this.email ? this.check8 = 1 : this.check8 = 0
this.address ? this.check9 = 1 : this.check9 = 0
this.telephone ? this.check10 = 1 : this.check10 = 0
this.fax ? this.check11 = 1 : this.check11 = 0
this.deliveryPeriod ? this.check12 = 1 : this.check12 = 0
searchData(this.check1, this.supplierName, this.check2, this.businessNature, this.check3, this.creationDate, this.check4, this.registeredCapital, this.check5, this.taxNumber, this.check6, this.bank, this.check7, this.account, this.check8, this.email, this.check9, this.address, this.check10, this.telephone, this.check11, this.fax, this.check12, this.deliveryPeriod, this.pageCurrent, this.pageSize).then(response => {
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].创立日期 !== null) {
response.data.rows[j].创立日期 = response.data.rows[j].创立日期.substring(0, response.data.rows[j].创立日期.indexOf(' '))
}
}
this.List = response.data.rows
this.total = response.data.total
})
},
handleAdd() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.dialogFormVisible = true
this.title = '增加'
this.form.供应商名称 = ''
this.form.企业性质 = ''
this.form.创立日期 = ''
this.form.注册资本 = ''
this.form.税号 = ''
this.form.开户行 = ''
this.form.帐号 = ''
this.form.电子信箱 = ''
this.form.地址 = ''
this.form.电话号码 = ''
this.form.传真 = ''
this.form.货期 = ''
this.supplierSerialNumber = ''
},
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
addTable(this.form.供应商名称, this.form.企业性质, this.form.创立日期, this.form.注册资本, this.form.税号, this.form.开户行, this.form.帐号, this.form.电子信箱, this.form.地址, this.form.电话号码, this.form.传真, this.form.货期).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
this.pageCurrent = 1
this.pageSize = 10
this.fetchData()
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleEdit(row) {
console.log(row)
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.dialogFormVisible = true
this.title = '编辑'
this.form.供应商名称 = row.供应商名称
this.form.企业性质 = row.企业性质
this.form.创立日期 = row.创立日期
this.form.注册资本 = row.注册资本
this.form.税号 = row.税号
this.form.开户行 = row.开户行
this.form.帐号 = row.帐号
this.form.电子信箱 = row.电子信箱
this.form.地址 = row.地址
this.form.电话号码 = row.电话号码
this.form.传真 = row.传真
this.form.货期 = row.货期
this.supplierSerialNumber = row.供应商流水号
},
submitEdit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
editTable(this.form.供应商名称, this.form.企业性质, this.form.创立日期, this.form.注册资本, this.form.税号, this.form.开户行, this.form.帐号, this.form.电子信箱, this.form.地址, this.supplierSerialNumber, this.form.传真, this.form.货期, this.form.电话号码).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible = false
this.pageCurrent = 1
this.pageSize = 10
this.fetchData()
} else { this.$message.error('编辑失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
cancel() { // 取消
this.dialogFormVisible = false
},
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteData(row.供应商流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.pageCurrent = 1
this.pageSize = 10
this.fetchData()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.fetchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.fetchData()
},
rowClick(row) {
this.List1 = []
this.form2.供应商流水号 = row.供应商流水号
getName(this.form2.供应商流水号).then(response => {
this.List1 = response.data
})
},
handleAdd2() {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.dialogFormVisible2 = true
this.title2 = '增加'
this.form2.姓名 = ''
this.form2.职务 = ''
this.form2.电话 = ''
this.form2.手机 = ''
this.form2.传真 = ''
},
submitAdd2(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
addPerson(this.form2.姓名, this.form2.职务, this.form2.电话, this.form2.手机, this.form2.传真, this.form2.供应商流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible2 = false
getName(this.form2.供应商流水号).then(response => {
this.List1 = response.data
})
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleEdit2(row) {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.dialogFormVisible2 = true
this.title2 = '编辑'
this.form2.姓名 = row.姓名
this.form2.职务 = row.职务
this.form2.电话 = row.电话
this.form2.手机 = row.手机
this.form2.传真 = row.传真
this.form2.供应商联系人流水号 = row.供应商联系人流水号
},
submitEdit2(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
editPerson(this.form2.姓名, this.form2.职务, this.form2.电话, this.form2.手机, this.form2.传真, this.form2.供应商联系人流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible2 = false
getName(this.form2.供应商流水号).then(response => {
this.List1 = response.data
})
} else { this.$message.error('编辑失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleDelete2(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deletePerson(row.供应商联系人流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
getName(this.form2.供应商流水号).then(response => {
this.List1 = response.data
})
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
</style>