This commit is contained in:
liushuai
2019-01-26 16:22:41 +08:00
parent a01226b906
commit 266ce2f3b3
11 changed files with 978 additions and 20 deletions

View File

@@ -263,14 +263,14 @@ export function Delete1(num) {
}
})
}
export function editStock(num, num1, num2) {
export function editStock(num, num1, num2, num3, num4) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '零件分配_标准件和外购件_使用库存',
param: '标准件和外购件流水号=' + num + '&数量=' + num1 + '&零件数量=' + num2
param: '标准件和外购件流水号=' + num + '&数量=' + num1 + '&零件数量=' + num2 + '&物料流水号=' + num3 + '&安全库存量=' + num4
}
})
}

View File

@@ -50,15 +50,15 @@ export function execApproval1(num1, num2, reason, person, state) {
}
})
}
// 查询离线合同审核/审批/付款
// 查询离线合同审批/付款
export function initApprovalOffline(pageCurrent, pageSize, state) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_离线合同_审核审批付款_查询数据',
param: `核_审批_付款状态=${state}`,
name: '车间采购管理_离线合同_审批付款_查询数据',
param: `审批_付款状态=${state}`,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -70,20 +70,20 @@ export function searchRequsetFundDetail(num) {
method: 'post',
data: {
type: '1',
name: '采购管理_离线合同_请款明细_查询数据',
name: '车间采购管理_离线合同_请款明细_查询数据',
param: `离线合同请款流水号=${num}`
}
})
}
// 执行审核/审批/付款(离线合同)
// 执行审批/付款(离线合同)
export function execApprovalOffline(num1, num2, reason, person, state) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_离线合同_审核审批付款_修改数据',
param: `离线合同请款流水号=${num1}&审核_审批_付款情况流水号=${num2}&未通过原因=${reason}&操作员编号=${person}&审核_审批_付款状态=${state}`
name: '车间采购管理_离线合同_审批付款_修改数据',
param: `离线合同请款流水号=${num1}&审批_付款情况流水号=${num2}&未通过原因=${reason}&操作员编号=${person}&审批_付款状态=${state}`
}
})
}

View File

@@ -0,0 +1,109 @@
import request from '@/utils/request'
// 发票查询
export function searchInvoice(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间采购管理_采购发票_查询数据',
param: `供应商流水号_check=${params[2]}&供应商流水号=${params[3]}&采购合同流水号_check=${params[4]}&采购合同流水号=${params[5]}`,
Pagination: params[0] + '&' + params[1]
}
})
}
// 发票增加(后台调用)
export function addInvoice(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间采购管理_采购发票_增加数据',
param: `采购合同流水号=${params[0]}&开票金额=${params[1]}&传送人流水号=${params[2]}&备注=${params[3]}`
}
})
}
// 发票编辑
export function editInvoice(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间采购管理_采购发票_修改数据',
param: `发票交接流水号=${params[0]}&发票号=${params[1]}&开户行=${params[2]}&开票时间=${params[3]}&接收人流水号=${params[4]}`
}
})
}
// 发票删除
export function deleteInvoice(num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间采购管理_采购发票_删除数据',
param: '发票交接流水号=' + num1
}
})
}
// 传送人初始化
export function initSender() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员与角色_查询数据_采购员'
}
})
}
// 初始化供应商
export function initSupplier() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_供应商_查询数据_根据条件'
}
})
}
// 根据供应商查合同
export function searchContract(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间采购管理_采购合同_查询数据_根据供应商',
param: `供应商流水号=${num}`
}
})
}
// 根据供应商查合同
export function searchOffline(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间采购管理_离线合同_查询数据_根据供应商',
param: `供应商流水号=${num}`
}
})
}
// 根据供应商查合同
export function invoiceDetail(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间采购管理_采购发票明细_查询数据',
param: `发票交接流水号=${num}`
}
})
}

View File

@@ -25,14 +25,14 @@ export function searchParts(pageCurrent, pageSize, check1, num, check2, name) {
})
}
// 编辑数据
export function update(id, time, number, time1, reason, remarks) {
export function update(id, time, number1, number, time1, reason, remarks) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_基本件外购质检_编辑数据',
param: `ID=${id}&交检日期=${time}&废品数量=${number}&检查日期=${time1}&报废原因=${reason}&备注=${remarks}`
param: `ID=${id}&交检日期=${time}&检验数量=${number1}&废品数量=${number}&检查日期=${time1}&报废原因=${reason}&备注=${remarks}`
}
})
}

View File

@@ -603,6 +603,8 @@ export default {
StandardAndOutsourcing: '',
PartNum: '',
DetailedNum: '',
stockNum: '',
MaterialNumber: '',
PurchaseOrder: '',
PartType: '基本件',
tableData: [],
@@ -1033,12 +1035,14 @@ export default {
}
this.dialogFormVisible4 = true
this.StandardAndOutsourcing = row.标准件和外购件流水号
this.MaterialNumber = row.物料流水号
this.PartNum = row.零件数量
this.stockNum = row.安全库存量
},
submitEdit2(formName) { // 提交使用库存数量
this.$refs[formName].validate((valid) => {
if (valid) {
editStock(this.RequisitionList, this.form4.数量, this.PartNum).then(response => {
editStock(this.StandardAndOutsourcing, this.form4.数量, this.PartNum, this.MaterialNumber, this.stockNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible4 = false

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<el-table v-loading="" :data="tableData" border style="width: 100%;max-height: 500px;" height="500px" size="mini">
<el-table v-loading="" :data="tableData" border style="width: 100%;max-height: 500px;" height="300px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
@@ -72,12 +72,68 @@
@current-change="handleCurrentChange"/>
</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="170">
<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" 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 { execApproval, initApproval1 } from '@/api/WorkshopProcurement/FundApproval'
import { execApproval, initApproval1, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/WorkshopProcurement/FundApproval'
import { mapGetters } from 'vuex'
export default {
@@ -88,6 +144,10 @@ export default {
pageSize: 10,
pageCurrent: 1,
total: 0,
tableData2: [],
pageSize2: 10,
pageCurrent2: 1,
total2: 0,
gridData: []
}
},
@@ -105,6 +165,7 @@ export default {
methods: {
fetchData() {
this.searchTable()
this.searchTable2()
},
searchTable() {
initApproval1(this.pageCurrent, this.pageSize, 2).then(response => {
@@ -125,6 +186,27 @@ export default {
this.pageCurrent = val
this.searchTable()
},
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: '确定',
@@ -161,6 +243,43 @@ export default {
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: '取消操作'
})
})
}
}
}

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<el-table v-loading="" :data="tableData" border style="width: 100%;max-height: 500px;" height="500px" size="mini">
<el-table v-loading="" :data="tableData" border style="width: 100%;max-height: 500px;" height="300px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
@@ -72,12 +72,68 @@
@current-change="handleCurrentChange"/>
</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="170">
<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" 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 { execApproval, initApproval1 } from '@/api/WorkshopProcurement/FundApproval'
import { execApproval, initApproval1, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/WorkshopProcurement/FundApproval'
import { mapGetters } from 'vuex'
export default {
@@ -88,6 +144,10 @@ export default {
pageSize: 10,
pageCurrent: 1,
total: 0,
tableData2: [],
pageSize2: 10,
pageCurrent2: 1,
total2: 0,
gridData: []
}
},
@@ -105,6 +165,7 @@ export default {
methods: {
fetchData() {
this.searchTable()
this.searchTable2()
},
searchTable() {
initApproval1(this.pageCurrent, this.pageSize, 3).then(response => {
@@ -125,6 +186,27 @@ export default {
this.pageCurrent = val
this.searchTable()
},
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: '确定',
@@ -161,6 +243,43 @@ export default {
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: '取消操作'
})
})
}
}
}

View File

@@ -460,7 +460,7 @@
</template>
<script>import { searchInventoryNum, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel,
addMateriel, deleteMateriel, doneOfflineContact, setSafeValue } from '@/api/PurchasingCenter/OfflineContract'
addMateriel, deleteMateriel, doneOfflineContact, setSafeValue } from '@/api/WorkshopProcurement/OfflineContract1'
import QRCode from 'qrcode'
import $ from 'jquery'
import { mapGetters } from 'vuex'

View File

@@ -645,6 +645,8 @@ export default {
this.isShow2 = false
}
this.checked = false
this.machineValue = ''
this.Machine = []
getProject(this.radio).then(response => { // 初始化机床项目
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({

View File

@@ -0,0 +1,600 @@
<template>
<div class="app-container">
<el-card>
<span>供应商名称:</span>
<el-select v-model="supplierNumValue" placeholder="供应商" size="small" filterable clearable>
<el-option
v-for="item in supplierNum"
: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
:disabled="office"
type="primary"
size="small"
icon="el-icon-circle-plus-outline"
style="margin-left: 10px"
@click="handleAdd()">增加</el-button>
</el-card>
<el-card>
<el-table id="expandTable" :data="tableData1" show-summary size="mini" style="max-height: 400px" height="400px" stripe border @row-click="searchPicInner">
<el-table-column type="expand">
<template slot-scope="scope">
<el-form id="table" label-position="left" inline class="demo-table-expand">
<el-row>
<el-col :span="10">
<viewer>
<img :src="scope.row.scanSrc" alt="发票扫描件" height="200px">
</viewer>
</el-col>
<el-col :span="14">
<el-form-item label="接收人">
{{ scope.row.接收人 ? scope.row.接收人 : '—' }}
</el-form-item><br>
<el-form-item label="接收时间">
{{ scope.row.接收时间 ? scope.row.接收时间 : '—' }}
</el-form-item><br>
<el-form-item label="发票号">
{{ scope.row.发票号 ? scope.row.发票号 : '—' }}
</el-form-item><br>
<el-form-item label="开户行">
{{ scope.row.开户行 ? scope.row.开户行 : '—' }}
</el-form-item><br>
<el-form-item label="开票时间">
{{ scope.row.开票时间 ? scope.row.开票时间.split(' ')[0] : '—' }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</el-table-column>
<el-table-column align="center" label="交接状态" min-width="80px">
<template slot-scope="scope">
<el-tag v-if="scope.row.接收人" type="success" size="small">已接收</el-tag>
<el-tag v-else type="warning" size="small">未接收</el-tag>
</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="80px">
<template slot-scope="scope">
<el-popover placement="right" width="400" trigger="click">
<el-table :data="tableData01" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="100" align="center" label="合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同名称">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同名称 : scope.row.离线合同名称 }}
</template>
</el-table-column>
<el-table-column prop="合同总额" min-width="80" align="center" label="合同总额">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.合同总额 = scope.row.采购合同总额 : scope.row.合同总额 = scope.row.离线合同总额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" plain type="success" size="mini" icon="el-icon-document" @click="invoiceDetail(scope.row)"/>
</el-popover>
</template>
</el-table-column>
<el-table-column align="center" label="开票金额" min-width="100px" prop="开票金额">
<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="135px">
<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.备注 ? scope.row.备注 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="200px">
<template slot-scope="scope">
<el-button
:disabled="!office"
type="primary"
size="mini"
icon="el-icon-edit"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button
:disabled="office||!!scope.row.接收人"
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: 10px 0;">
<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="460px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="90px">
<el-row>
<el-form-item label="供应商" prop="supplierNumValue">
<el-select v-model="form1.supplierNumValue" placeholder="供应商" size="small" filterable @change="searchContract2">
<el-option
v-for="item in supplierNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="合同编号" prop="contractNumValue">
<el-select v-model="form1.contractNumValue" multiple 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-tooltip :content="offline" placement="top">
<el-switch
v-model="offline"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="非离线"
inactive-value="离线"
style="margin: 10px"
@change="offlineChange2"/>
</el-tooltip>
</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="传送人">
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form1.remark" size="small" placeholder="备注"/>
</el-form-item>
<b style="color: #f56c6c;margin: 0">* </b>
<el-form-item label="发票扫描件" style="display: inline-block">
<el-upload
id="invoiceScan"
ref="upload"
:auto-upload="false"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:on-exceed="warningExceed"
:limit="limit"
:action="upload+'?contractNumValue='+form1.contractNumValue+'&money='+form1.money+'&sendPersonValue='+form1.sendPersonValue+'&remark='+form1.remark+'&supplierNumValue='+form1.supplierNumValue+'&offline='+offline"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1 = false">取消</el-button>
<el-button size="small" type="primary" @click="submitAdd('form1')">确定</el-button>
</div>
</el-dialog>
<el-dialog :title="title1" :visible.sync="dialogVisible2" center style="min-height: 300px" width="1200px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="80px">
<el-row>
<el-col style="width: 800px">
<viewer>
<img :src="scanSrc" style="margin: 0 auto" alt="发票扫描件" width="800px">
</viewer>
</el-col>
<el-col :span="6">
<el-form-item label="供应商">
<el-input v-model="form1.supplierName" size="small" disabled placeholder="供应商"/>
</el-form-item>
<el-form-item label="开票金额">
<el-input v-model="form1.money" size="small" disabled placeholder="开票金额"/>
</el-form-item>
<el-form-item label="传送人">
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="接收人">
<el-select v-model="form1.receivePersonValue" placeholder="接收人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form1.remark" size="small" disabled placeholder="备注"/>
</el-form-item>
<el-form-item label="发票号" prop="invoiceNum">
<el-input v-model="form1.invoiceNum" size="small" placeholder="发票号"/>
</el-form-item>
<el-form-item label="开户行" prop="bank">
<el-input v-model="form1.bank" size="small" placeholder="开户行"/>
</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-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible2 = false">取消</el-button>
<el-button size="small" type="primary" @click="submitEdit('form1')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchInvoice, editInvoice, deleteInvoice, initSender, initSupplier, searchContract, searchOffline, invoiceDetail } from '@/api/WorkshopProcurement/PurchaseInvoiceDelivery'
import { mapGetters } from 'vuex'
import { uploadInvoiceScan, readFile } from '@/utils/request'
import request from '@/utils/request'
export default {
name: '', // 采购发票交接
data() {
return {
offline: '非离线',
check1: 0,
office: null, // 是否为办公室
scanSrc: '',
upload: uploadInvoiceScan,
limit: 1,
sender: [],
contractNumValue: '',
contractNums: [], // options
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData1: [],
tableData01: [],
dialogVisible1: false,
dialogVisible2: false, // 办公室
title1: '',
supplierNumValue: '',
supplierNum: [],
form1: {
supplierNumValue: '',
supplierName: '',
invoiceDeliveryNum: '',
contractNumValue: [], // 多选select值
money: '',
sendPersonValue: '',
receivePersonValue: '',
invoiceNum: '',
bank: '',
invoiceTime: '',
remark: ''
},
rules1: {
supplierNumValue: [
{ required: true, message: '请选择供应商' }
],
money: [
{ required: true, message: '请填写金额' }
],
invoiceNum: [
{ required: true, message: '请填写发票号' }
],
bank: [
{ required: true, message: '请填写开户行' }
],
invoiceTime: [
{ required: true, message: '请填写开票时间' }
]
}
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'token', // 角色编号
'id' // 人员编号
])
},
created() {
this.fetchData()
this.searchTable1()
console.log(this.token)
Number(this.token) === 8 ? this.office = true : this.office = false // 是否为办公室8是办公室2是采购部
},
methods: {
offlineChange2() { // 切换离线非离线(内)
if (this.offline === '离线') {
this.searchOffline2()
} else {
this.searchContract2()
}
},
invoiceDetail(row) {
invoiceDetail(row.发票交接流水号).then(response => {
this.tableData01 = response.data
})
},
searchOffline1() {}, // 根据供应商查离线合同(外)
searchOffline2() { // 根据供应商查离线合同(内)
this.form1.contractNumValue = []
this.contractNums = []
searchOffline(this.form1.supplierNumValue).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].离线合同流水号
})
}
})
},
fetchData() { // 初始化数据
initSupplier().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.supplierNum.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商流水号
})
}
})
initSender().then(response => { // 传送人
for (let i = 0; i < response.data.length; i++) {
this.sender.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
// searchContract1() { // 根据供应商查合同(外)
// this.contractNumValue = ''
// this.contractNums = []
// searchContract(this.supplierNumValue).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].采购合同流水号
// })
// }
// })
// },
searchContract2() { // 根据供应商查合同(内)
this.form1.contractNumValue = []
this.contractNums = []
searchContract(this.form1.supplierNumValue).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].采购合同流水号
})
}
})
},
searchTable1() { // 查询表1
this.supplierNumValue ? this.check1 = 1 : this.check1 = 0
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.supplierNumValue, this.check2, this.contractNumValue).then(response => {
this.tableData1 = response.data.rows
this.tableData1.map(v => {
this.$set(v, 'scanSrc', '')
return v
})
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData1[i].scanSrc = this.searchPic(response.data.rows[i], i)
}
this.total1 = response.data.total
})
this.scanSrc = ''
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
handleAdd() { // 执行新增
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.title1 = '增加'
this.contractNum = []
this.form1.projectValue = ''
this.form1.supplierNumValue = ''
this.form1.contractNumValue = []
this.form1.money = ''
this.form1.sendPersonValue = Number(this.id)
this.form1.remark = ''
this.dialogVisible1 = true
},
warningExceed() {
this.$message.error('仅可上传一张发票')
},
submitAdd(formName) { // 提交新增
this.$refs[formName].validate((valid) => {
if (valid) {
this.$refs.upload.submit() // 上传图片
} else {
console.log('error submit!!')
return false
}
})
},
beforeUpload(file) { // 上船前检测
const isJPG = /^image\/.*/.test(file.type)
const isLt4M = file.size / 1024 / 1024 < 4
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
if (!isLt4M) {
this.$message.error('上传头像图片大小不能超过 4MB!')
}
return isJPG && isLt4M
},
uploadSuccess(res) { // 上传成功回调
if (res[0].result === '1') {
this.$message.success('增加成功')
this.dialogVisible1 = false
this.searchTable1()
this.$refs.upload.clearFiles()
} else {
this.$message.error('增加失败')
}
},
handleEdit(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.title1 = '编辑'
this.dialogVisible2 = true
this.form1.invoiceDeliveryNum = row.发票交接流水号
this.form1.supplierName = row.供应商名称
this.form1.money = row.开票金额
this.form1.sendPersonValue = parseInt(row.传送人流水号)
this.form1.receivePersonValue = Number(this.id)
this.form1.invoiceNum = row.发票号
this.form1.bank = row.开户行
this.form1.invoiceTime = row.开票时间
this.form1.remark = row.备注
},
submitEdit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
editInvoice(this.form1.invoiceDeliveryNum, this.form1.invoiceNum, this.form1.bank, this.form1.invoiceTime, this.form1.receivePersonValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogVisible2 = false
this.searchTable1()
} else { this.$message.error('编辑失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleDelete(row) {
this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteInvoice(row.发票交接流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.dialogVisible1 = false
this.searchTable1()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
async searchPic(row, i) {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 采购管理_采购发票_附件 where 是否启用 = 1 and 发票交接流水号 = ${row.发票交接流水号}`
}
})
this.tableData1[i].scanSrc = readFile + data[0].文件标识 + '.' + data[0].文件后缀
},
async searchPicInner(row) {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 采购管理_采购发票_附件 where 是否启用 = 1 and 发票交接流水号 = ${row.发票交接流水号}`
}
})
this.scanSrc = readFile + data[0].文件标识 + '.' + data[0].文件后缀
}
}
}
</script>
<style scoped>
#expandTable .el-form-item{
margin: 0;
}
.el-tag{
margin: 0
}
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
.searchForm .el-form-item{
margin-top: 1px;
margin-bottom: 1px;
}
</style>

View File

@@ -65,6 +65,11 @@
@change="update(scope.row)"/>
</template>
</el-table-column>
<el-table-column align="center" label="检验数量" width="80px">
<template slot-scope="scope">
<el-input v-model="scope.row.检验数量" size="mini" style="width: 50px" align="center" @change="update(scope.row)"/>
</template>
</el-table-column>
<el-table-column align="center" label="废品数量" width="80px">
<template slot-scope="scope">
<el-input v-model="scope.row.废品数量" size="mini" style="width: 50px" align="center" @change="update(scope.row)"/>
@@ -174,7 +179,7 @@ export default {
})
},
update(row) {
update(row.id, row.交检日期, row.废品数量, row.检查日期, row.报废原因, row.备注).then(response => {
update(row.id, row.交检日期, row.检验数量, row.废品数量, row.检查日期, row.报废原因, row.备注).then(response => {
})
},
handleEdit(row) {