This commit is contained in:
caoxinyu
2018-12-24 19:41:04 +08:00
32 changed files with 303 additions and 3925 deletions

View File

@@ -68,3 +68,14 @@ export function searchTable1(check, entryNameValue, check1, machine, check2, gro
}
})
}
export function processingStatus(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_成组配套加工进度_查询数据',
param: '工艺计划流水号=' + num
}
})
}

View File

@@ -72,7 +72,6 @@ export function searchManufactor(name) {
}
})
}
// 确定价格
export function spareParts(processNum, single) {
return request({
url: '',
@@ -204,3 +203,14 @@ export function getPrice(Number, money, money1, money2, money3) {
}
})
}
export function handlechange(Number, code) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_零件工序_修改数据_工作者',
param: '工序流水号=' + Number + '&工作者考勤编号=' + code
}
})
}

View File

@@ -1,87 +0,0 @@
import request from '@/utils/request'
// 查询供应商
export function searchSupplier(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, check6, value6, check7, value7, check8, value8, check9, value9, check10, value10, check11, value11, check12, value12) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_供应商_查询数据_根据条件',
param: '供应商名称_check=' + check1 + '&供应商名称=' + value1 + '&企业性质_check=' + check2 + '&企业性质=' + value2 + '&创立日期_check=' + check3 + '&创立日期=' + value3 + '&注册资本_check=' + check4 + '&注册资本=' + value4 + '&税号_check=' + check5 + '&税号=' + value5 + '&电子信箱_check=' + check6 + '&电子信箱=' + value6 + '&地址_check=' + check7 + '&地址=' + value7 + '&帐号_check=' + check8 + '&帐号=' + value8 + '&开户行_check=' + check9 + '&开户行=' + value9 + '&电话号码_check=' + check10 + '&电话号码=' + value10 + '&传真_check=' + check11 + '&传真=' + value11 + '&货期_check=' + check12 + '&货期=' + value12
}
})
}
// 查询表1
export function searchTable1(pageCurrent, pageSize, check1, start, end, check2, num1, check3, name1, check4, name2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_请款表_查询数据',
param: '时间段_check=' + check1 + '&开始时间=' + start + '&结束时间=' + end + '&合同号_check=' + check2 + '&采购合同编号=' + num1 + '&采购员_check=' + check3 + '&采购员流水号=' + name1 + '&供应商_check=' + check4 + '&供应商名称=' + name2,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 请款
export function requestFund(num1, money, time, id) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_请款表_增加数据',
param: `采购合同流水号=${num1}&请款金额=${money}&请款人=${id}&请款时间=${time}`
}
})
}
// 查询请款付款情况
export function searchCondition(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_请款表_查询数据_已请款',
param: '采购合同流水号=' + num1
}
})
}
// 取消请款
export function cancelRequestFund(num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_请款表_删除数据',
param: '采购科请款流水号=' + num1
}
})
}
// 查询请款表
export function searchRequestTable(check, start, end) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_请款表_查询数据_请款Excel',
param: '请款时间段_check=' + check + '&开始时间=' + start + '&结束时间=' + end
}
})
}
// 初始化采购员 考核部门编号采购部改16
export function initBuyer() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=16'
}
})
}

View File

@@ -1,121 +0,0 @@
import request from '@/utils/request'
// 初始化合同号
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同_查询_采购部采购'
}
})
}
// 初始化采购员(考核部门编号采购部16)
export function initBuyer() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=16'
}
})
}
// 采购合同查询
export function searchTable1(pageCurrent, pageSize, check1, start, end, check2, contract, check3, name, check4, supplier) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_合同_查询数据_采购部采购',
param: '时间段_check=' + check1 + '&开始时间=' + start + '=datetime&结束时间=' + end + '=datetime&采购合同流水号_check=' + check2 + '&采购合同流水号=' + contract + '&人员编号_check=' + check3 + '&人员编号=' + name + '&供应商名称_check=' + check4 + '&供应商名称=' + supplier,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 采购合同明细查询
export function searchTable2(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同明细_查询数据',
param: '采购合同流水号=' + num
}
})
}
// 采购合同变更
export function contractChange(num, reason) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_采购合同变更_增加数据',
param: '采购合同流水号=' + num + '&合同变更原因=' + reason
}
})
}
// 查询变更合同
export function searchChangeContract(pageCurrent, pageSize, check1, start, end, check2, contract, check3, person, check4, supplier, check5, project, check6, payType) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同变更_查询数据_根据条件_cjn',
param: '时间段_check=' + check1 + '&开始时间=' + start + '=datetime&结束时间=' + end + '=datetime&采购合同流水号_check=' + check2 + '&采购合同流水号=' + contract + '&人员编号_check=' + check3 + '&人员编号=' + person + '&供应商名称_check=' + check4 + '&供应商名称=' + supplier + '&项目流水号_check=' + check5 + '&项目流水号=' + project + '&付款方式流水号_check=' + check6 + '&付款方式流水号=' + payType,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 初始化变更合同号
export function initChangeContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同变更_查询_cjn'
}
})
}
// 采购变更合同明细查询
export function searchTable4(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同明细变更_查询数据',
param: '采购合同变更流水号=' + num
}
})
}
// 初始化付款方式
export function initPayMethod() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款方式_查询数据'
}
})
}
// 合同作废
export function deleteContract(num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_采购合同_删除数据',
param: `采购合同流水号=${num}`
}
})
}

View File

@@ -1,38 +0,0 @@
import request from '@/utils/request'
// 初始化项目(车间传递来的)
export function initProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_项目名称_采购部采购_查询数据'
}
})
}
// 初始化采购员 考核部门编号采购部16
export function initBuyer() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=16'
}
})
}
// 查询表1
export function searchTable1(pageCurrent, pageSize, check1, num1, check2, name, check3, num2, state) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_采购情况查询',
param: `项目流水号_check=${check1}&项目流水号=${num1}&物料名称_check=${check2}&物料名称=${name}&人员编号_check=${check3}&人员编号=${num2}&采购情况=${state}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}

View File

@@ -1,97 +0,0 @@
import request from '@/utils/request'
// 查询询价单列表 表1
export function searchInquirySheet(check1, value1, check2, value2, check3, id) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_询价单_查询数据',
param: `供应商名称_check=${check1}&供应商名称=${value1}&询价单编号_check=${check2}&询价单编号=${value2}&采购员流水号_check=${check3}&采购员流水号=${id}`
}
})
}
// 根据询价单流水号查询物料详情
export function searchSheetContract(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_询价单明细_查询数据_根据询价单',
param: '询价单流水号=' + num1
}
})
}
// 查询合同模板
export function searchContractDemo(num1 = null) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_合同模板_查询数据',
param: '合同模板流水号=' + num1
}
})
}
// 初始化付款方式
export function initPayMethod() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款方式_查询数据'
}
})
}
// 初始化付款时间节点
export function initPayTimeNode() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款时间节点_查询数据'
}
})
}
// 生成采购合同
export function doneContract(num1, name1, time1, time2, method, num2, text, freight, num3, numGroup, priceGroup, dayGroup, payGroup, planGroup, taxGroup, currency, cala, weight, id, groupPartGroup) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_采购合同_增加数据',
param: `采购合同编号=${num1}&采购合同名称=${name1}&预到货时间=${time1}&规定到货时间=${time2}&付款方式=${method}&采购员=${id}&供应商流水号=${num2}&合同文本=${text}&运费=${freight}&物料流水号组=${num3}&数量组=${numGroup}&单价组=${priceGroup}&发货天数组=${dayGroup}&付款比例组=${payGroup}&计划付款时间组=${planGroup}&税率组=${taxGroup}&币种流水号组=${currency}&采购合同计算方式流水号组=${cala}&重量组=${weight}&组件零件流水号组=${groupPartGroup}`
}
})
}
// 生成采购合同
export function insertFile(name, num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_图片附件_增加数据',
param: `文件名=${name}&采购合同编号=${num}`
}
})
}
// 生成采购合同
export function searchFile(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_图片附件_查询数据',
param: `采购合同编号=${num}`
}
})
}

View File

@@ -1,50 +0,0 @@
import request from '@/utils/request'
// 发票合同
export function searchContractInvoice(pageCurrent, pageSize, check1, num, check2, name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_到票情况_查询数据',
param: `采购合同流水号_check=${check1}&采购合同流水号=${num}&供应商名称_check=${check2}&供应商名称=${name}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 发票查询
export function searchInvoice(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_发票_查询数据',
param: '采购合同流水号_check=1&采购合同流水号=' + num
}
})
}
// 传送人接收人初始化 采购科改16
export function initPerson() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=16'
}
})
}
// 初始化合同号
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款情况_查询数据'
}
})
}

View File

@@ -1,62 +0,0 @@
import request from '@/utils/request'
// 初始化合同
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款情况_查询数据'
}
})
}
// 查询合同付款时间节点
export function searchPayTimeNode(pageCurrent, pageSize, check1, num, check2, name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购预算_合同付款时间节点_查询数据',
param: `采购合同流水号_check=${check1}&采购合同流水号=${num}&供应商名称_check=${check2}&供应商名称=${name}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询合同付款时间节点及金额
export function searchPayTimeNodeMoney(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购预算_合同付款时间节点及金额_查询数据',
param: `采购合同流水号=${num}`
}
})
}
// 设置合同付款时间节点其他
export function editPayTimeNodeOther(num, date1, date2, date3, date4, date5) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_合同付款时间节点_其他_修改数据',
param: `采购合同流水号=${num}&项目预验收日期=${date1}&项目终验收日期=${date2}&发货日期=${date3}&货到用户现场日期=${date4}&用户现场开通日期=${date5}`
}
})
}
// 查询采购预算
export function searchPurchaseBudget(check, date1, date2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购预算_查询数据',
param: `时间段_check=${check}&开始时间=${date1}&结束时间=${date2}`
}
})
}

View File

@@ -47,3 +47,15 @@ export function searchTable2(num) {
}
})
}
// 删除采购合同
export function deleteContract(num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_采购合同_删除_采购部采购',
param: '采购合同流水号=' + num
}
})
}

View File

@@ -1,86 +0,0 @@
import request from '@/utils/request'
// 发票查询
export function searchInvoice(pageCurrent, pageSize, check1, num1, check2, time, check3, transmit, check4, recipient, check5, num2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_发票_查询数据',
param: '发票号_check=' + check1 + '&发票号=' + num1 + '&开票时间_check=' + check2 + '&开票时间=' + time + '&传送人_check=' + check3 + '&传送人=' + transmit + '&接收人_check=' + check4 + '&接收人=' + recipient + '&采购合同流水号_check=' + check5 + '&采购合同流水号=' + num2,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 发票增加
export function addInvoice(num1, num2, time1, money, send, receive, remark, time2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_发票_增加数据',
param: '采购合同流水号=' + num1 + '&发票号=' + num2 + '&开票时间=' + time1 + '&开票金额=' + money + '&传送人=' + send + '&接收人=' + receive + '&备注=' + remark + '&操作时间=' + time2 + '&identity_receiptLiushuihao=1=int=output'
}
})
}
// 发票编辑
export function editInvoice(num1, num2, num3, time1, money, send, receive, remark) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_发票_修改数据',
param: '发票流水号=' + num1 + '&采购合同流水号=' + num2 + '&发票号=' + num3 + '&开票时间=' + time1 + '&开票金额=' + money + '&传送人=' + send + '&接收人=' + receive + '&备注=' + remark
}
})
}
// 发票删除
export function deleteInvoice(num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_发票_删除数据',
param: '发票流水号=' + num1
}
})
}
// 传送人初始化 采购科改16
export function initSender() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=16'
}
})
}
// 接收人初始化 财务部7
export function initReceiver() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=7'
}
})
}
// 初始化合同号
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款情况_查询数据'
}
})
}

View File

@@ -12,12 +12,6 @@ export function getExplorer() {
return 'Safari'
}
}
export function method5(tableid) {
tableToExcel(tableid)
}
export function Cleanup() {
window.clearInterval(idTmr)
}
const tableToExcel = (function() {
const uri = 'data:application/vnd.ms-excel;base64,'
const template = `<html xmlns:x="urn:schemas-microsoft-com:office:excel"><head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><meta charset="UTF-8"><style type="text/css">table td {border: 2px solid #000000;width:100px;text-align: center;color: #000000;}</style></head><body><table>{table}</table></body></html>`
@@ -37,3 +31,10 @@ const tableToExcel = (function() {
}
})()
export function method5(tableid) {
tableToExcel(tableid)
}
export function Cleanup() {
window.clearInterval(idTmr)
}

View File

@@ -0,0 +1,20 @@
// 导出Excel方法表格id不加扩展名的文件名sheet名
export function exportExcelMethod(tableId, fileName, sheetName) {
tableToExcel(tableId, fileName, sheetName)
return 1
}
const tableToExcel = (function() {
const uri = 'data:application/vnd.ms-excel;base64,'
// 设置导出表格的单元格默认高度/宽度/边框样式/字体颜色/背景颜色/居中网页显示表格宽度建议1240tr/td视情况而定
const template = `<html xmlns:x="urn:schemas-microsoft-com:office:excel"><head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><meta charset="UTF-8"><style type="text/css">table td {border: 2px solid #000000;height:40px;text-align: center;color: #000000;}</style></head><body><table>{table}</table></body></html>`
const base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
const format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p] }) }
return function(table, filename, sheetname) {
if (!table.nodeType) table = document.getElementById(table)
const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML }
const aTag = document.createElement('a')
aTag.href = uri + base64(format(template, ctx))
aTag.download = filename
aTag.click()
}
})()

View File

@@ -6,7 +6,8 @@
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
<el-checkbox v-model="all" size="mini">查询全部</el-checkbox>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="downLoad('BL');edit()">导出备料单</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="downLoad('BL')">导出备料单</el-button>
<el-button type="primary" size="small" icon="el-icon-success" style="margin-left:10px" @click="edit()">导出完成</el-button>
</el-row>
</el-card>
@@ -78,10 +79,11 @@
<script>
import { searchtable, searchtable2, edit } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
import { exportExcelMethod } from './exportExcel'
export default {
data() {
return {
a: 0,
tableData2: [],
partName: '',
all: false,
@@ -118,10 +120,11 @@ export default {
for (let i = 0; i < this.Data.length; i++) {
searchtable2(this.Data[i].工艺计划流水号).then(response => {
this.tableData.push({
工艺计划流水号: this.Data[i].工艺计划流水号,
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料打印: this.Data[i].备料打印,
工艺要求: response.data[i].工艺要求
工艺要求: response.data[0].工艺要求
})
})
this.loading = false
@@ -133,18 +136,24 @@ export default {
this.tableData2 = val
},
edit() {
for (let i = 0; i < this.tableData2.length; i++) {
edit(this.tableData2[i].工艺计划流水号)
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
this.a = 0
for (let i = 0; i < this.tableData2.length; i++) {
edit(this.tableData2[i].工艺计划流水号)
this.a = this.a + 1
}
if (this.a === this.tableData2.length) {
this.searchTable()
}
}
},
downLoad(tableid) {
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
this.searchTable()
getExplorer()
method5(tableid)
Cleanup()
exportExcelMethod(tableid, '123', 'asd')
}
},
// 分页

View File

@@ -36,7 +36,8 @@
v-loading="listLoading2"
:data="tableData2"
style="width: 100%;max-height: 400px;"
height="400"
size="mini"
height="300"
highlight-current-row
border
@row-click="searchSpareParts">
@@ -97,7 +98,8 @@
v-loading="listLoading"
:data="tableData"
style="width: 100%;max-height: 400px;"
height="400"
size="mini"
height="300"
highlight-current-row
border
@row-click="searchProcedure">
@@ -153,7 +155,8 @@
v-loading="listLoading1"
:data="tableData1"
style="width: 100%;max-height: 400px;"
height="400"
size="mini"
height="300"
highlight-current-row
border>
<el-table-column align="center" label="工序顺序" width="100">
@@ -361,7 +364,6 @@ export default {
this.check3 = 0
}
searchTable(this.entryNameValue, this.machineValue, this.check2, this.GroupNumValue, this.check3, this.PartDrawingNumber, this.pageCurrent, this.pageSize).then(response => {
console.log(response)
this.tableData = response.data.rows
this.total = response.data.total
this.listLoading = false

View File

@@ -91,6 +91,11 @@
{{ scope.row.入库时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="processingStatus(scope.row)">查看加工进度</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -339,11 +344,49 @@
<el-button type="primary" @click="submitGroup">提交</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible4" title="零件加工进度" center style="min-height: 300px">
<el-table
:data="tableData5"
style="width: 100%;max-height: 400px;"
size="mini"
height="300"
highlight-current-row
border>
<el-table-column align="center" label="工序顺序" width="100">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺名称" width="150">
<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="工艺是否完成" width="130">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.工序状态)===4" type="success" size="small">已完成</el-tag>
<el-tag v-if="parseInt(scope.row.工序状态)===5" type="warning" size="small">报废</el-tag>
<el-tag v-if="parseInt(scope.row.工序状态)!==4 && parseInt(scope.row.工序状态)!==5" type="primary" size="small">未完成</el-tag>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchTable, searchmachine, searchgroup, searchPurchaseTable, searchTable1 } from '@/api/ManufacturingCenter/GroupMatching'
import { initProject, searchTable, searchmachine, searchgroup, searchPurchaseTable, searchTable1, processingStatus } from '@/api/ManufacturingCenter/GroupMatching'
export default {
data() {
return {
@@ -371,6 +414,7 @@ export default {
tableData6: [],
tableData: [],
tableData1: [],
tableData5: [],
state: null,
listLoading1: false,
listLoading2: false,
@@ -382,6 +426,7 @@ export default {
title: '',
dialogFormVisible2: false,
dialogFormVisible3: false,
dialogFormVisible4: false,
check: null,
check1: null,
check2: null,
@@ -511,6 +556,17 @@ export default {
}
})
},
processingStatus(row) {
this.dialogFormVisible4 = true
processingStatus(row.工艺计划流水号).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].计划日期 !== '' && response.data[i].计划日期 !== null) {
response.data[i].计划日期 = response.data[i].计划日期.split(' ')[0]
}
}
this.tableData5 = response.data
})
},
empty() {
this.machineToolNumber = ''
this.groupNumber = ''

View File

@@ -98,8 +98,8 @@ export default {
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料到货: this.Data[i].备料到货,
工艺要求: response.data[i].工艺要求,
工序流水号: response.data[i].工序流水号
工艺要求: response.data[0].工艺要求,
工序流水号: response.data[0].工序流水号
})
})
this.loading = false

View File

@@ -100,11 +100,6 @@
{{ 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.零件备注 }}
@@ -135,11 +130,6 @@
{{ 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.备注 }}
@@ -170,11 +160,6 @@
{{ 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.备注 }}
@@ -393,13 +378,13 @@
</el-dialog>
<el-dialog
:visible.sync="dialogFormVisible1"
:row-style="tableRowClassName"
title="基本件打回信息"
center
width="70%"
style="min-height: 400px">
<el-table
:data="tableData9"
:row-class-name="tableRowClassName"
size="mini"
style="width: 97%;max-height: 300px"
height="400"
@@ -432,7 +417,7 @@
</el-table-column>
<el-table-column align="center" label="机床编号">
<template slot-scope="scope">
{{ scope.row.机床 }}
{{ scope.row.机床 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号">
@@ -461,13 +446,13 @@
</el-dialog>
<el-dialog
:visible.sync="dialogFormVisible2"
:row-style="tableRowClassName"
title="外购件和标准件打回信息"
center
width="70%"
style="min-height: 400px">
<el-table
:data="tableData10"
:row-class-name="tableRowClassName"
size="mini"
style="width: 97%;max-height: 300px"
height="400"
@@ -500,7 +485,7 @@
</el-table-column>
<el-table-column align="center" label="机床编号">
<template slot-scope="scope">
{{ scope.row.机床 }}
{{ scope.row.机床 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号">
@@ -615,7 +600,7 @@ export default {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === '0') {
if (response.data[i].是否确认 === 0) {
this.value += 1
}
}
@@ -626,7 +611,7 @@ export default {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === '0') {
if (response.data[i].是否确认 === 0) {
this.value1 += 1
}
}
@@ -649,7 +634,7 @@ export default {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === '0') {
if (response.data[i].是否确认 === 0) {
this.value += 1
}
}
@@ -670,7 +655,7 @@ export default {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === '0') {
if (response.data[i].是否确认 === 0) {
this.value1 += 1
}
}
@@ -682,52 +667,75 @@ export default {
})
},
Delete(row) {
Delete(row.基本件流水号).then(response => {
this.value = 0
if (response.data[0].result === '1') {
this.$message.success('删除成功')
PartCallbackInformation().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
Delete(row.基本件流水号).then(response => {
this.value = 0
if (response.data[0].result === '1') {
this.$message.success('删除成功')
PartCallbackInformation().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === 0) {
this.value += 1
}
}
if (response.data[i].是否确认 === '0') {
this.value += 1
}
}
this.tableData9 = response.data
})
} else {
this.$message.error('删除失败')
}
this.tableData9 = response.data
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
Delete1(row) {
Delete1(row.标准件和外购件流水号).then(response => {
this.value1 = 0
if (response.data[0].result === '1') {
this.$message.success('删除成功')
PartCallbackInformation1().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
Delete1(row.标准件和外购件流水号).then(response => {
this.value1 = 0
if (response.data[0].result === '1') {
this.$message.success('删除成功')
PartCallbackInformation1().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === 0) {
this.value1 += 1
}
}
if (response.data[i].是否确认 === '0') {
this.value1 += 1
}
}
this.tableData10 = response.data
})
} else {
this.$message.error('删除失败')
}
this.tableData10 = response.data
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
tableRowClassName({ row }) {
if (row.是否确认 === '0') {
return 'background: #ffff66'
console.log(row.是否确认)
if (row.是否确认 === 0) {
return 'NotThrough'
} else {
return ''
return 'adopt'
}
},
projectChange() {
@@ -1197,3 +1205,11 @@ export default {
margin-right: 40px;
}
</style>
<style>
.el-table .NotThrough{
background: palevioletred;
}
.el-table .adopt{
background: limegreen;
}
</style>

View File

@@ -3,7 +3,7 @@
<el-card>
<el-row>
<span>项目名称:</span>
<el-select v-model="project" size="small" filterable clearable placeholder="项目名称" @change="getMachine">
<el-select v-model="project" size="small" filterable clearable placeholder="项目名称" style="width: 180px;" @change="getMachine">
<el-option
v-for="item in projects"
:key="item.value"
@@ -11,7 +11,7 @@
:value="item.value"/>
</el-select>
<span>机床号:</span>
<el-select v-model="Machine" size="small" clearable placeholder="机床号" @change="getGroup">
<el-select v-model="Machine" size="small" clearable placeholder="机床号" style="width: 180px;" @change="getGroup">
<el-option
v-for="item in Machines"
:key="item.value"
@@ -19,7 +19,7 @@
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="Group" size="small" clearable placeholder="组号">
<el-select v-model="Group" size="small" clearable placeholder="组号" style="width: 180px;">
<el-option
v-for="item in Groups"
:key="item.value"
@@ -28,16 +28,15 @@
</el-select>
</el-row>
<el-row>
<span>是否外协:</span>
<el-select v-model="part" size="small" placeholder="是否外协">
<el-select v-show="false" v-model="part" size="small" placeholder="是否外协">
<el-option
v-for="item in parts"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件号:</span>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 200px;"/>
<span>零件:</span>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 180px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
<span>进度颜色</span>
<span style="background-color: red">拖期</span>

View File

@@ -213,11 +213,6 @@
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column label="开票金额" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
</el-table-column>
<el-table-column label="接收人" align="center" width="180px">
<template slot-scope="scope">
{{ scope.row.接收人 }}
@@ -228,6 +223,11 @@
{{ scope.row.开户行 }}
</template>
</el-table-column>
<el-table-column label="开票金额" align="center" width="150px" prop="开票金额">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
</el-table-column>
<el-table-column label="开票日期" align="center">
<template slot-scope="scope">
{{ scope.row.开票时间 }}
@@ -426,12 +426,11 @@ export default {
},
methods: {
getSummaries(param) {
console.log(param)
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总'
sums[index] = '总金额'
return
}
const values = data.map(item => Number(item[column.property]))
@@ -446,7 +445,7 @@ export default {
}, 0)
sums[index] += ' 元'
} else {
sums[index] = 'N/A'
sums[index] = ''
}
})
return sums

View File

@@ -164,7 +164,7 @@
</template>
<script>
import { shouhuo, getTable, getData1, getTable1, getprocedure, searchManufactor, spareParts, addTable, editData, deleteData, insertParts, getParts, getPrice, editData1, deleteData1, getNumber } from '@/api/Outsourcing/OutsourcingTaskQuery'
import { handlechange, shouhuo, getTable, getData1, getTable1, getprocedure, searchManufactor, spareParts, addTable, editData, deleteData, insertParts, getParts, getPrice, editData1, deleteData1, getNumber } from '@/api/Outsourcing/OutsourcingTaskQuery'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
import { convertCurrency } from '@/vendor/int2Chinese'
import { mapGetters } from 'vuex'
@@ -176,6 +176,8 @@ export default {
},
data() {
return {
wancheng: '',
gongxulsh: [],
bianliang: [],
card: false,
费用: '',
@@ -292,12 +294,20 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
shouhuo(row.外协加工任务单流水号).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.getList()
if (this.wancheng === 1) {
for (let i = 0; i < this.gongxulsh.length; i++) {
handlechange(this.gongxulsh[i].工序流水号, '0000')
if (i === this.gongxulsh.length - 1) {
console.log(1)
shouhuo(row.外协加工任务单流水号).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.getList()
}
})
}
}
})
}
}).catch(() => {
this.$message({
type: 'info',
@@ -365,6 +375,8 @@ export default {
},
// 查询
searchProcess(row) {
this.wancheng = ''
this.gongxulsh = []
this.任务单号 = row.表单号
this.任务下达日期 = row.任务下达日期
this.外协厂家 = row.外协厂家
@@ -478,11 +490,14 @@ export default {
for (let i = 0; i < this.returns.length; i++) {
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) {
this.gongxulsh.push({
工序流水号: response.data[k].工序流水号
})
this.process[i][k] = response.data[k].工艺名称简称
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
// this.bianliang.push(this.returns[i])
this.wancheng = 1
})
}
}).then(() => {

View File

@@ -1,431 +0,0 @@
<template>
<div class="app-container">
<el-card>
<span>开始时间:</span>
<el-date-picker
v-model="startDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>结束时间:</span>
<el-date-picker
v-model="endDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>合同号:</span>
<el-input v-model="contractNum" placeholder="合同号" size="small" style="width:180px" clearable/>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px" clearable>
<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 :data="tableData1" size="mini" border style="width: 100%">
<el-table-column label="请款" min-width="80" align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
icon=""
@click="requestFund(scope.row)">请款</el-button>
</template>
</el-table-column>
<el-table-column label="采购合同编号" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" min-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.规定到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="供应商" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="总金额" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" min-width="70" align="center">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="采购员" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="本次请款金额" min-width="100" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.本次应请款" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="请款付款情况" width="900" align="center">
<template slot-scope="scope">
<el-table :id="scope.$index" :data="tableData11[scope.$index]" size="mini" border style="width: 100%;">
<el-table-column label="取消请款" width="100" align="center">
<template slot-scope="scope">
<el-button
:disabled="scope.row.审核情况流水号!==3"
type="danger"
size="mini"
@click="cancelRequestFund(scope.row)">取消请款</el-button>
</template>
</el-table-column>
<el-table-column label="次数" min-width="60" align="center" type="index"/>
<el-table-column label="请款金额" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="请款时间" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.请款时间 ? scope.row.请款时间.split(' ')[0] : '' }}
</template>
</el-table-column>
<el-table-column label="审核情况" width="80" 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="80" 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="80" 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>
</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-date-picker
v-model="startRequestDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="开始日期"/>
<el-date-picker
v-model="endRequestDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="结束日期"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="searchRequestTable">查询</el-button>
<el-button
type="warning"
size="small"
icon="el-icon-download"
style="margin-left:10px"
>导出Excel</el-button>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="tableData2" size="mini" border style="width: 100%;min-height:300px" height="300px">
<el-table-column label="采购合同编号" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" min-width="150" 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.规定到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="供应商" min-width="250" align="center">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="总金额" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="采购员" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" min-width="80" 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.请款时间.split(' ')[0] }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchTable1, requestFund, searchCondition, cancelRequestFund, searchRequestTable, initBuyer } from '@/api/PurchasingCenter/BuyerRequestFund'
import { mapGetters } from 'vuex'
export default {
data() {
return {
personValue: '',
person: [],
loading2: false,
tableData2: [],
tableData11: [],
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
startDate: '',
endDate: '',
contractNum: '',
submitDisable: true,
form1: {},
supplierName: '',
tableData01: [],
tableData1: [],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
startRequestDate: '',
endRequestDate: '',
checkRequest: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.initBuyer()
},
methods: {
initBuyer() { // 初始化采购人员
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.tableData1 = []
this.startDate && this.endDate ? this.check1 = 1 : this.check1 = 0
this.contractNum ? 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.startDate, this.endDate, this.check2, this.contractNum, this.check3, this.personValue, this.check4, this.supplierName).then(response => {
for (let j = 0; j < response.data.rows.length; j++) {
this.tableData11[j] = []
searchCondition(response.data.rows[j].采购合同流水号).then(response0 => {
if (response0.data.length === 0) {
this.tableData11[j].push(response0.data)
document.getElementById(j).setAttribute('style', 'display:none')
} else {
for (let i = 0; i < response0.data.length; i++) {
this.tableData11[j].push(response0.data[i])
}
}
})
}
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()
},
requestFund(row) { // 请款
const day1 = new Date()
const day2 = day1.getFullYear() + '-' + (day1.getMonth() + 1) + '-' + day1.getDate()
requestFund(row.采购合同流水号, row.本次应请款, day2, this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('请款成功')
this.searchTable1()
this.startRequestDate = ''
this.endRequestDate = ''
this.tableData2 = []
} else { this.$message.error('请款失败') }
})
},
cancelRequestFund(row) { // 取消请款
console.log(row)
this.$confirm('确认取消请款吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (parseInt(row.采购科请款流水号) !== 1) {
cancelRequestFund(row.采购科请款流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
this.startRequestDate = ''
this.endRequestDate = ''
this.tableData2 = []
} else { this.$message.error('操作失败') }
})
} else {
this.$message.error('财务已经付款')
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
searchRequestTable() { // 查询请款表
this.loading2 = true
if ((this.startRequestDate === '' || this.startRequestDate === null) && (this.endRequestDate === '' || this.endRequestDate === null)) {
this.checkRequest = 0
} else if (this.startRequestDate !== '' && this.startRequestDate !== null && this.endRequestDate !== '' && this.endRequestDate !== null) {
this.checkRequest = 1
} else {
this.$message.error('请款时间区间有误')
this.loading2 = false
return
}
searchRequestTable(this.checkRequest, this.startRequestDate, this.endRequestDate).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(' '))
}
}
this.tableData2 = response.data
this.loading2 = false
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px!important;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
</style>

View File

@@ -1,647 +0,0 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="12">
<el-card>
<el-row>
<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" clearable style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<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>
<span>变更原因:</span>
<el-input v-model="changeReason" placeholder="变更原因" size="small" clearable style="width:200px"/>
<el-button
type="primary"
size="small"
icon="el-icon-edit-outline"
style="margin-left:10px"
@click="contractChange">合同变更</el-button>
</el-row>
<el-table
v-loading="loading1"
:data="tableData1"
size="mini"
border
style="width: 100%;max-height: 250px;"
height="250px"
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="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.规定到货时间.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-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" fixed="right">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="deleteContract(scope.row)">作废</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0 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>
<table id="01" 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">{{ contract01 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">供方</td>
<td colspan="1" align="center">{{ supplier01 }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="1" align="center">江苏盐城</td>
</tr>
</table>
<div> 产品名称型号数量单价品牌</div>
<table id="02" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="04">
<tr id="tableHead01" 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">{{ freight01 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB01 }}(含0.17增值税) </td>
<td colspan="1" align="center">{{ TotalAmount01 }}</td>
</tr>
</tfoot>
</table>
<div id="textarea01"/>
</el-card>
</el-card>
</el-col>
<el-col :span="12">
<el-card>
<el-row>
<span>时间段:</span>
<el-date-picker
v-model="startEndDate3"
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="contractNumValue3" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum3"
: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="personValue3" 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>
</el-row>
<el-row>
<span>供应商:</span>
<el-input v-model="supplierName3" placeholder="供应商" size="small" clearable style="width:180px"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total3=0;pageCurrent3=1;pageSize3=10;searchTable3()">查询旧合同</el-button>
</el-row>
<el-table
v-loading="loading3"
:data="tableData3"
size="mini"
border
style="width: 100%;max-height: 250px;"
height="250px"
highlight-current-row
@row-click="searchTable4">
<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="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="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="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="100">
<template slot-scope="scope">
{{ scope.row.合同变更原因 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
<el-card>
<table id="11" 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">{{ contract02 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">供方</td>
<td colspan="1" align="center">{{ supplier02 }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="1" align="center">江苏盐城</td>
</tr>
</table>
<div> 产品名称型号数量单价品牌</div>
<table id="12" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="14">
<tr id="tableHead02" 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">{{ freight02 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB02 }}(含0.17增值税) </td>
<td colspan="1" align="center">{{ TotalAmount02 }}</td>
</tr>
</tfoot>
</table>
<div id="textarea02"/>
</el-card>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { initContract, initBuyer, searchTable1, searchTable2, contractChange,
searchChangeContract, initChangeContract, searchTable4, initPayMethod, deleteContract } from '@/api/PurchasingCenter/ContractChange'
export default {
data() {
return {
returns01: [],
contract01: '',
supplier01: '',
freight01: '',
RMB01: '',
TotalAmount01: '',
textarea01: '',
returns02: [],
contract02: '',
supplier02: '',
freight02: '',
RMB02: '',
TotalAmount02: '',
textarea02: '',
check1: 0,
check2: 0,
check3: 0,
check4: 0,
startEndDate: '',
contractNumValue: '',
contractNum: [],
personValue: '',
person: [],
supplierName: '',
supplierValue: '',
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData1: [],
loading1: false,
tableData01: [],
tableData02: [],
submitDisable: true,
dialogVisible2: false,
changeReason: '',
contractValue: '', // 显示表2和变更合同用的变量
tableData3: [],
loading3: false,
total3: 0,
pageCurrent3: 1,
pageSize3: 10,
check31: 0,
check32: 0,
check33: 0,
check34: 0,
check35: 0,
check36: 0,
startEndDate3: '',
contractNumValue3: '',
supplierName3: '',
project3: '',
personValue3: '',
contractNum3: [],
payMethod: [],
payMethodValue: ''
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.contractNum = []
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].采购合同流水号
})
}
})
this.contractNum3 = []
initChangeContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum3.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
this.payMethod = []
initPayMethod().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.payMethod.push({
label: response.data[i].付款方式内容,
value: response.data[i].付款方式流水号
})
}
})
this.person = []
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.textarea01 = ''
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
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) {
this.supplier01 = row.供应商名称
this.contract01 = row.采购合同编号
this.freight01 = parseFloat(row.总金额) - parseFloat(row.总金额_小计)
this.RMB01 = row.总金额_文本
this.TotalAmount01 = row.总金额
this.textarea01 = row.合同文本
document.getElementById('textarea01').innerText = this.textarea01
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns01 = response.data
const children = document.getElementsByClassName('tableData01')
const parent = document.getElementById('04')
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.returns01.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData01')
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('tableHead01').after(tr[i])
}
for (let j = 0; j < this.returns01.length; j++) {
document.getElementsByClassName('tableData01')[j].children[0].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData01')[j].children[1].innerHTML = response.data[j].物料规格
document.getElementsByClassName('tableData01')[j].children[2].innerHTML = response.data[j].物料型号
document.getElementsByClassName('tableData01')[j].children[3].innerHTML = response.data[j].发货天数
document.getElementsByClassName('tableData01')[j].children[4].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData01')[j].children[5].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData01')[j].children[6].innerHTML = response.data[j].金额
}
})
},
contractChange() {
if (this.contractValue) {
this.$confirm('确定更改该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
contractChange(this.contractValue, this.changeReason).then(response => {
this.contractValue = ''
this.changeReason = ''
if (response.data[0].result === '1') {
this.$message.success('变更成功')
this.searchTable1()
this.contractNumValue = ''
this.contractNumValue3 = ''
this.fetchData()
} else { this.$message.error('变更失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
} else {
this.$message.error('请先选择合同')
}
},
searchTable3() {
this.textarea02 = ''
this.loading3 = true
if (this.startEndDate3 === '' || this.startEndDate3 === null || this.startEndDate3[0] === '' || this.startEndDate3[1] === '') {
this.check31 = 0
this.startEndDate3 = ''
} else { this.check31 = 1 }
this.contractNumValue3 ? this.check32 = 1 : this.check32 = 0
this.personValue3 ? this.check33 = 1 : this.check33 = 0
this.supplierName3 ? this.check34 = 1 : this.check34 = 0
this.project3 ? this.check35 = 1 : this.check35 = 0
this.payMethodValue ? this.check36 = 1 : this.check36 = 0
searchChangeContract(this.pageCurrent3, this.pageSize3, this.check31, this.startEndDate3[0], this.startEndDate3[1], this.check32, this.contractNumValue3, this.check33, this.personValue3, this.check34, this.supplierName3, this.check35, this.project3, this.check36, this.payMethodValue).then(response => {
this.loading3 = false
console.log(response.data)
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(' '))
}
if (response.data.rows[j].实际到货时间 !== null) {
response.data.rows[j].实际到货时间 = response.data.rows[j].实际到货时间.substring(0, response.data.rows[j].实际到货时间.indexOf(' '))
}
}
this.tableData3 = response.data.rows
this.total3 = response.data.total
})
},
handleSizeChange3(val) {
this.pageCurrent3 = 1
this.pageSize3 = val
this.searchTable3()
},
handleCurrentChange3(val) {
this.pageCurrent3 = val
this.searchTable3()
},
searchTable4(row) {
this.supplier02 = row.供应商名称
this.contract02 = row.采购合同编号
this.freight02 = parseFloat(row.运费)
this.RMB02 = row.总金额_文本
this.TotalAmount02 = row.总金额
this.textarea02 = row.合同文本
document.getElementById('textarea02').innerText = this.textarea02
this.contractValue = parseInt(row.采购合同变更流水号)
searchTable4(this.contractValue).then(response => {
this.returns02 = response.data
const children = document.getElementsByClassName('tableData02')
const parent = document.getElementById('14')
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.returns02.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData02')
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('tableHead02').after(tr[i])
}
for (let j = 0; j < this.returns02.length; j++) {
document.getElementsByClassName('tableData02')[j].children[0].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData02')[j].children[1].innerHTML = response.data[j].物料规格
document.getElementsByClassName('tableData02')[j].children[2].innerHTML = response.data[j].物料型号
document.getElementsByClassName('tableData02')[j].children[3].innerHTML = response.data[j].发货天数
document.getElementsByClassName('tableData02')[j].children[4].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData02')[j].children[5].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData02')[j].children[6].innerHTML = response.data[j].金额
}
})
},
deleteContract(row) { // 合同作废
this.$confirm('确定作废该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteContract(row.采购合同流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('作废成功')
this.searchTable1()
this.contractNumValue = ''
this.contractNumValue3 = ''
this.fetchData()
} 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;
}
.el-row{
margin-bottom: 10px;
}
</style>

View File

@@ -1,221 +0,0 @@
<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

@@ -1,597 +0,0 @@
<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">
<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">
<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">
<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">
<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">
<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">
<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" readonly/>
</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 || time.getTime() < new Date()
}
}
},
form1: {},
contractNumValue: '', // 合同流水号
contractNum: [],
contractNameNum: '', // 合同编号/询价单号
contractName: '产品购销合同', // 合同名称
supplierName: '', // 供应商名称
stipulateArrivalTime: '', // 规定到货时间
payMethodValue: 1, // 付款方式流水号
payMethodName: '', // 付款方式名称
payMethod: [],
payTime: [],
payTime1Value: 1, // 付款时间
payTime2Value: 1, // 付款时间
payTime3Value: 1, // 付款时间
payTime4Value: 1, // 付款时间
payTime5Value: 1, // 付款时间
payTime6Value: 1, // 付款时间
freight: 0, // 运费
taxRate: '0.17', // 税率
currencyValue: 1, // 币种
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++) {
if (parseInt(response.data[i].付款时间节点流水号) !== 0) {
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

@@ -141,7 +141,7 @@
<span>合同总额</span>
<el-input v-model="actualTotal" size="small" style="width: 100px"/>
<el-button type="primary" size="small" @click="submitTotal()">确定总额</el-button>
<el-button type="success" size="small" @click="generateContract()">生成合同</el-button>
<el-button type="success" size="small" @click="generateContract()">递交审批</el-button>
</div>
<hr>
<!--html代码-->
@@ -546,7 +546,7 @@ export default {
this.交货期组.push(this.tableData1[i].交货期)
}
if (this.contractNumValue) {
this.$confirm('此操作将生成采购合同,确认完成编辑?', '提示', {
this.$confirm('此采购合同将递交审批,递交后该合同不可删除,确认完成编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

View File

@@ -1,304 +0,0 @@
<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

@@ -1,224 +0,0 @@
<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 :status="Number(scope.row.到票总金额)>Number(scope.row.合同总金额)?'exception':'success'" :text-inside="true" :stroke-width="18" :percentage="Number(scope.row.到票总金额)>Number(scope.row.合同总金额)?100:parseFloat((100*(scope.row.到票总金额/scope.row.合同总金额)).toFixed(2))"/>
</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>

View File

@@ -422,7 +422,7 @@
<div id="offlineContract" style="width: 800px;margin: 0 auto;display: none">
<table class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr>
<th colspan="14"><h4>离线合同</h4></th>
<th colspan="14"><h1>离线合同</h1></th>
</tr>
<tr>
<td colspan="3" rowspan="2" style="text-align:center;font-size: 30px;font-weight: bold">GAOJING</td>

View File

@@ -1,397 +0,0 @@
<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.预付时间.split(' ')[0] }}
</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.预付时间 ? scope.row.预付时间.split(' ')[0] : '参考时间节点未设置' }}
</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

@@ -193,6 +193,7 @@ export default {
},
created() {
this.fetchData()
this.searchTable1()
},
methods: {
fetchData() {

View File

@@ -22,6 +22,8 @@
<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 style="width:180px"/>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" clearable style="width: 100px">
<el-option
@@ -30,10 +32,8 @@
: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-select v-model="approvalValue" placeholder="审批情况" size="small" style="width: 100px">
<el-option
v-for="item in approval"
:key="item.value"
@@ -94,11 +94,11 @@
</el-form>
</template>
</el-table-column>
<el-table-column label="审批情况" align="center" min-width="100">
<el-table-column label="审批情况" align="center" min-width="80">
<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>
<el-tag v-if="scope.row.审批情况内容==='未审批'" type="primary" size="small">未审批</el-tag>
<el-tag v-if="scope.row.审批情况内容==='通过审批'" type="success" size="small">通过</el-tag>
<el-tag v-if="scope.row.审批情况内容==='不通过审批'" type="danger" size="small">通过</el-tag>
</template>
</el-table-column>
<el-table-column label="采购合同号" align="center" min-width="130">
@@ -111,7 +111,7 @@
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="150">
<el-table-column label="供应商" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
@@ -131,6 +131,11 @@
{{ scope.row.未通过原因 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<el-button :disabled="true" type="danger" size="mini" icon="el-icon-delete" @click="deleteContract(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -154,8 +159,7 @@
</template>
<script>
import { initContract, initBuyer, searchTable1, searchTable2 } from '@/api/PurchasingCenter/PurchaseContractSearch'
import { searchFile } from '@/api/PurchasingCenter/CreateContract'
import { initContract, initBuyer, searchTable1, searchTable2, deleteContract } from '@/api/PurchasingCenter/PurchaseContractSearch'
import QRCode from 'qrcode'
import $ from 'jquery'
// import { exportExcelMethod } from './exportExcel'
@@ -169,7 +173,7 @@ export default {
label: '全部'
}, {
value: 1,
label: '通过'
label: '通过'
}, {
value: 2,
label: '未通过'
@@ -177,7 +181,7 @@ export default {
value: 3,
label: '未审批'
}],
approvalValue: '',
approvalValue: 0,
RMB: '',
TotalAmount: '',
check1: 0,
@@ -204,6 +208,7 @@ export default {
tableData01: [],
tableData02: [],
submitDisable: true,
disable: [], // 删除按钮禁用
tableData2: [],
textarea: ``,
contractValue: '' // 显示表2和变更合同用的变量
@@ -214,7 +219,27 @@ export default {
this.searchTable1()
},
methods: {
download() {
deleteContract(row) { // 删除合同
this.$confirm('此操作将永久删除合同所有内容,确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteContract(row.采购合同流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable1()
this.returns = ''
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
download() { // 导出打印
if (this.contractValue) {
// exportExcelMethod('print', '采购合同', '采购合同sheet1')
const htmlNode = $('#print').html()
@@ -229,7 +254,7 @@ export default {
this.$message.error('请选择合同')
}
},
useqrcode(contractNum) {
useqrcode(contractNum) { // 二维码
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
@@ -246,16 +271,6 @@ export default {
img.src = url
})
},
searchPic() {
// 读取图片时查找合同流水号获取其下所有图片id根据拼接成的路径查询图片显示出来。
searchFile(this.contractValue).then(response => {
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++) {
@@ -280,6 +295,7 @@ export default {
this.tableData2 = []
this.textarea = ``
this.loading1 = true
this.disable = []
if (this.startEndDate === '' || this.startEndDate === null || this.startEndDate[0] === '' || this.startEndDate[1] === '') {
this.check1 = 0
this.startEndDate = ''
@@ -293,9 +309,12 @@ export default {
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 i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].审批情况内容 === '未审批' ? this.disable.push(false) : this.disable.push(true) // 删除按钮禁用
}
this.tableData1 = response.data.rows
this.total1 = response.data.total
this.loading1 = false
})
},
handleSizeChange1(val) {
@@ -308,7 +327,6 @@ export default {
this.searchTable1()
},
searchTable2(row) {
this.searchPic() // 显示图片
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns = response.data[0].合同内容

View File

@@ -1,429 +0,0 @@
<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 sender"
: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 receiver"
: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.开票时间 ? 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.接收人姓名==='请选择' ? '—' : scope.row.接收人姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="200px">
<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
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 sender"
: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 receiver"
: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, initSender, initReceiver, initContract } from '@/api/PurchasingCenter/ReceiptConnectionSheet'
import { mapGetters } from 'vuex'
export default {
name: '', // 发票交接单
data() {
return {
contractNumValue: '',
contractNums: [],
invoiceNum: '',
invoiceTime: '',
transmitValue: '',
sender: [], // 传送人
receiver: [], // 接收人
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].采购合同流水号
})
}
})
initSender().then(response => { // 传送人
for (let i = 0; i < response.data.length; i++) {
this.sender.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
initReceiver().then(response => { // 接收人
for (let i = 0; i < response.data.length; i++) {
this.receiver.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>