This commit is contained in:
liushuai
2018-12-17 20:37:18 +08:00
60 changed files with 5561 additions and 731 deletions

View File

@@ -0,0 +1,25 @@
import request from '@/utils/request'
// 初始化日历
export function initClendar(year, month) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_基础表_工作日历_获得状态',
param: '工作年=' + year + '&工作月=' + month
}
})
}
// 修改工作状态
export function changeState(time, code) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_基础表_工作日历_设置状态',
param: '工作日期=' + time + '&工作日状态=' + code
}
})
}

View File

@@ -0,0 +1,74 @@
import request from '@/utils/request'
// 查询班次
export function getScheduling(SchedulingType) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '设备管理_基础表_班次表_查询数据',
param: '班次类型=' + SchedulingType
}
})
}
// 查询班次
export function searchProgramme() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '设备管理_基础表_班次表_查询班次'
}
})
}
// 新增班次
export function addShift(starttime, endtime, shifttype, shiftnumber, nightwork, work, temporary, difficult, note) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '设备管理_基础表_班次表_增加数据',
param: '开始工作时间=' + starttime + '&结束工作时间=' + endtime + '&班次类型=' + shifttype + '&班次代码=' + shiftnumber + '&是否夜班=' + nightwork + '&是否工作=' + work + '=int&是否可以安排临时件=' + temporary + '=int&是否可以安排高难度件=' + difficult + '=int&备注=' + note
}
})
}
// 编辑班次
export function editShift(shiftCode, starttime, endtime, shifttype, shiftnumber, nightwork, work, temporary, difficult, note) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '设备管理_基础表_班次表_修改数据',
param: '序号=' + shiftCode + '=int&开始工作时间=' + starttime + '=datetime&结束工作时间=' + endtime + '=datetime&班次类型=' + shifttype + '=int&班次代码=' + shiftnumber + '=int&是否夜班=' + nightwork + '=int&是否工作=' + work + '=int&是否可以安排临时件=' + temporary + '=int&是否可以安排高难度件=' + difficult + '=int&备注=' + note
}
})
}
// 删除班次
export function deleteShift(shiftCode) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '设备管理_基础表_班次表_删除数据',
param: '序号=' + shiftCode
}
})
}
// 删除班次
export function addShiftType() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '设备管理_基础表_班次表_班次类型与工作时间_增加'
}
})
}

View File

@@ -197,3 +197,15 @@ export function searchHoursePurchasePart(pageCurrent, pageSize, project_check, p
} }
}) })
} }
// 车间采购外购件查询
export function CheckAlter(receive, project, machinenumber, partnumber, oldnumber, reason, number, people, locate, contractdetail, alterdate, craftnumber, materialType, materiallocate) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '库存管理_库存盘点_修改数量',
param: '收件信息ID=' + receive + '&项目流水号=' + project + '&机床流水号=' + machinenumber + '&组件流水号=' + partnumber + '&原数量=' + oldnumber + '&修改原因=' + reason + '&数量=' + number + '&人员编号=' + people + '&货位流水号=' + locate + '&采购合同明细流水号=' + contractdetail + '&工艺计划流水号=' + craftnumber + '&零件类型代码=' + materialType + '&物料与货位对照流水号=' + materiallocate
}
})
}

View File

@@ -72,3 +72,15 @@ export function WorkShopPart(data1, data2, data3, data4, data5) {
} }
}) })
} }
// 车间采购件零件出库
export function ErrorOut(data1, data2, data3, data4, data5, data6, data7, data8) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '零件出库_零件出库_异常出库',
param: '项目流水号=' + data1 + '&机床流水号=' + data2 + '&组件流水号=' + data3 + '&采购合同明细流水号=' + data4 + '&工艺计划流水号=' + data5 + '&货位流水号=' + data6 + '&异常数量=' + data7 + '&异常原因=' + data8
}
})
}

View File

@@ -0,0 +1,123 @@
import request from '@/utils/request'
// 初始化项目
export function initProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_项目名称_查询数据'
}
})
}
// 查询仓库
export function initWarehouse() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_货位仓库_仓库_查询数据'
}
})
}
// 机床查询
export function searchmachine(check, num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_机床名称_查询数据',
param: '项目流水号_check=' + check + '=int&项目流水号=' + num
}
})
}
// 分组查询
export function searchTeam(machineNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_组件名称_查询数据',
param: '机床流水号=' + machineNumber
}
})
}
// 修改记录查询
export function searchAlterRecord(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_库存盘点_修改记录查询',
param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 异常记录查询
export function searchErrorRecord(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_零件出库_异常记录查询',
param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 补投单查询
export function searchReplacementCard(pageCurrent, pageSize, card_check, card) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_补投单_补投单查询',
param: '补投单编号_check=' + card_check + '&补投单编号=' + card,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 补投增加
export function addReplacementCard(Number, house) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '库存管理_补投单_补投单增加',
param: '人员编号=' + Number + '&仓库流水号=' + house
}
})
}
// 补投删除
export function deleteReplacementCard(Number) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '库存管理_补投单_补投单删除',
param: '补投单流水号=' + Number
}
})
}
// 补投增加
export function addCardDetail(Number, project, machine, team, name, mass, locate, parttype, reason) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '库存管理_零件补投_批量增加补投单明细',
param: '补投单流水号=' + Number + '&项目流水号组=' + project + '&机床流水号组=' + machine + '&组件流水号组=' + team + '&名称组=' + name + '&数量组=' + mass + '&货位流水号组=' + locate + '&零件类型组=' + parttype + '&原因组=' + reason
}
})
}

View File

@@ -0,0 +1,39 @@
import request from '@/utils/request'
// 查询零件
export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工艺计划_编制工艺_备料零件查询',
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料打印_check=' + num3 + '&备料打印=' + num4 + '&备料到货=0',
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询零件工艺
export function searchtable2(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_备料打印_查询工序信息',
param: '工艺计划流水号=' + num1
}
})
}
// 更改打印状态
export function edit(num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_备料单导出_状态更改',
param: '工艺计划流水号=' + num1
}
})
}

View File

@@ -0,0 +1,51 @@
import request from '@/utils/request'
// 查询零件
export function searchtable(num1, num2, num3, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工艺计划_编制工艺_备料到货查询',
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料到货_check=' + num3,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询零件工艺
export function searchtable2(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_备料打印_查询工序信息',
param: '工艺计划流水号=' + num1
}
})
}
// 更改打印状态
export function edit(num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_备料到货_状态更改',
param: '工艺计划流水号=' + num1
}
})
}
export function handlechange(Number, code) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_零件工序_修改数据_工作者',
param: '工序流水号=' + Number + '&工作者考勤编号=' + code
}
})
}

View File

@@ -174,7 +174,7 @@ export function initPerson() {
data: { data: {
type: '1', type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号', name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=17' param: '考核部门编号=9'
} }
}) })
} }

View File

@@ -129,7 +129,7 @@ export function initPerson() {
data: { data: {
type: '1', type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号', name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=9' param: '考核部门编号=17'
} }
}) })
} }

View File

@@ -0,0 +1,132 @@
import request from '@/utils/request'
export function initProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_项目名称_总_查询'
}
})
}
export function searchTableData1(pageCurrent, pageSize, num1, num2, num3, num4, num5, num6) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_履约保证金_合同信息统计_查询',
param: '项目流水号=' + num1 + '=int&项目流水号_check=' + num2 + '=int&开始日期_check=' + num3 + '=int&结束日期_check=' + num4 + '=int&开始日期=' + num5 + '=date&结束日期=' + num6 + '=date',
Pagination: pageCurrent + '&' + pageSize
}
})
}
export function typeOfPerformanceBond(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_履约保证金类型_查询',
param: '项目流水号=' + num1 + '=int'
}
})
}
export function searchTableData2(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_履约保证金_查询',
param: '项目流水号=' + num1 + '=int'
}
})
}
export function takeBack(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_收回',
param: '履约保证金流水号=' + num1 + '=int&实际收回日期=' + num2 + '=string'
}
})
}
export function executionProgressID() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_执行进度_查询'
}
})
}
export function initType() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '投标保证金管理_保证金类型查询'
}
})
}
export function addPerformanceBond() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_增加',
param: '项目流水号=' + arguments[0] + '&保证金金额=' + arguments[1] + '&保证金类型流水号=' + arguments[2] + '&收回条件=' + arguments[3] + '&截止时间=' + arguments[4]
}
})
}
export function editPerformanceBond() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_修改',
param: '项目流水号=' + arguments[0] + '&保证金金额=' + arguments[1] + '&保证金类型流水号=' + arguments[2] + '&收回条件=' + arguments[3] + '&截止时间=' + arguments[4] + '&履约保证金流水号=' + arguments[5]
}
})
}
export function delPerformanceBond() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_删除',
param: '项目流水号=' + arguments[0] + '&履约保证金流水号=' + arguments[1]
}
})
}
export function addPerformanceGuarantee() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_履约保函新增',
param: '项目流水号=' + arguments[0]
}
})
}
export function delPerformanceGuarantee() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_履约保证金_履约保函_删除',
param: '项目流水号=' + arguments[0]
}
})
}

View File

@@ -1,16 +1,5 @@
import request from '@/utils/request' import request from '@/utils/request'
// 初始化询价状态
export function initInquiryState() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购部采购_询价状态_查询'
}
})
}
// 查询分配后的标准件和外购件 // 查询分配后的标准件和外购件
export function searchMaterial(pageCurrent, pageSize, check1, num1, check2, num2, person) { export function searchMaterial(pageCurrent, pageSize, check1, num1, check2, num2, person) {
return request({ return request({

View File

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

View File

@@ -50,49 +50,27 @@ export function searchSupplier(check1, value1, check2, value2, check3, value3, c
} }
}) })
} }
// 初始化付款方式
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 addOfflineContract(contractNum, contractName, supplier, person, date, freight, type, one, two, three, four) { export function addOfflineContract(contractNum, contractName, supplier, person, date, remark) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_离线合同_增加数据', name: '采购管理_离线合同_增加数据',
param: `离线合同编号=${contractNum}&离线合同名称=${contractName}&供应商流水号=${supplier}&人员编号=${person}&规定到货时间=${date}&运费=${freight}&付款方式流水号=${type}&第一次付款时间节点流水号=${one}&第二次付款时间节点流水号=${two}&第三次付款时间节点流水号=${three}&第四次付款时间节点流水号=${four}` param: `离线合同编号=${contractNum}&离线合同名称=${contractName}&供应商流水号=${supplier}&人员编号=${person}&规定到货时间=${date}&离线合同备注=${remark}`
} }
}) })
} }
// 编辑离线合同 // 编辑离线合同
export function editOfflineContract(contractNumValue, contractNum, contractName, supplier, person, date, freight, type, one, two, three, four) { export function editOfflineContract(contractNumValue, contractNum, contractName, supplier, person, date, remark) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_离线合同_修改数据', name: '采购管理_离线合同_修改数据',
param: `离线合同流水号=${contractNumValue}&离线合同编号=${contractNum}&离线合同名称=${contractName}&供应商流水号=${supplier}&人员编号=${person}&规定到货时间=${date}&运费=${freight}&付款方式流水号=${type}&第一次付款时间节点流水号=${one}&第二次付款时间节点流水号=${two}&第三次付款时间节点流水号=${three}&第四次付款时间节点流水号=${four}` param: `离线合同流水号=${contractNumValue}&离线合同编号=${contractNum}&离线合同名称=${contractName}&供应商流水号=${supplier}&人员编号=${person}&规定到货时间=${date}&离线合同备注=${remark}`
} }
}) })
} }
@@ -145,26 +123,14 @@ export function deleteMateriel(num) {
}) })
} }
// 生成离线合同 // 生成离线合同
export function doneOfflineContact(contractNum, total, text, partGroup, numGroup, priceGroup) { export function doneOfflineContact(contractNum, total, partGroup, numGroup, priceGroup) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_离线合同_生成合同', name: '采购管理_离线合同_生成合同',
param: `离线合同流水号=${contractNum}&合同总额=${total}&合同文本=${text}&离线合同明细流水号组=${partGroup}&数量组=${numGroup}&单价组=${priceGroup}` param: `离线合同流水号=${contractNum}&合同总额=${total}&离线合同明细流水号组=${partGroup}&数量组=${numGroup}&单价组=${priceGroup}`
}
})
}
// 查询合同模板
export function searchContractDemo(num1 = null) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_合同模板_查询数据',
param: '合同模板流水号=' + num1
} }
}) })
} }

View File

@@ -18,7 +18,7 @@ export function searchProjectTotal(num) {
method: 'post', method: 'post',
data: { data: {
type: '1', type: '1',
name: '采购管理_项目总价_明细_查询数据', name: '采购管理_项目采购总价_查询数据',
param: `项目流水号=${num}` param: `项目流水号=${num}`
} }
}) })

View File

@@ -1,4 +1,16 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询付款计划
export function searchTable0(check, date1, date2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款计划_查询数据',
param: `时间段_check=${check}&开始时间=${date1}&结束时间=${date2}`
}
})
}
// 初始化合同 // 初始化合同
export function initContract() { export function initContract() {
return request({ return request({

View File

@@ -60,14 +60,3 @@ export function searchTable2(num) {
} }
}) })
} }
export function submitApproval(num, num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_合同审批_修改数据',
param: '采购合同流水号=' + num + '&审批情况流水号=' + num1 + '&未通过原因=' + num2
}
})
}

View File

@@ -11,17 +11,6 @@ export function initProject() {
} }
}) })
} }
// 初始化合同号
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款情况_查询数据'
}
})
}
// 发票查询 // 发票查询
export function searchInvoice(...params) { export function searchInvoice(...params) {
return request({ return request({
@@ -30,20 +19,7 @@ export function searchInvoice(...params) {
data: { data: {
type: '1', type: '1',
name: '采购管理_采购发票_查询数据', name: '采购管理_采购发票_查询数据',
param: `项目流水号_check=${params[2]}&项目流水号=${params[3]}&采购合同流水号_check=${params[4]}&采购合同流水号=${params[5]}`, param: `供应商流水号_check=${params[2]}&供应商流水号=${params[3]}&采购合同流水号_check=${params[4]}&采购合同流水号=${params[5]}`,
Pagination: params[0] + '&' + params[1]
}
})
}
// 发票详情查询
export function searchInvoiceDetail(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购发票_查询数据',
param: `项目流水号_check=${params[2]}&项目流水号=${params[3]}&采购合同流水号_check=${params[4]}&采购合同流水号=${params[5]}`,
Pagination: params[0] + '&' + params[1] Pagination: params[0] + '&' + params[1]
} }
}) })
@@ -56,19 +32,19 @@ export function addInvoice(...params) {
data: { data: {
type: '2', type: '2',
name: '采购管理_采购发票_增加数据', name: '采购管理_采购发票_增加数据',
param: `采购合同流水号=${params[0]}&开票金额=${params[1]}&传送人流水号=${params[2]}` param: `采购合同流水号=${params[0]}&开票金额=${params[1]}&传送人流水号=${params[2]}&备注=${params[3]}`
} }
}) })
} }
// 发票编辑 // 发票编辑
export function editInvoice(num1, num2, num3, time1, money, send, receive, remark) { export function editInvoice(...params) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_发票_修改数据', name: '采购管理_采购发票_修改数据',
param: '发票流水号=' + num1 + '&采购合同流水号=' + num2 + '&发票号=' + num3 + '&开票时间=' + time1 + '&开票金额=' + money + '&传送人=' + send + '&接收人=' + receive + '&备注=' + remark param: `发票交接流水号=${params[0]}&发票号=${params[1]}&开户行=${params[2]}&开票时间=${params[3]}&接收人流水号=${params[4]}`
} }
}) })
} }
@@ -79,8 +55,8 @@ export function deleteInvoice(num1) {
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_发票_删除数据', name: '采购管理_采购发票_删除数据',
param: '发票流水号=' + num1 param: '发票交接流水号=' + num1
} }
}) })
} }
@@ -96,3 +72,50 @@ export function initSender() {
} }
}) })
} }
// 初始化供应商
export function initSupplier() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_供应商_查询数据_根据条件'
}
})
}
// 根据供应商查合同
export function searchContract(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同_查询数据_根据供应商',
param: `供应商流水号=${num}`
}
})
}
// 根据供应商查合同
export function searchOffline(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_离线合同_查询数据_根据供应商',
param: `供应商流水号=${num}`
}
})
}
// 根据供应商查合同
export function invoiceDetail(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购发票明细_查询数据',
param: `发票交接流水号=${num}`
}
})
}

View File

@@ -54,7 +54,7 @@ export function searchTable1(...params) {
data: { data: {
type: '1', type: '1',
name: '采购管理_采购部采购_查询物料', name: '采购管理_采购部采购_查询物料',
param: `物料类别流水号_check=${params[2]}&物料类别流水号=${params[3]}&物料品种流水号_check=${params[4]}&物料品种流水号=${params[5]}&项目流水号_check=${params[6]}&项目流水号=${params[7]}&物料名称_check=${params[8]}&物料名称=${params[9]}&分配状态=${params[10]}`, param: `物料类别流水号_check=${params[2]}&物料类别流水号=${params[3]}&物料品种流水号_check=${params[4]}&物料品种流水号=${params[5]}&项目流水号_check=${params[6]}&项目流水号=${params[7]}&物料名称_check=${params[8]}&物料名称=${params[9]}&物料状态=${params[10]}`,
Pagination: params[0] + '&' + params[1] Pagination: params[0] + '&' + params[1]
} }
}) })
@@ -67,7 +67,7 @@ export function searchTable2(...params) {
data: { data: {
type: '1', type: '1',
name: '采购管理_采购部采购_查询物料_基本件', name: '采购管理_采购部采购_查询物料_基本件',
param: `项目流水号_check=${params[2]}&项目流水号=${params[3]}&分配状态=${params[4]}`, param: `项目流水号_check=${params[2]}&项目流水号=${params[3]}&物料状态=${params[4]}`,
Pagination: params[0] + '&' + params[1] Pagination: params[0] + '&' + params[1]
} }
}) })

View File

@@ -0,0 +1,74 @@
import request from '@/utils/request'
// 初始化合同
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购请款表_查询数据'
}
})
}
// 查询表1
export function searchTable1(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购请款表_查询数据',
param: '采购合同流水号_check=' + params[2] + '&采购合同流水号=' + params[3] + '&供应商名称_check=' + params[4] + '&供应商名称=' + params[5],
Pagination: params[0] + '&' + params[1]
}
})
}
// 查询表01付款计划
export function searchTable01(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款计划_查询数据',
param: '采购合同流水号_check=1&采购合同流水号=' + params[0]
}
})
}
// 增加表01付款计划
export function addTable01(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_付款计划_增加数据',
param: `采购合同流水号=${params[0]}&计划付款日期=${params[1]}&计划付款金额=${params[2]}&计划付款备注=${params[3]}`
}
})
}
// 删除表01付款计划
export function deleteTable01(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_付款计划_删除数据',
param: `付款计划流水号=${params[0]}`
}
})
}
// 采购合同内容查询
export function searchTable2(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同内容_查询数据',
param: '采购合同流水号=' + num
}
})
}

View File

@@ -0,0 +1,526 @@
/**
* @1900-2100区间内的公历、农历互转
* @charset UTF-8
* @Author Jea杨(JJonline@JJonline.Cn)
* @Time 2014-7-21
* @Time 2016-8-13 Fixed 2033hex、Attribution Annals
* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug
* @Version 1.0.2
* @公历转农历calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
* @农历转公历calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
*/
/* eslint-disable */
var calendar = {
/**
* 农历1900-2100的润大小信息表
* @Array Of Property
* @return Hex
*/
lunarInfo:[0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,//1900-1909
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,//1910-1919
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,//1920-1929
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,//1930-1939
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,//1940-1949
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0,//1950-1959
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,//1960-1969
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6,//1970-1979
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,//1980-1989
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,//1990-1999
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,//2000-2009
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,//2010-2019
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,//2020-2029
0x05aa0,0x076a3,0x096d0,0x04afb,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,//2030-2039
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0,//2040-2049
/**Add By JJonline@JJonline.Cn**/
0x14b63,0x09370,0x049f8,0x04970,0x064b0,0x168a6,0x0ea50, 0x06b20,0x1a6c4,0x0aae0,//2050-2059
0x0a2e0,0x0d2e3,0x0c960,0x0d557,0x0d4a0,0x0da50,0x05d55,0x056a0,0x0a6d0,0x055d4,//2060-2069
0x052d0,0x0a9b8,0x0a950,0x0b4a0,0x0b6a6,0x0ad50,0x055a0,0x0aba4,0x0a5b0,0x052b0,//2070-2079
0x0b273,0x06930,0x07337,0x06aa0,0x0ad50,0x14b55,0x04b60,0x0a570,0x054e4,0x0d160,//2080-2089
0x0e968,0x0d520,0x0daa0,0x16aa6,0x056d0,0x04ae0,0x0a9d4,0x0a2d0,0x0d150,0x0f252,//2090-2099
0x0d520],//2100
/**
* 公历每个月份的天数普通表
* @Array Of Property
* @return Number
*/
solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],
/**
* 天干地支之天干速查表
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
* @return Cn string
*/
Gan:["\u7532","\u4e59","\u4e19","\u4e01","\u620a","\u5df1","\u5e9a","\u8f9b","\u58ec","\u7678"],
/**
* 天干地支之地支速查表
* @Array Of Property
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
* @return Cn string
*/
Zhi:["\u5b50","\u4e11","\u5bc5","\u536f","\u8fb0","\u5df3","\u5348","\u672a","\u7533","\u9149","\u620c","\u4ea5"],
/**
* 天干地支之地支速查表<=>生肖
* @Array Of Property
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
* @return Cn string
*/
Animals:["\u9f20","\u725b","\u864e","\u5154","\u9f99","\u86c7","\u9a6c","\u7f8a","\u7334","\u9e21","\u72d7","\u732a"],
/**
* 24节气速查表
* @Array Of Property
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
* @return Cn string
*/
solarTerm:["\u5c0f\u5bd2","\u5927\u5bd2","\u7acb\u6625","\u96e8\u6c34","\u60ca\u86f0","\u6625\u5206","\u6e05\u660e","\u8c37\u96e8","\u7acb\u590f","\u5c0f\u6ee1","\u8292\u79cd","\u590f\u81f3","\u5c0f\u6691","\u5927\u6691","\u7acb\u79cb","\u5904\u6691","\u767d\u9732","\u79cb\u5206","\u5bd2\u9732","\u971c\u964d","\u7acb\u51ac","\u5c0f\u96ea","\u5927\u96ea","\u51ac\u81f3"],
/**
* 1900-2100各年的24节气日期速查表
* @Array Of Property
* @return 0x string For splice
*/
sTermInfo:['9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f',
'97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f',
'b027097bd097c36b0b6fc9274c91aa','9778397bd19801ec9210c965cc920e','97b6b97bd19801ec95f8c965cc920f',
'97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2','9778397bd197c36c9210c9274c91aa',
'97b6b97bd19801ec95f8c965cc920e','97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2',
'9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec95f8c965cc920e','97bcf97c3598082c95f8e1cfcc920f',
'97bd097bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f',
'97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf97c359801ec95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd097bd07f595b0b6fc920fb0722',
'9778397bd097c36b0b6fc9210c8dc2','9778397bd19801ec9210c9274c920e','97b6b97bd19801ec95f8c965cc920f',
'97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
'97b6b97bd19801ec95f8c965cc920f','97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
'9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e','97bd07f1487f595b0b0bc920fb0722',
'7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf7f1487f531b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf7f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
'9778397bd097c36b0b6fc9210c91aa','97b6b97bd197c36c9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
'97b6b7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
'9778397bd097c36b0b70c9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b7f0e47f531b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
'9778397bd097c36b0b6fc9210c91aa','97b6b7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','977837f0e37f149b0723b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c35b0b6fc9210c8dc2',
'977837f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc9210c8dc2','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','977837f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
'977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd',
'7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
'977837f0e37f14998082b0723b06bd','7f07e7f0e37f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f595b0b0bb0b6fb0722','7f0e37f0e37f14898082b0723b02d5',
'7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f531b0b0bb0b6fb0722',
'7f0e37f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e37f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35',
'7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f149b0723b0787b0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0723b06bd',
'7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722','7f0e37f0e366aa89801eb072297c35',
'7ec967f0e37f14998082b0723b06bd','7f07e7f0e37f14998083b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
'7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14898082b0723b02d5','7f07e7f0e37f14998082b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66aa89801e9808297c35','665f67f0e37f14898082b0723b02d5',
'7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66a449801e9808297c35',
'665f67f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e36665b66a449801e9808297c35','665f67f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721','7f0e26665b66a449801e9808297c35','665f67f0e37f1489801eb072297c35',
'7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722'],
/**
* 数字转中文速查表
* @Array Of Property
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
* @return Cn string
*/
nStr1:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341"],
/**
* 日期转农历称呼速查表
* @Array Of Property
* @trans ['初','十','廿','卅']
* @return Cn string
*/
nStr2:["\u521d","\u5341","\u5eff","\u5345"],
/**
* 月份转农历称呼速查表
* @Array Of Property
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
* @return Cn string
*/
nStr3:["\u6b63","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u51ac","\u814a"],
/**
* 返回农历y年一整年的总天数
* @param lunar Year
* @return Number
* @eg:var count = calendar.lYearDays(1987) ;//count=387
*/
lYearDays:function(y) {
var i, sum = 348;
for(i=0x8000; i>0x8; i>>=1) { sum += (calendar.lunarInfo[y-1900] & i)? 1: 0; }
return(sum+calendar.leapDays(y));
},
/**
* 返回农历y年闰月是哪个月若y年没有闰月 则返回0
* @param lunar Year
* @return Number (0-12)
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
*/
leapMonth:function(y) { //闰字编码 \u95f0
return(calendar.lunarInfo[y-1900] & 0xf);
},
/**
* 返回农历y年闰月的天数 若该年没有闰月则返回0
* @param lunar Year
* @return Number (0、29、30)
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
*/
leapDays:function(y) {
if(calendar.leapMonth(y)) {
return((calendar.lunarInfo[y-1900] & 0x10000)? 30: 29);
}
return(0);
},
/**
* 返回农历y年m月非闰月的总天数计算m为闰月时的天数请使用leapDays方法
* @param lunar Year
* @return Number (-1、29、30)
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
*/
monthDays:function(y,m) {
if(m>12 || m<1) {return -1}//月份参数从1至12参数错误返回-1
return( (calendar.lunarInfo[y-1900] & (0x10000>>m))? 30: 29 );
},
/**
* 返回公历(!)y年m月的天数
* @param solar Year
* @return Number (-1、28、29、30、31)
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
*/
solarDays:function(y,m) {
if(m>12 || m<1) {return -1} //若参数错误 返回-1
var ms = m-1;
if(ms==1) { //2月份的闰平规律测算后确认返回28或29
return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28);
}else {
return(calendar.solarMonth[ms]);
}
},
/**
* 农历年份转换为干支纪年
* @param lYear 农历年的年份数
* @return Cn string
*/
toGanZhiYear:function(lYear) {
var ganKey = (lYear - 3) % 10;
var zhiKey = (lYear - 3) % 12;
if(ganKey == 0) ganKey = 10;//如果余数为0则为最后一个天干
if(zhiKey == 0) zhiKey = 12;//如果余数为0则为最后一个地支
return calendar.Gan[ganKey-1] + calendar.Zhi[zhiKey-1];
},
/**
* 公历月、日判断所属星座
* @param cMonth [description]
* @param cDay [description]
* @return Cn string
*/
toAstro:function(cMonth,cDay) {
var s = "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf";
var arr = [20,19,21,21,21,22,23,23,23,23,22,22];
return s.substr(cMonth*2 - (cDay < arr[cMonth-1] ? 2 : 0),2) + "\u5ea7";//座
},
/**
* 传入offset偏移量返回干支
* @param offset 相对甲子的偏移量
* @return Cn string
*/
toGanZhi:function(offset) {
return calendar.Gan[offset%10] + calendar.Zhi[offset%12];
},
/**
* 传入公历(!)y年获得该年第n个节气的公历日期
* @param y公历年(1900-2100)n二十四节气中的第几个节气(1~24)从n=1(小寒)算起
* @return day Number
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
*/
getTerm:function(y,n) {
if(y<1900 || y>2100) {return -1;}
if(n<1 || n>24) {return -1;}
var _table = calendar.sTermInfo[y-1900];
var _info = [
parseInt('0x'+_table.substr(0,5)).toString() ,
parseInt('0x'+_table.substr(5,5)).toString(),
parseInt('0x'+_table.substr(10,5)).toString(),
parseInt('0x'+_table.substr(15,5)).toString(),
parseInt('0x'+_table.substr(20,5)).toString(),
parseInt('0x'+_table.substr(25,5)).toString()
];
var _calday = [
_info[0].substr(0,1),
_info[0].substr(1,2),
_info[0].substr(3,1),
_info[0].substr(4,2),
_info[1].substr(0,1),
_info[1].substr(1,2),
_info[1].substr(3,1),
_info[1].substr(4,2),
_info[2].substr(0,1),
_info[2].substr(1,2),
_info[2].substr(3,1),
_info[2].substr(4,2),
_info[3].substr(0,1),
_info[3].substr(1,2),
_info[3].substr(3,1),
_info[3].substr(4,2),
_info[4].substr(0,1),
_info[4].substr(1,2),
_info[4].substr(3,1),
_info[4].substr(4,2),
_info[5].substr(0,1),
_info[5].substr(1,2),
_info[5].substr(3,1),
_info[5].substr(4,2),
];
return parseInt(_calday[n-1]);
},
/**
* 传入农历数字月份返回汉语通俗表示法
* @param lunar month
* @return Cn string
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
*/
toChinaMonth:function(m) { // 月 => \u6708
if(m>12 || m<1) {return -1} //若参数错误 返回-1
var s = calendar.nStr3[m-1];
s+= "\u6708";//加上月字
return s;
},
/**
* 传入农历日期数字返回汉字表示法
* @param lunar day
* @return Cn string
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
*/
toChinaDay:function(d){ //日 => \u65e5
var s;
switch (d) {
case 10:
s = '\u521d\u5341'; break;
case 20:
s = '\u4e8c\u5341'; break;
break;
case 30:
s = '\u4e09\u5341'; break;
break;
default :
s = calendar.nStr2[Math.floor(d/10)];
s += calendar.nStr1[d%10];
}
return(s);
},
/**
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
* @param y year
* @return Cn string
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
*/
getAnimal: function(y) {
return calendar.Animals[(y - 4) % 12]
},
/**
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
* @param y solar year
* @param m solar month
* @param d solar day
* @return JSON object
* @eg:console.log(calendar.solar2lunar(1987,11,01));
*/
solar2lunar:function (y,m,d) { //参数区间1900.1.31~2100.12.31
if(y<1900 || y>2100) {return -1;}//年份限定、上限
if(y==1900&&m==1&&d<31) {return -1;}//下限
if(!y) { //未传参 获得当天
var objDate = new Date();
}else {
var objDate = new Date(y,parseInt(m)-1,d)
}
var i, leap=0, temp=0;
//修正ymd参数
var y = objDate.getFullYear(),m = objDate.getMonth()+1,d = objDate.getDate();
var offset = (Date.UTC(objDate.getFullYear(),objDate.getMonth(),objDate.getDate()) - Date.UTC(1900,0,31))/86400000;
for(i=1900; i<2101 && offset>0; i++) { temp=calendar.lYearDays(i); offset-=temp; }
if(offset<0) { offset+=temp; i--; }
//是否今天
var isTodayObj = new Date(),isToday=false;
if(isTodayObj.getFullYear()==y && isTodayObj.getMonth()+1==m && isTodayObj.getDate()==d) {
isToday = true;
}
//星期几
var nWeek = objDate.getDay(),cWeek = calendar.nStr1[nWeek];
if(nWeek==0) {nWeek =7;}//数字表示周几顺应天朝周一开始的惯例
//农历年
var year = i;
var leap = calendar.leapMonth(i); //闰哪个月
var isLeap = false;
//效验闰月
for(i=1; i<13 && offset>0; i++) {
//闰月
if(leap>0 && i==(leap+1) && isLeap==false){
--i;
isLeap = true; temp = calendar.leapDays(year); //计算农历闰月天数
}
else{
temp = calendar.monthDays(year, i);//计算农历普通月天数
}
//解除闰月
if(isLeap==true && i==(leap+1)) { isLeap = false; }
offset -= temp;
}
if(offset==0 && leap>0 && i==leap+1)
if(isLeap){
isLeap = false;
}else{
isLeap = true; --i;
}
if(offset<0){ offset += temp; --i; }
//农历月
var month = i;
//农历日
var day = offset + 1;
//天干地支处理
var sm = m-1;
var gzY = calendar.toGanZhiYear(year);
//月柱 1900年1月小寒以前为 丙子月(60进制12)
var firstNode = calendar.getTerm(year,(m*2-1));//返回当月「节」为几日开始
var secondNode = calendar.getTerm(year,(m*2));//返回当月「节」为几日开始
//依据12节气修正干支月
var gzM = calendar.toGanZhi((y-1900)*12+m+11);
if(d>=firstNode) {
gzM = calendar.toGanZhi((y-1900)*12+m+12);
}
//传入的日期的节气与否
var isTerm = false;
var Term = null;
if(firstNode==d) {
isTerm = true;
Term = calendar.solarTerm[m*2-2];
}
if(secondNode==d) {
isTerm = true;
Term = calendar.solarTerm[m*2-1];
}
//日柱 当月一日与 1900/1/1 相差天数
var dayCyclical = Date.UTC(y,sm,1,0,0,0,0)/86400000+25567+10;
var gzD = calendar.toGanZhi(dayCyclical+d-1);
//该日期所属的星座
var astro = calendar.toAstro(m,d);
return {'lYear':year,'lMonth':month,'lDay':day,'Animal':calendar.getAnimal(year),'IMonthCn':(isLeap?"\u95f0":'')+calendar.toChinaMonth(month),'IDayCn':calendar.toChinaDay(day),'cYear':y,'cMonth':m,'cDay':d,'gzYear':gzY,'gzMonth':gzM,'gzDay':gzD,'isToday':isToday,'isLeap':isLeap,'nWeek':nWeek,'ncWeek':"\u661f\u671f"+cWeek,'isTerm':isTerm,'Term':Term,'astro':astro};
},
/**
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
* @param y lunar year
* @param m lunar month
* @param d lunar day
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
* @return JSON object
* @eg:console.log(calendar.lunar2solar(1987,9,10));
*/
lunar2solar:function(y,m,d,isLeapMonth) { //参数区间1900.1.31~2100.12.1
var isLeapMonth = !!isLeapMonth;
var leapOffset = 0;
var leapMonth = calendar.leapMonth(y);
var leapDay = calendar.leapDays(y);
if(isLeapMonth&&(leapMonth!=m)) {return -1;}//传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
if(y==2100&&m==12&&d>1 || y==1900&&m==1&&d<31) {return -1;}//超出了最大极限值
var day = calendar.monthDays(y,m);
var _day = day;
//bugFix 2016-9-25
//if month is leap, _day use leapDays method
if(isLeapMonth) {
_day = calendar.leapDays(y,m);
}
if(y < 1900 || y > 2100 || d > _day) {return -1;}//参数合法性效验
//计算农历的时间差
var offset = 0;
for(var i=1900;i<y;i++) {
offset+=calendar.lYearDays(i);
}
var leap = 0,isAdd= false;
for(var i=1;i<m;i++) {
leap = calendar.leapMonth(y);
if(!isAdd) {//处理闰月
if(leap<=i && leap>0) {
offset+=calendar.leapDays(y);isAdd = true;
}
}
offset+=calendar.monthDays(y,i);
}
//转换闰月农历 需补充该年闰月的前一个月的时差
if(isLeapMonth) {offset+=day;}
//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
var stmap = Date.UTC(1900,1,30,0,0,0);
var calObj = new Date((offset+d-31)*86400000+stmap);
var cY = calObj.getUTCFullYear();
var cM = calObj.getUTCMonth()+1;
var cD = calObj.getUTCDate();
return calendar.solar2lunar(cY,cM,cD);
}
};
export default calendar
/* eslint-disable */

View File

@@ -0,0 +1,837 @@
<style scoped>
.calendar {
margin:auto;
width: 100%;
min-width:300px;
background: #fff;
font-family: "PingFang SC","Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;
user-select:none;
}
.calendar-tools{
height:40px;
font-size: 20px;
line-height: 40px;
color:#5e7a88;
}
.calendar-tools span{
cursor: pointer;
}
.calendar-prev{
width: 14.28571429%;
float:left;
text-align: center;
}
.calendar-info{
padding-top: 3px;
font-size:16px;
line-height: 1.3;
text-align: center;
}
.calendar-info>div.month{
margin:auto;
height:20px;
width:100px;
text-align: center;
color:#5e7a88;
overflow: hidden;
position: relative;
}
.calendar-info>div.month .month-inner{
position: absolute;
left:0;
top:0;
height:240px;
transition:top .5s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.calendar-info>div.month .month-inner>span{
display: block;
font-size: 14px;
height:20px;
width:100px;
overflow: hidden;
text-align: center;
}
.calendar-info>div.year{
font-size:10px;
line-height: 1;
color:#999;
}
.calendar-next{
width: 14.28571429%;
float:right;
text-align: center;
}
.calendar table {
clear: both;
width: 100%;
margin-bottom:10px;
border-collapse: collapse;
color: #444444;
}
.calendar td {
margin:2px !important;
padding:0px 0;
width: 14.28571429%;
height:44px;
text-align: center;
vertical-align: middle;
font-size:14px;
line-height: 125%;
cursor: pointer;
position: relative;
vertical-align: top;
}
.calendar td.week{
font-size:10px;
pointer-events:none !important;
cursor: default !important;
}
.calendar td.disabled {
color: #ccc;
pointer-events:none !important;
cursor: default !important;
}
.calendar td.disabled div{
color: #ccc;
}
.calendar td span{
display:block;
max-width:40px;
height:26px;
font-size: 16px;
line-height:26px;
margin:0px auto;
border-radius:20px;
}
.calendar td:not(.selected) span:not(.red):hover{
background:#f3f8fa;
color:#444;
}
.calendar td:not(.selected) span.red:hover{
background:#f9efef;
}
.calendar td:not(.disabled) span.red{
color:#ea6151;
}
.calendar td.selected span{
background-color: #5e7a88;
color: #fff;
}
.calendar td .text{
position: absolute;
top:28px;
left:0;
right:0;
text-align: center;
padding:2px;
font-size:8px;
line-height: 1.2;
color:#444;
}
.calendar td .isGregorianFestival,
.calendar td .isLunarFestival{
color:#ea6151;
}
.calendar td.selected span.red{
background-color: #ea6151;
color: #fff;
}
.calendar td.selected span.red:hover{
background-color: #ea6151;
color: #fff;
}
.calendar thead td {
text-transform: uppercase;
height:30px;
vertical-align: middle;
}
.calendar-button{
text-align: center;
}
.calendar-button span{
cursor: pointer;
display: inline-block;
min-height: 1em;
min-width: 5em;
vertical-align: baseline;
background:#5e7a88;
color:#fff;
margin: 0 .25em 0 0;
padding: .6em 2em;
font-size: 1em;
line-height: 1em;
text-align: center;
border-radius: .3em;
}
.calendar-button span.cancel{
background:#efefef;
color:#666;
}
.calendar-years{
position: absolute;
left:0px;
top:60px;
right:0px;
bottom:0px;
background:#fff;
display: flex;
justify-content: center;
align-items: center;
flex-wrap:wrap;
overflow: auto;
transition:all .5s cubic-bezier(0.075, 0.82, 0.165, 1);
opacity: 0;
pointer-events: none;
transform: translateY(-10px);
}
.calendar-years.show{
opacity: 1;
pointer-events: auto;
transform: translateY(0px);
}
.calendar-years>span{
margin:1px 5px;
display: inline-block;
width:60px;
line-height: 30px;
border-radius: 20px;
text-align:center;
border:1px solid #fbfbfb;
color:#999;
}
.calendar-years>span.active{
border:1px solid #5e7a88;
background-color: #5e7a88;
color:#fff;
}
</style>
<template>
<div class="calendar">
<div class="calendar-tools">
<span class="calendar-prev" @click="prev">
<svg
width="20"
height="20"
viewBox="0 0 16 16"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g class="transform-group">
<g transform="scale(0.015625, 0.015625)">
<path
d="M671.968 912c-12.288 0-24.576-4.672-33.952-14.048L286.048 545.984c-18.752-18.72-18.752-49.12 0-67.872l351.968-352c18.752-18.752 49.12-18.752 67.872 0 18.752 18.72 18.752 49.12 0 67.872l-318.016 318.048 318.016 318.016c18.752 18.752 18.752 49.12 0 67.872C696.544 907.328 684.256 912 671.968 912z"
fill="#5e7a88"/>
</g>
</g>
</svg>
</span>
<span class="calendar-next" @click="next">
<svg
width="20"
height="20"
viewBox="0 0 16 16"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g class="transform-group">
<g transform="scale(0.015625, 0.015625)">
<path
d="M761.056 532.128c0.512-0.992 1.344-1.824 1.792-2.848 8.8-18.304 5.92-40.704-9.664-55.424L399.936 139.744c-19.264-18.208-49.632-17.344-67.872 1.888-18.208 19.264-17.376 49.632 1.888 67.872l316.96 299.84-315.712 304.288c-19.072 18.4-19.648 48.768-1.248 67.872 9.408 9.792 21.984 14.688 34.56 14.688 12 0 24-4.48 33.312-13.44l350.048-337.376c0.672-0.672 0.928-1.6 1.6-2.304 0.512-0.48 1.056-0.832 1.568-1.344C757.76 538.88 759.2 535.392 761.056 532.128z"
fill="#5e7a88"/>
</g>
</g>
</svg>
</span>
<div class="calendar-info" @click.stop="changeYear">
<!-- {{monthString}} -->
<div class="month">
<div :style="{'top':-(month*20)+'px'}" class="month-inner">
<span v-for="m in months" :key="m">{{ m }}</span>
</div>
</div>
<div class="year">{{ year }}</div>
</div>
</div>
<table cellpadding="5">
<thead>
<tr>
<td v-for="week in weeks" :key="week" class="week">{{ week }}</td>
</tr>
</thead>
<tbody>
<tr v-for="(day,k1) in days" :key="(day,k1)" style="{'animation-delay',(k1*30)+'ms'}">
<td
v-for="(child,k2) in day"
:key="(child,k2)"
:class="{'selected':child.selected,'disabled':child.disabled}"
@click="select(k1,k2,$event)">
<span :class="{'red':k2==0||k2==6||((child.isLunarFestival||child.isGregorianFestival) && lunar)}">{{ child.day }}</span>
<div v-if="child.eventName!=undefined" class="text" >{{ child.eventName }}</div>
<div
v-if="lunar"
:class="{'isLunarFestival':child.isLunarFestival,'isGregorianFestival':child.isGregorianFestival}"
class="text">{{ child.lunar }}
</div>
</td>
</tr>
</tbody>
</table>
<div :class="{'show':yearsShow}" class="calendar-years">
<span v-for="y in years" :key="y" :class="{'active':y==year}" @click.stop="selectYear(y)">{{ y }}</span>
</div>
</div>
</template>
<script>
/* eslint-disable */
import calendar from './calendar.js'
export default {
props: {
// 多选模式
multi: {
type: Boolean,
default: false
},
// 范围模式
range:{
type: Boolean,
default: false
},
// 默认日期
value: {
type: Array,
default: function(){
return []
}
},
// 开始选择日期
begin: {
type: Array,
default: function(){
return []
}
},
// 结束选择日期
end: {
type: Array,
default: function(){
return []
}
},
// 是否小于10补零
zero:{
type: Boolean,
default: false
},
// 屏蔽的日期
disabled:{
type: Array,
default: function(){
return []
}
},
// 是否显示农历
lunar: {
type: Boolean,
default: false
},
// 自定义星期名称
weeks: {
type: Array,
default:function(){
return window.navigator.language.toLowerCase() == "zh-cn"?['日', '一', '二', '三', '四', '五', '六']:['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
}
},
// 自定义月份
months:{
type: Array,
default:function(){
return window.navigator.language.toLowerCase() == "zh-cn"?['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']:['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
}
},
// 自定义事件
events: {
type: Object,
default: function(){
return {}
}
},
},
data() {
return {
years:[],
yearsShow:false,
year: 0,
month: 0,
day: 0,
days: [],
multiDays:[],
today: [],
festival:{
lunar:{
"1-1":"春节",
"1-15":"元宵节",
"2-2":"龙头节",
"5-5":"端午节",
"7-7":"七夕节",
"7-15":"中元节",
"8-15":"中秋节",
"9-9":"重阳节",
"10-1":"寒衣节",
"10-15":"下元节",
"12-8":"腊八节",
"12-23":"祭灶节",
},
gregorian:{
"1-1":"元旦",
"2-14":"情人节",
"3-8":"妇女节",
"3-12":"植树节",
"4-5":"清明节",
"5-1":"劳动节",
"5-4":"青年节",
"6-1":"儿童节",
"7-1":"建党节",
"8-1":"建军节",
"9-10":"教师节",
"10-1":"国庆节",
"12-24":"平安夜",
"12-25":"圣诞节",
},
},
rangeBegin:[],
rangeEnd:[],
}
},
watch:{
events(){
this.render(this.year,this.month)
},
value(){
this.init();
}
},
mounted() {
this.init()
},
methods: {
init(){
let now = new Date();
this.year = now.getFullYear()
this.month = now.getMonth()
this.day = now.getDate()
if (this.value.length>0) {
if (this.range) { //范围
this.year = parseInt(this.value[0][0])
this.month = parseInt(this.value[0][1]) - 1
this.day = parseInt(this.value[0][2])
let year2 = parseInt(this.value[1][0])
let month2 = parseInt(this.value[1][1]) - 1
let day2 = parseInt(this.value[1][2])
this.rangeBegin = [this.year, this.month,this.day]
this.rangeEnd = [year2, month2 , day2]
}else if(this.multi){//多选
this.multiDays=this.value;
this.year = parseInt(this.value[0][0])
this.month = parseInt(this.value[0][1]) - 1
this.day = parseInt(this.value[0][2])
}else{ //单选
this.year = parseInt(this.value[0])
this.month = parseInt(this.value[1]) - 1
this.day = parseInt(this.value[2])
}
}
this.render(this.year, this.month)
},
// 渲染日期
render(y, m) {
let firstDayOfMonth = new Date(y, m, 1).getDay() //当月第一天
let lastDateOfMonth = new Date(y, m + 1, 0).getDate() //当月最后一天
let lastDayOfLastMonth = new Date(y, m, 0).getDate() //最后一月的最后一天
this.year = y
let seletSplit = this.value
let i, line = 0,temp = [],nextMonthPushDays = 1
for (i = 1; i <= lastDateOfMonth; i++) {
let day = new Date(y, m, i).getDay() //返回星期几06
let k
// 第一行
if (day == 0) {
temp[line] = []
} else if (i == 1) {
temp[line] = []
k = lastDayOfLastMonth - firstDayOfMonth + 1
for (let j = 0; j < firstDayOfMonth; j++) {
// console.log("第一行",lunarYear,lunarMonth,lunarValue,lunarInfo)
temp[line].push(Object.assign(
{day: k,disabled: true},
this.getLunarInfo(this.computedPrevYear(),this.computedPrevMonth(true),k),
this.getEvents(this.computedPrevYear(),this.computedPrevMonth(true),k),
))
k++;
}
}
if (this.range) { // 范围
// console.log("日期范围",this.getLunarInfo(this.year,this.month+1,i))
let options = Object.assign(
{day: i},
this.getLunarInfo(this.year,this.month+1,i),
this.getEvents(this.year,this.month+1,i),
)
if (this.rangeBegin.length > 0) {
let beginTime = Number(new Date(this.rangeBegin[0], this.rangeBegin[1], this.rangeBegin[2]))
let endTime = Number(new Date(this.rangeEnd[0], this.rangeEnd[1], this.rangeEnd[2]))
let stepTime = Number(new Date(this.year, this.month, i))
if (beginTime <= stepTime && endTime >= stepTime) {
options.selected = true
}
}
if (this.begin.length>0) {
let beginTime = Number(new Date(parseInt(this.begin[0]),parseInt(this.begin[1]) - 1,parseInt(this.begin[2])))
if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true
}
if (this.end.length>0){
let endTime = Number(new Date(parseInt(this.end[0]),parseInt(this.end[1]) - 1,parseInt(this.end[2])))
if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true
}
if (this.disabled.length>0){
if (this.disabled.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0) {
options.disabled = true
}
}
temp[line].push(options)
}else if(this.multi){//多选
let options
// 判断是否选中
if(this.value.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0 ){
options = Object.assign({day: i,selected:true},this.getLunarInfo(this.year,this.month+1,i),this.getEvents(this.year,this.month+1,i))
}else{
options = Object.assign({day: i,selected:false},this.getLunarInfo(this.year,this.month+1,i),this.getEvents(this.year,this.month+1,i))
if (this.begin.length>0) {
let beginTime = Number(new Date(parseInt(this.begin[0]),parseInt(this.begin[1]) - 1,parseInt(this.begin[2])))
if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true
}
if (this.end.length>0){
let endTime = Number(new Date(parseInt(this.end[0]),parseInt(this.end[1]) - 1,parseInt(this.end[2])))
if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true
}
if (this.disabled.length>0){
if (this.disabled.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0) {
options.disabled = true
}
}
}
temp[line].push(options)
} else { // 单选
// console.log(this.lunar(this.year,this.month,i));
let chk = new Date()
let chkY = chk.getFullYear()
let chkM = chk.getMonth()
// 匹配上次选中的日期
if (parseInt(seletSplit[0]) == this.year && parseInt(seletSplit[1]) - 1 == this.month && parseInt(seletSplit[2]) == i) {
// console.log("匹配上次选中的日期",lunarYear,lunarMonth,lunarValue,lunarInfo)
temp[line].push(Object.assign(
{day: i,selected: true},
this.getLunarInfo(this.year,this.month+1,i),
this.getEvents(this.year,this.month+1,i),
))
this.today = [line, temp[line].length - 1]
}
// 没有默认值的时候显示选中今天日期
else if (chkY == this.year && chkM == this.month && i == this.day && this.value == "") {
// console.log("今天",lunarYear,lunarMonth,lunarValue,lunarInfo)
temp[line].push(Object.assign(
{day: i,selected: true},
this.getLunarInfo(this.year,this.month+1,i),
this.getEvents(this.year,this.month+1,i),
))
this.today = [line, temp[line].length - 1]
}else{
// 普通日期
// console.log("设置可选范围",i,lunarYear,lunarMonth,lunarValue,lunarInfo)
let options = Object.assign(
{day: i,selected:false},
this.getLunarInfo(this.year,this.month+1,i),
this.getEvents(this.year,this.month+1,i),
)
if (this.begin.length>0) {
let beginTime = Number(new Date(parseInt(this.begin[0]),parseInt(this.begin[1]) - 1,parseInt(this.begin[2])))
if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true
}
if (this.end.length>0){
let endTime = Number(new Date(parseInt(this.end[0]),parseInt(this.end[1]) - 1,parseInt(this.end[2])))
if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true
}
if (this.disabled.length>0){
if (this.disabled.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0) {
options.disabled = true
}
}
temp[line].push(options)
}
}
// 到周六换行
if (day == 6 && i < lastDateOfMonth) {
line++
}else if (i == lastDateOfMonth) {
// line++
let k = 1
for (let d=day; d < 6; d++) {
// console.log(this.computedNextYear()+"-"+this.computedNextMonth(true)+"-"+k)
temp[line].push(Object.assign(
{day: k,disabled: true},
this.getLunarInfo(this.computedNextYear(),this.computedNextMonth(true),k),
this.getEvents(this.computedNextYear(),this.computedNextMonth(true),k),
))
k++
}
// 下个月除了补充的前几天开始的日期
nextMonthPushDays=k
}
} //end for
// console.log(this.year+"/"+this.month+"/"+this.day+":"+line)
// 补充第六行让视觉稳定
if(line<=5 && nextMonthPushDays>0){
// console.log({nextMonthPushDays:nextMonthPushDays,line:line})
for (let i = line+1; i<=5; i++) {
temp[i] = []
let start=nextMonthPushDays+(i-line-1)*7
for (let d=start; d <= start+6; d++) {
temp[i].push(Object.assign(
{day: d,disabled: true},
this.getLunarInfo(this.computedNextYear(),this.computedNextMonth(true),d),
this.getEvents(this.computedNextYear(),this.computedNextMonth(true),d),
))
}
}
}
this.days = temp
},
computedPrevYear(){
let value=this.year
if(this.month-1<0){
value--
}
return value
},
computedPrevMonth(isString){
let value=this.month
if(this.month-1<0){
value=11
}else{
value--
}
// 用于显示目的一般月份是从0开始的
if(isString){
return value+1
}
return value
},
computedNextYear(){
let value=this.year
if(this.month+1>11){
value++
}
return value
},
computedNextMonth(isString){
let value=this.month
if(this.month+1>11){
value=0
}else{
value++
}
// 用于显示目的一般月份是从0开始的
if(isString){
return value+1
}
return value
},
// 获取农历信息
getLunarInfo(y,m,d){
let lunarInfo=calendar.solar2lunar(y,m,d)
let lunarValue=lunarInfo.IDayCn
// console.log(lunarInfo)
let isLunarFestival=false
let isGregorianFestival=false
if(this.festival.lunar[lunarInfo.lMonth+"-"+lunarInfo.lDay]!=undefined){
lunarValue=this.festival.lunar[lunarInfo.lMonth+"-"+lunarInfo.lDay]
isLunarFestival=true
}else if(this.festival.gregorian[m+"-"+d]!=undefined){
lunarValue=this.festival.gregorian[m+"-"+d]
isGregorianFestival=true
}
return {
lunar:lunarValue,
isLunarFestival:isLunarFestival,
isGregorianFestival:isGregorianFestival,
}
},
// 获取自定义事件
getEvents(y,m,d){
if(Object.keys(this.events).length==0)return false;
let eventName=this.events[y+"-"+m+"-"+d]
let data={}
if(eventName!=undefined){
data.eventName=eventName
}
return data
},
// 上月
prev(e) {
e.stopPropagation()
if (this.month == 0) {
this.month = 11
this.year = parseInt(this.year) - 1
} else {
this.month = parseInt(this.month) - 1
}
this.$emit('search', this.year, this.month+1) // 调用父组件方法
this.render(this.year, this.month)
this.$emit('selectMonth',this.month+1,this.year)
this.$emit('prev',this.month+1,this.year)
},
// 下月
next(e) {
e.stopPropagation()
if (this.month == 11) {
this.month = 0
this.year = parseInt(this.year) + 1
} else {
this.month = parseInt(this.month) + 1
}
this.$emit('search', this.year, this.month+1) // 调用父组件方法
this.render(this.year, this.month)
this.$emit('selectMonth',this.month+1,this.year)
this.$emit('next',this.month+1,this.year)
},
// 选中日期
select(k1, k2, e) {
if (e != undefined) e.stopPropagation()
// 日期范围
if (this.range) {
if (this.rangeBegin.length == 0 || this.rangeEndTemp != 0) {
this.rangeBegin = [this.year, this.month,this.days[k1][k2].day]
this.rangeBeginTemp = this.rangeBegin
this.rangeEnd = [this.year, this.month, this.days[k1][k2].day]
this.rangeEndTemp = 0
} else {
this.rangeEnd = [this.year, this.month,this.days[k1][k2].day]
this.rangeEndTemp = 1
// 判断结束日期小于开始日期则自动颠倒过来
if (+new Date(this.rangeEnd[0], this.rangeEnd[1], this.rangeEnd[2]) < +new Date(this.rangeBegin[0], this.rangeBegin[1], this.rangeBegin[2])) {
this.rangeBegin = this.rangeEnd
this.rangeEnd = this.rangeBeginTemp
}
// 小于10左边打补丁
let begin=[]
let end=[]
if(this.zero){
this.rangeBegin.forEach((v,k)=>{
if(k==1)v=v+1
begin.push(this.zeroPad(v))
})
this.rangeEnd.forEach((v,k)=>{
if(k==1)v=v+1
end.push(this.zeroPad(v))
})
}else{
begin=this.rangeBegin
end=this.rangeEnd
}
// console.log("选中日期",begin,end)
this.$emit('select',begin,end)
}
this.render(this.year, this.month)
}else if (this.multi) {
// 如果已经选过则过滤掉
let filterDay=this.multiDays.filter(v => {
return this.year === v[0] && this.month === v[1]-1 && this.days[k1][k2].day === v[2]
})
if( filterDay.length>0 ){
this.multiDays=this.multiDays.filter(v=> {
return this.year !== v[0] || this.month !== v[1]-1 || this.days[k1][k2].day !== v[2]
})
}else{
this.multiDays.push([this.year,this.month+1,this.days[k1][k2].day]);
}
this.days[k1][k2].selected = !this.days[k1][k2].selected
this.$emit('select',this.multiDays)
} else {
// 取消上次选中
if (this.today.length > 0) {
this.days.forEach(v=>{
v.forEach(vv=>{
vv.selected= false
})
})
}
// 设置当前选中天
this.days[k1][k2].selected = true
this.day = this.days[k1][k2].day
this.today = [k1, k2]
this.$emit('select',[this.year,this.zero?this.zeroPad(this.month + 1):this.month + 1,this.zero?this.zeroPad(this.days[k1][k2].day):this.days[k1][k2].day])
}
},
changeYear(){
if(this.yearsShow){
this.yearsShow=false
return false
}
this.yearsShow=true
this.years=[];
for(let i=~~this.year-10;i<~~this.year+10;i++){
this.years.push(i)
}
},
selectYear(value){
this.yearsShow=false
this.year=value
this.render(this.year,this.month)
this.$emit('selectYear',value)
this.$emit('search', this.year, this.month+1) // 调用父组件方法
},
// 返回今天
setToday(){
let now = new Date();
this.year = now.getFullYear()
this.month = now.getMonth()
this.day = now.getDate()
this.render(this.year,this.month)
// 遍历当前日找到选中
this.days.forEach(v => {
let day=v.find(vv => {
return vv.day==this.day && !vv.disabled
})
if(day!=undefined ){
day.selected=true
}
})
},
// 日期补零
zeroPad(n){
return String(n < 10 ? '0' + n : n)
},
}
}
/* eslint-enable */
</script>

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1544748307988" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2116" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M865.6 136.4h-48.8V188h36c51.2 0 92.4 40.8 92.4 91.6v525.2c0 50.4-41.2 91.6-92.4 91.6h-684c-51.2 0-92.4-40.8-92.4-91.6V279.6C76.4 229.2 117.6 188 168.8 188h38.8V136.4H156c-73.2 0-132.4 58.8-132.4 131.2v549.6c0 72.4 59.2 131.2 132.4 131.2h710c73.2 0 132.4-58.8 132.4-131.2V267.6c-0.4-72.4-59.6-131.2-132.8-131.2z m-246.4 0h-217.2v52.8h217.2V136.4z m-306.8 108h18c10 0 18-8.4 18-18.4V100c0-10-8-18.4-18-18.4h-18c-10 0-18 8-18 18.4v126c-0.4 10.4 8 18.4 18 18.4z m379.2 0h18c10 0 18-8.4 18-18.4V100c0-10-8-18.4-18-18.4h-18c-10 0-18 8-18 18.4v126c0 10.4 8 18.4 18 18.4zM266 515.2h56.4c14.4 0 26-11.6 26-26v-56c0-14.4-11.6-26-26-26H266c-14.4 0-26 11.6-26 26v56c-0.4 14.4 11.6 26 26 26z m298.8-82c0-14.4-11.6-26-26-26h-56.4c-14.4 0-26 11.6-26 26v56c0 14.4 11.6 26 26 26h56.4c14.4 0 26-11.6 26-26v-56z m134 82h56.4c14.4 0 26-11.6 26-26v-56c0-14.4-11.6-26-26-26h-56.4c-14.4 0-26 11.6-26 26v56c0 14.4 11.6 26 26 26zM266 731.6h56.4c14.4 0 26-11.6 26-26v-56.4c0-14.4-11.6-26-26-26H266c-14.4 0-26 11.6-26 26v56.4c-0.4 14.4 11.6 26 26 26z m272.8-108h-56.4c-14.4 0-26 11.6-26 26v56.4c0 14.4 11.6 26 26 26h56.4c14.4 0 26-11.6 26-26v-56.4c0-14.4-11.6-26-26-26z m160 108h56.4c14.4 0 26-11.6 26-26v-56.4c0-14.4-11.6-26-26-26h-56.4c-14.4 0-26 11.6-26 26v56.4c0 14.4 11.6 26 26 26z m0 0" p-id="2117"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1544601249624" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2102" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M919.767054 896.702756 110.214171 896.702756c0 0 0.204661 28.606525 16.84362 39.822984 12.613272 8.510838 29.591969 7.247054 51.789527 7.247054 32.969902 0 65.945945 0 98.910731 0 154.980747 0 310.004473 0 464.980103 0 36.187177 0 72.379471 0 108.566648 0 23.677259 0 42.015929 1.505283 55.30356-7.759731C922.368298 925.028894 919.767054 896.702756 919.767054 896.702756z" p-id="2103"></path><path d="M112.286366 839.494823l39.815821 0L875.971595 839.494823l41.066301 0L916.903843 798.428521c-0.002047-0.754177-0.245593-75.725682-0.245593-104.385419 0-12.782118-2.329045-24.581861-6.921643-35.07382-4.986571-11.391445-12.468986-21.008476-22.239514-28.584012-15.449877-11.979846-35.622312-18.054191-59.957557-18.054191L702.741205 612.33108c-2.156106-2.907213-4.004197-5.26491-5.855358-7.356548-3.849678-4.611018-7.711636-8.524141-11.140735-11.999288-3.087315-3.12927-6.003737-6.085602-7.716752-8.394181-5.733585-7.730055-9.945513-15.128559-12.878309-22.618137-3.88754-9.924024-1.74269-24.198122 6.372128-42.435485 7.43125-16.703427 17.715477-31.896454 28.603455-47.980781 13.546527-20.011776 28.900214-42.692335 39.859823-70.671573 5.40101-13.782911 8.092305-27.481911 10.694573-40.729633l0.542352-2.75474c1.38351-7.015787 5.603625-31.789007 1.90028-56.443523-0.434905-2.894933-0.716314-6.061043-1.014096-9.41237-0.601704-6.765077-1.283226-14.432711-3.403516-23.025413-10.615779-43.113937-29.339212-78.540797-58.919924-111.471814-24.590048-27.366278-56.880475-48.78817-95.978958-63.677275-23.64042-9.005095-51.955302-13.763468-81.883939-13.763468-31.858592 0-63.298652 5.508457-88.527243 15.512299-35.545564 14.098089-65.837474 33.964556-90.038666 59.049884-25.252127 26.174126-43.923372 58.0583-55.494918 94.767364-5.15644 16.35755-16.349363 59.049884-8.91402 102.069677 2.509147 14.516622 4.932336 27.626197 9.188266 41.080627 12.812817 40.49325 35.761482 71.2743 56.009641 98.431823 9.315156 12.493545 18.113543 24.295336 25.681916 36.516682 4.804423 7.753591 7.906064 15.044648 9.224082 21.678742 1.27197 6.40385 0.807389 11.824303-1.464351 17.057491-4.668323 10.750855-14.32117 22.447245-26.479071 32.080649l-0.441045 0.348947-0.430812 0.361227c-4.415566 3.701299-9.089006 8.567119-14.018272 13.763468-25.700335-0.039909-58.513672-0.153496-85.914742-0.24764-20.866237-0.071631-37.34863-0.128937-43.8763-0.128937-10.335393 0-31.084972 2.988054-53.925167 23.0029-8.92016 7.817036-24.679076 24.133653-29.994128 45.581128-1.655709 6.698562-2.969635 16.47523-2.321882 68.718081 0.318248 25.64303 0.972141 49.452295 0.99977 50.453089L112.286366 839.494823zM152.23931 690.369434c3.894703-15.715937 27.351951-37.498032 44.188408-37.498032s103.273085 0.390903 146.775878 0.390903c5.860475-4.915963 17.460674-18.424628 23.325241-23.340591 15.421224-12.220323 30.329772-28.808116 38.606273-47.867194 12.302187-28.347628 2.034333-56.337099-10.510378-76.583213-25.771967-41.61377-61.4567-75.153654-77.464279-125.742842-3.545756-11.208273-5.690606-23.039739-7.880481-35.7052-4.959965-28.696576 0.750083-61.006446 7.618515-82.791611 19.712971-62.532195 62.198597-104.519472 121.583103-128.072911 20.871353-8.274454 47.174416-12.629645 73.440639-12.629645 23.831778 0 47.63388 3.585665 67.317175 11.081383 32.16456 12.248975 59.161425 29.481452 80.094176 52.77804 23.171746 25.795503 39.904849 54.42454 49.630351 93.922113 2.270716 9.206686 2.125407 18.361183 3.680832 28.716019 2.010797 13.381775 0.800225 30.371728-1.578961 42.432415-2.52859 12.801561-4.813632 25.311479-9.19236 36.484959-17.498536 44.670385-48.753377 74.242911-67.74901 116.942409-9.119705 20.496823-17.295921 47.944965-7.090489 73.997318 4.683672 11.963473 10.994402 22.477944 18.11866 32.082696 6.179746 8.330736 14.287401 14.889105 20.748556 22.768563 3.758604 4.049223 12.573363 17.475 16.337083 21.528316 41.662889 0 103.638405 0 145.30027 0 28.749788 0 48.186466 11.657504 48.186466 40.779775 0 29.059849 0.246617 104.519472 0.246617 104.519472L152.10321 798.562575C152.10321 798.562575 149.426241 701.750645 152.23931 690.369434z" p-id="2104"></path></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.sfont.cn -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.sfont.cn </metadata>
<g><path d="M500,10C229.8,10,10,229.8,10,500c0,270.2,219.8,490,490,490c270.2,0,490-219.8,490-490C990,229.8,770.2,10,500,10z M500,846.3C309,846.3,153.6,691,153.6,500c0-191,155.4-346.3,346.4-346.3c191,0,346.3,155.4,346.3,346.3C846.4,691,691,846.3,500,846.3z"/><path d="M645.1,359.8l-40.7-41L500,422.5L395.6,318.8l-40.7,41l75,74.5h-76v57.8h117.2v46.8H353.9v57.8h117.2V697h57.8V596.7h117.2v-57.8H528.9v-46.8h117.2v-57.8h-76L645.1,359.8z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 891 B

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1544748646937" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2862" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M474.624 752.64H259.072c-17.408 0-26.624-13.824-26.624-26.624V472.064h534.528V332.8c0-40.96-32.256-72.704-72.704-72.704h-51.2v-41.472h-46.592v41.472H356.864v-41.472h-46.592v41.472h-51.2c-40.96 0-72.704 32.256-72.704 72.704v389.632c0 40.96 32.256 72.704 72.704 72.704l215.552 4.096c11.776 0 23.04-11.264 23.04-23.04S486.4 752.64 474.624 752.64z m-117.76-384.512V306.176h235.52v61.952h46.592V306.176h51.2c17.408 0 26.624 13.824 26.624 26.624v92.672H232.448V332.8c0-17.408 13.824-26.624 26.624-26.624h51.2v61.952h46.592z" fill="" p-id="2863"></path><path d="M289.792 525.312h145.92v46.592H289.792v-46.592z m411.136 61.952h-46.592v108.544H762.88v-46.592h-61.952v-61.952z m-411.136 61.952h145.92v46.592H289.792v-46.592z" fill="" p-id="2864"></path><path d="M794.112 556.032c-30.208-30.208-72.704-47.616-116.736-47.616-44.032 0-86.528 17.408-116.736 47.616s-47.616 72.704-47.616 116.736 17.408 86.528 47.616 116.736 72.704 47.616 116.736 47.616c45.568 0 84.992-15.872 116.736-47.616 30.208-30.208 47.616-72.704 47.616-116.736s-17.408-86.528-47.616-116.736z m-116.224 238.08c-67.072 0-121.856-54.784-121.856-121.856 0-67.072 54.784-121.856 121.856-121.856s121.856 54.784 121.856 121.856c0 67.584-55.296 121.856-121.856 121.856z" fill="" p-id="2865"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -230,7 +230,7 @@ export default {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success('删除成功')
callback.call(this) // 回调函数修正this指向组件本身 callback.call(this) // 回调函数修正this指向组件本身
} else { this.$message.error('删除失败') } } else { this.$message.error('数据占用') }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({

View File

@@ -8,6 +8,7 @@ export const name = `OP8888`
// 创建axios实例 // 创建axios实例
export const upload = `http://localhost:8411/submit/uploadFile.ashx` export const upload = `http://localhost:8411/submit/uploadFile.ashx`
export const uploadInvoiceScan = `http://localhost:8411/submit/uploadInvoiceScan.ashx`
export const download = `http://localhost:8411/submit/downloadFile.ashx` export const download = `http://localhost:8411/submit/downloadFile.ashx`
const service = axios.create({ const service = axios.create({

View File

@@ -0,0 +1,257 @@
<template>
<div style="width: 100%;">
<el-card style="width: 400px;margin: auto;margin-top: 20px">
<div class="flex">
<div>
<calendar :events="calendar1.events" :value="calendar1.value" :begin="calendar1.begin" :end="calendar1.end" :weeks="calendar1.weeks" :months="calendar1.months" @search="search" @select="select" />
</div>
</div>
</el-card>
<el-card style="width: 400px;text-align: center;margin: auto">
<el-button type="primary" plain @click="setWork">上班</el-button>
<el-button type="success" plain @click="setRest">休息</el-button>
<el-button type="warning" plain @click="setToday">返回今天</el-button>
</el-card>
</div>
</template>
<script>
import { initClendar, changeState } from '@/api/BasicData/FactoryCalendar'
import calendar from '@/components/Calendar/calendar.vue'
export default {
components: {
calendar
},
data() {
return {
year: '', // 年
month: '', // 月
selectDate: '', // 选择的日期
time: '',
serNum: [], // 工作日流水号
serNumValue: '', // 工作日流水号值
arr: [], // 日期数组
arr1: [], // 日期数组
calendar1: {
value: [],
weeks: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], // 周的显示
months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], // 月的显示
events: {} // 上不上班
}
}
},
created() {
this.fetchData()
},
methods: {
select(val) { // 选择
this.selectDate = val[0] + '-' + val[1] + '-' + val[2]
},
setToday() { // 返回今天
this.fetchData()
},
fetchData() { // 日历初始化
var date = new Date()
this.year = date.getFullYear()
this.month = date.getMonth() + 1
this.day = date.getDate()
this.calendar1.value = [this.year, this.month, this.day] // 当前日期!
var events = Object() // 声明events是object对象
initClendar(this.year, this.month).then(response => {
for (let i = 0; i < response.data.length; i++) { // 这个循环是将时间1900-01-01转成1900-1-1型
var str = response.data[i].工作日期
var str1 = str.substr(0, 10)
var nian = str.substr(0, 4)
var yue = str.substr(5, 2)
var ri = str.substr(8, 2)
if (str.substr(5, 1) === '0') {
yue = yue.replace('0', '')
}
if (str.substr(8, 1) === '0') {
ri = ri.replace('0', '')
}
var x = nian + '-' + yue + '-' + ri
events[x] = response.data[i].是否工作
this.arr.push(x)
this.arr1.push(str1)
}
this.calendar1.events = events
})
},
search(year1, month1) { // !子组件的,上下月,改变年
var events = Object() // 声明events是object对象
initClendar(year1, month1).then(response => {
this.serNum = []
this.arr = []
this.arr1 = []
for (let i = 0; i < response.data.length; i++) { // 这个循环是将时间1900-01-01转成1900-1-1型
var str = response.data[i].工作日期
var str1 = str.substr(0, 10)
var nian = str.substr(0, 4)
var yue = str.substr(5, 2)
var ri = str.substr(8, 2)
if (str.substr(5, 1) === '0') {
yue = yue.replace('0', '')
}
if (str.substr(8, 1) === '0') {
ri = ri.replace('0', '')
}
var x = nian + '-' + yue + '-' + ri
this.arr.push(x)
this.arr1.push(str1)
events[x] = response.data[i].是否工作
}
this.calendar1.events = events
})
},
setWork() { // 上班
this.code = 1
for (let i = 0; i < this.arr.length; i++) {
if (this.arr[i] === this.selectDate) {
this.time = this.arr1[i]
break
}
}
changeState(this.time, this.code).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.$message.success('更改状态成功')
} else {
this.$message.error('更改状态失败')
}
})
},
setRest() { // 休息
this.code = 0
for (let i = 0; i < this.arr.length; i++) {
if (this.arr[i] === this.selectDate) {
this.time = this.arr1[i]
break
}
}
changeState(this.time, this.code).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.$message.success('更改状态成功')
} else {
this.$message.error('更改状态失败')
}
})
}
}
}
</script>
<style>
/*demo*/
.flex{
box-sizing: border-box;
display: -webkit-box;
-webkit-box-pack: start;
-webkit-box-align: start;
display: -webkit-flex;
-webkit-justify-content: space-between;
-webkit-align-items: top;
display: flex;
justify-content: space-between;
align-items: top;
flex-flow:row wrap
}
.flex>div{
margin:10px;
padding:20px;
width:25%;
min-width:300px;
border-radius: 2px;
position: relative;
}
.flex>div>span{
position: absolute;
left:0px;
top:0px;
padding:2px 10px;
font-size:10px;
border-radius:0 0 2px 0;
background:#ea6151;
color:#fff;
}
.flex>div>input{
box-sizing: border-box;
width:100%;
margin-top:20px;
border-radius: 2px;
border:1px solid #dedede;
padding:10px;
font-size: 16px;
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWwpAZm9udC1mYWNlIHsgZm9udC1mYW1pbHk6IGlmb250OyBzcmM6IHVybCgiLy9hdC5hbGljZG4uY29tL3QvZm9udF8xNDQyMzczODk2XzQ3NTQ0NTUuZW90PyNpZWZpeCIpIGZvcm1hdCgiZW1iZWRkZWQtb3BlbnR5cGUiKSwgdXJsKCIvL2F0LmFsaWNkbi5jb20vdC9mb250XzE0NDIzNzM4OTZfNDc1NDQ1NS53b2ZmIikgZm9ybWF0KCJ3b2ZmIiksIHVybCgiLy9hdC5hbGljZG4uY29tL3QvZm9udF8xNDQyMzczODk2XzQ3NTQ0NTUudHRmIikgZm9ybWF0KCJ0cnVldHlwZSIpLCB1cmwoIi8vYXQuYWxpY2RuLmNvbS90L2ZvbnRfMTQ0MjM3Mzg5Nl80NzU0NDU1LnN2ZyNpZm9udCIpIGZvcm1hdCgic3ZnIik7IH0KCl1dPjwvc3R5bGU+PC9kZWZzPjxnIGNsYXNzPSJ0cmFuc2Zvcm0tZ3JvdXAiPjxnIHRyYW5zZm9ybT0ic2NhbGUoMC4wMTU2MjUsIDAuMDE1NjI1KSI+PHBhdGggZD0iTTcxMS4zMDYyIDI5MC42OTcyYzI0LjI4MjEgMCA0NS4zNzY1LTE5LjcwNjkgNDUuMzc2NS00NC4wMzJWNDYuNTYwMjU1OTk5OTk5OTk1YzAtMjQuMzI1MS0yMS4wOTU0LTQ0LjA1MzUtNDUuMzc2NS00NC4wNTM1LTI0LjMwMjYgMC00My45ODggMTkuNzI4NC00My45ODggNDQuMDUzNXYyMDAuMTA0OTZDNjY3LjMxODMgMjcwLjk5MDMgNjg3LjAwMzYgMjkwLjY5NzIgNzExLjMwNjIgMjkwLjY5NzJ6TTYyMy40ODA4IDExMy40MjAzSDQwMC43NjQ5Mjh2NjYuNTEzOTJoMjIyLjcxNTkwNDAwMDAwMDAyVjExMy40MjAyODh6TTg4NC4wNTMgMTEzLjQyMDNoLTgyLjc3NDAxNnY2Ni4xNDUyOGg4NS45NDAyMjRjMjUuMjc4NSAwIDQ2LjYxMTUgMjEuMzc2IDQ2LjYxMTUgNDYuNjc3djE1My45Mjc2OEg5MC40Mzg2NTYwMDAwMDAwMXYtMTUzLjkyNzY4YzAtMjUuMyAyMS4zMzMtNDYuNjc3IDQ2LjYxMTUtNDYuNjc3aDg2LjUwMzQyNFYxMTMuNDIwMjg4aC04Mi42NDI5NDRjLTY0LjA4NiAwLTExNi41MDc2IDUyLjUwODctMTE2LjUwNzYgMTE2LjcwMzJ2Njc2LjgwMTUzNTk5OTk5OTljMCA2NC4xNzQxIDUwLjQ5MTQgMTE2LjY4MDcgMTE0LjU3NzQgMTE2LjY4MDdIODg0LjA1Mjk5MmM2NC4wNjI1IDAgMTE2LjUwNjYtNTIuNTA2NiAxMTYuNTA2Ni0xMTYuNjgwN1YyMzAuMTIzNTE5OTk5OTk5OThDMTAwMC41NTk2IDE2NS45MjkgOTQ4LjExNDQgMTEzLjQyMDMgODg0LjA1MyAxMTMuNDIwM3pNOTMzLjgyOTYgOTEwLjM1MTRjMCAyNS4zLTIxLjMzMyA0Ni42NzYtNDYuNjExNSA0Ni42NzZIMTM3LjA1MDExMTk5OTk5OTk4Yy0yNS4yNzg1IDAtNDYuNjExNS0yMS4zNzYtNDYuNjExNS00Ni42NzZWNDQ2LjQ0NTU2OEg5MzMuODI5NjMyVjkxMC4zNTEzNnpNMjY3LjEwODQgNjQ2LjE4MTljMzYuODc3MyAwIDY2Ljc1MjUtMjkuOTM5NyA2Ni43NTI1LTY2Ljg4MTUgMC0zNi45MjI0LTI5Ljg3NTItNjYuODYxMS02Ni43NTI1LTY2Ljg2MTEtMzYuODU0OCAwLTY2Ljc1MjUgMjkuOTM5Ny02Ni43NTI1IDY2Ljg2MTFDMjAwLjM1NTggNjE2LjI0MjIgMjMwLjI1MjUgNjQ2LjE4MTkgMjY3LjEwODQgNjQ2LjE4MTl6TTUxMS41NDg0IDY0Ni4xODE5YzM2Ljg1NTggMCA2Ni43NTI1LTI5LjkzOTcgNjYuNzUyNS02Ni44ODE1IDAtMzYuOTIyNC0yOS44OTU3LTY2Ljg2MTEtNjYuNzUyNS02Ni44NjExLTM2Ljg3NzMgMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44NjExQzQ0NC43OTU5IDYxNi4yNDIyIDQ3NC42NzExIDY0Ni4xODE5IDUxMS41NDg0IDY0Ni4xODE5ek0yNjUuOTE2NCA4OTAuNzA5YzM2Ljg3NzMgMCA2Ni43NTE1LTI5LjkzOTcgNjYuNzUxNS02Ni44NjExIDAtMzYuOTQyOC0yOS44NzQyLTY2Ljg4MjYtNjYuNzUxNS02Ni44ODI2LTM2Ljg1NTggMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44ODI2QzE5OS4xNjM5IDg2MC43NjkzIDIyOS4wNTk2IDg5MC43MDkgMjY1LjkxNjQgODkwLjcwOXpNNTExLjU0ODQgODkwLjcwOWMzNi44NTU4IDAgNjYuNzUyNS0yOS45Mzk3IDY2Ljc1MjUtNjYuODYxMSAwLTM2Ljk0MjgtMjkuODk1Ny02Ni44ODI2LTY2Ljc1MjUtNjYuODgyNi0zNi44NzczIDAtNjYuNzUyNSAyOS45Mzk3LTY2Ljc1MjUgNjYuODgyNkM0NDQuNzk1OSA4NjAuNzY5MyA0NzQuNjcxMSA4OTAuNzA5IDUxMS41NDg0IDg5MC43MDl6TTc1NS42NDEzIDY0Ni4xODE5YzM2Ljg1NjggMCA2Ni43NTM1LTI5LjkzOTcgNjYuNzUzNS02Ni44ODE1IDAtMzYuOTIyNC0yOS44OTY3LTY2Ljg2MTEtNjYuNzUzNS02Ni44NjExLTM2Ljg3NzMgMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44NjExQzY4OC44ODk5IDYxNi4yNDIyIDcxOC43NjQgNjQ2LjE4MTkgNzU1LjY0MTMgNjQ2LjE4MTl6TTMxMS43MDM2IDI5MC42OTcyYzI0LjI4MTEgMCA0NS4zNzY1LTE5LjcwNjkgNDUuMzc2NS00NC4wMzJWNDYuNTYwMjU1OTk5OTk5OTk1YzAtMjQuMzI1MS0yMS4wOTQ0LTQ0LjA1MzUtNDUuMzc2NS00NC4wNTM1LTI0LjMwMTYgMC00My45ODkgMTkuNzI4NC00My45ODkgNDQuMDUzNXYyMDAuMTA0OTZDMjY3LjcxNDYgMjcwLjk5MDMgMjg3LjQwMiAyOTAuNjk3MiAzMTEuNzAzNiAyOTAuNjk3MnoiIGZpbGw9IiM1ZTdhODgiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==) no-repeat 8px 10px;
padding-left: 36px;
color:#666;
}
/*transition*/
.fade-enter-active,
.fade-leave-active {
transition: all .5s ease-in-out;
}
.fade-enter,.fade-leave-active{
opacity: 0;
transform: translateY(-10px);
}
/*下拉框*/
.calendar-dropdown{
background: #fff;
position: absolute;
left:0;
top:0;
padding:20px;
border: 1px solid #eee;
border-radius: 2px;
}
.calendar-dropdown:before {
position: absolute;
left:30px;
top: -10px;
content: "";
border:5px solid rgba(0, 0, 0, 0);
border-bottom-color: #DEDEDE;
}
.calendar-dropdown:after {
position: absolute;
left:30px;
top: -9px;
content: "";
border:5px solid rgba(0, 0, 0, 0);
border-bottom-color: #fff;
}
/*弹出框*/
.calendar-dialog{
position: absolute;
left:0;
top:0;
right:0;
bottom:0;
}
.calendar-dialog-mask{
background:rgba(255,255,255,.5);
width:100%;
height:100%;
}
.calendar-dialog-body{
background: #fff;
position: absolute;
left:50%;
top:50%;
transform: translate(-50%,-50%);
padding:20px;
border: 1px solid #eee;
border-radius: 2px;
}
</style>

View File

@@ -0,0 +1,474 @@
<template>
<div class="app-container">
<el-card>
<span style="margin-left: 15px">班次类型:</span>
<el-select v-model="roleName" placeholder="班次类型" clearable size="small" style="width:200px">
<el-option
v-for="item in roleNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="searchTable()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addShifttable()">增加</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="ShiftType()">班次类型工作时间</el-button>
</el-card>
<el-card>
<el-table
:data="tableData"
border
size="mini"
style="width: 100%;height: 400px;">
<el-table-column label="开始工作时间">
<template slot-scope="scope">
{{ scope.row.开始工作时间 }}
</template>
</el-table-column>
<el-table-column disabled label="结束工作时间" >
<template slot-scope="scope">
{{ scope.row.结束工作时间 }}
</template>
</el-table-column>
<el-table-column label="班次类型">
<template slot-scope="scope">
{{ scope.row.班次类型 }}
</template>
</el-table-column>
<el-table-column label="班次代码">
<template slot-scope="scope">
{{ scope.row.班次代码 }}
</template>
</el-table-column>
<el-table-column label="是否夜班">
<template slot-scope="scope">
{{ scope.row.是否夜班 }}
</template>
</el-table-column>
<el-table-column label="是否工作">
<template slot-scope="scope">
{{ scope.row.是否工作 }}
</template>
</el-table-column>
<el-table-column label="是否工作">
<template slot-scope="scope">
{{ scope.row.是否工作 }}
</template>
</el-table-column>
<el-table-column label="日工作能力">
<template slot-scope="scope">
{{ scope.row.日工作能力 }}
</template>
</el-table-column>
<el-table-column label="是否可以安排高难度件">
<template slot-scope="scope">
{{ scope.row.是否可以安排高难度件 }}
</template>
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="aeditShifttable(scope.row)">修改</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :visible.sync ="dialogFormVisible1" title="增加" center style="min-height: 270px" width="900px">
<el-form ref="form1" :model="form1" :rules="rules" label-position="right" label-width="160px" class="demo-ruleForm">
<el-row>
<el-col :span="10">
<el-form-item label="开始工作时间" >
<el-time-picker
v-model="form1.value"
:picker-options="{
selectableRange: '01:30:00 - 23:30:00'
}"
value-format="hh:mm:ss"
size="mini"
style="width: 200px"
placeholder="任意时间点"/>
</el-form-item>
<el-form-item label="结束工作时间" >
<el-time-picker
v-model="form1.value2"
:picker-options="{
selectableRange: '01:30:00 - 23:30:00'
}"
value-format="hh:mm:ss"
size="mini"
style="width: 200px"
placeholder="任意时间点"/>
</el-form-item>
<el-form-item label="班次类型" >
<el-input
v-model="form1.shifttype"
size="mini"
style="width:200px"/>
</el-form-item>
<el-form-item label="班次代码" >
<el-input v-model="form1.shiftnumber" size="mini" style="width:200px"/>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="是否夜班" >
<el-select v-model="form1.nightwork" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="是否工作" >
<el-select v-model="form1.work" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="是否可以安排临时件" >
<el-select v-model="form1.temporary" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="是否可以安排高难度件" >
<el-select v-model="form1.difficult" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" >
<el-input
v-model="form1.note"
size="mini"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOFF"> </el-button>
<el-button type="primary" @click="submitAdd1()"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="编辑" center style="min-height: 270px" width="900px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="10">
<el-form-item label="开始工作时间" >
<el-time-picker
v-model="form1.value"
:picker-options="{
selectableRange: '01:30:00 - 23:30:00'
}"
value-format="hh:mm:ss"
size="mini"
style="width: 200px"
placeholder="任意时间点"/>
</el-form-item>
<el-form-item label="结束工作时间" >
<el-time-picker
v-model="form1.value2"
:picker-options="{
selectableRange: '01:30:00 - 23:30:00'
}"
value-format="hh:mm:ss"
size="mini"
style="width: 200px"
placeholder="任意时间点"/>
</el-form-item>
<el-form-item label="班次类型" >
<el-input
v-model="form2.shifttype"
size="mini"
style="width:200px"/>
</el-form-item>
<el-form-item label="班次代码" >
<el-input v-model="form2.shiftnumber" size="mini" style="width:200px"/>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="是否夜班" >
<el-select v-model="form2.nightwork" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="是否工作" >
<el-select v-model="form2.work" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="是否可以安排临时件" >
<el-select v-model="form2.temporary" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="是否可以安排高难度件" >
<el-select v-model="form2.difficult" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" >
<el-input
v-model="form2.note"
size="mini"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOFF">取消</el-button>
<el-button type="primary" @click="submitAdd2()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getScheduling, searchProgramme, addShift, editShift, deleteShift, addShiftType } from '@/api/BasicData/ShiftManagement'
export default {
data() {
return {
roleName: '',
roleNames: [],
tableData: [],
hour: '',
minutes: '',
seconds: '',
tableDatate: [],
dialogFormVisible: false,
form1: {
value: '',
value2: '',
shifttype: '',
shiftnumber: '',
nightwork: '',
work: '',
temporary: '',
difficult: '',
note: ''
},
options: [{
value: '1',
label: '是'
}, {
value: '0',
label: '否'
}],
rules: { // 表单验证规则
value: [{ required: true, message: '请选择时间', trigger: 'blur' }],
value2: [{ required: true, message: '请选择时间', trigger: 'blur' }],
shifttype: [{ required: true, message: '请输入班次', trigger: 'change' }]
},
form2: {
value: new Date(2016, 9, 10, 18, 40),
value2: new Date(2016, 9, 10, 18, 40),
shifttype: '',
shiftnumber: '',
nightwork: '',
work: '',
temporary: '',
difficult: '',
note: ''
},
dialogFormVisible1: false,
dialogFormVisible2: false,
pageCurrent: 1,
pageSize: 10,
total: 0,
rules2: { // 表单验证规则
value: [{ required: true, message: '请选择时间', trigger: 'blur' }],
value2: [{ required: true, message: '请选择时间', trigger: 'blur' }],
shifttype: [{ required: true, message: '请输入班次', trigger: 'change' }]
},
listnumber: ''
}
},
created() {
this.searchData()
},
methods: {
searchData() {
searchProgramme().then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.roleNames.push({
label: response.data[i].班次代码,
value: response.data[i].班次代码
})
}
})
},
searchTable() {
getScheduling(this.roleName).then(response => {
this.tableDatate = response.data
for (let i = 0; i < this.tableDatate.length; i++) {
this.hour = this.tableDatate[i].开始工作时间.Hours
this.minutes = this.tableDatate[i].开始工作时间.Minutes
this.seconds = this.tableDatate[i].开始工作时间.Seconds
this.tableDatate[i].开始工作时间 = JSON.stringify(this.tableDatate[i].开始工作时间)
this.tableDatate[i].开始工作时间 = this.hour.toString() + ':' + this.minutes.toString() + ':' + this.seconds.toString()
}
for (let i = 0; i < this.tableDatate.length; i++) {
this.hour = this.tableDatate[i].结束工作时间.Hours
this.minutes = this.tableDatate[i].结束工作时间.Minutes
this.seconds = this.tableDatate[i].结束工作时间.Seconds
this.tableDatate[i].结束工作时间 = JSON.stringify(this.tableDatate[i].结束工作时间)
this.tableDatate[i].结束工作时间 = this.hour.toString() + ':' + this.minutes.toString() + ':' + this.seconds.toString()
}
this.tableData = this.tableDatate
this.total = this.tableData.length
})
},
addShifttable() {
this.dialogFormVisible1 = true
},
aeditShifttable(row) {
this.listnumber = row.序号
this.form2.value = row.开始工作时间
this.form2.value2 = row.结束工作时间
this.form2.shifttype = row.班次类型
this.form2.shiftnumber = row.班次代码
this.form2.nightwork = row.是否夜班
this.form2.work = row.是否工作
this.form2.temporary = row.是否可以安排临时件
this.form2.difficult = row.是否可以安排高难度件
this.form2.note = row.备注
this.dialogFormVisible2 = true
},
submitAdd1() {
this.$refs['form1'].validate((valid) => {
if (valid) {
addShift(this.form1.value, this.form1.value2, this.form1.shifttype, this.form1.shiftnumber, this.form1.nightwork, this.form1.work, this.form1.temporary, this.form1.difficult, this.form1.note).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.form1 = {}
this.searchTable()
this.dialogFormVisible1 = false
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
ShiftType() {
addShiftType().then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.searchTable()
} else { this.$message.error('增加失败') }
})
},
submitAdd2() {
this.$refs['form2'].validate((valid) => {
if (valid) {
editShift(this.listnumber, this.form2.value, this.form2.value2, this.form2.shifttype, this.form2.shiftnumber, this.form2.nightwork, this.form2.work, this.form2.temporary, this.form2.difficult, this.form2.note).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchTable()
this.dialogFormVisible2 = false
this.form2 = {}
} else { this.$message.error('修改失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleDelete(row) { // 删除
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteShift(row.序号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
} else { this.$message.error('删除失败') }
this.searchTable()
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
callOFF() {
this.dialogFormVisible1 = false
this.form1 = {}
this.dialogFormVisible2 = false
this.form2 = {}
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom:15px;
margin-left: 15px;
margin-right: 15px;
}
</style>

View File

@@ -40,6 +40,7 @@
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="tableDataBasic" :data="tableDataBasic"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
@@ -68,7 +69,7 @@
{{ scope.row.零件名称 }} {{ scope.row.零件名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="零件数量" align="center" min-width="80"> <el-table-column label="零件数量" min-width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.可出库数量 }} {{ scope.row.可出库数量 }}
</template> </template>
@@ -78,9 +79,13 @@
{{ scope.row.零件类型名称 }} {{ scope.row.零件类型名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" min-width="120"> <el-table-column label="设置" min-width="100" align="center">
<template slot-scope="scope" align="center"> <template slot-scope="scope">
<el-button size="small" type="warning" icon="el-icon-tickets" style="margin: 0 0 0 0px" @click="searchBasicPartRecord(scope.row)">选择</el-button> <el-button
type="primary"
size="mini"
icon="el-icon-edit"
@click="AlterNumber(scope.row)">设置</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -100,6 +105,7 @@
v-loading="listLoading1" v-loading="listLoading1"
:data="BasicPartIn" :data="BasicPartIn"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -128,6 +134,7 @@
v-show="basicshow" v-show="basicshow"
:data="BasicPartOut" :data="BasicPartOut"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -160,7 +167,7 @@
<el-card v-show="genneralshow"> <el-card v-show="genneralshow">
<el-radio-group <el-radio-group
v-model="radio" v-model="radio"
size="small" size="mini"
style="margin: 10px;" style="margin: 10px;"
@change="BasicShow()"> @change="BasicShow()">
<el-radio v-model="radio" :label="1" >基本件</el-radio> <el-radio v-model="radio" :label="1" >基本件</el-radio>
@@ -197,6 +204,7 @@
v-loading="listLoading3" v-loading="listLoading3"
:data="tableDataGeneral" :data="tableDataGeneral"
:row-style="tableRowClassName2" :row-style="tableRowClassName2"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
@@ -237,7 +245,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" min-width="120"> <el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center"> <template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-tickets" style="margin: 0 0 0 0px" @click="searchGeneralPartRecord(scope.row)">选择</el-button> <el-button size="small" type="warning" icon="el-icon-tickets" style="margin: 0 0 0 0px" @row-click="searchGeneralPartRecord(scope.row)">选择</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -257,6 +265,7 @@
v-loading="listLoading4" v-loading="listLoading4"
:data="PurchasePartIn" :data="PurchasePartIn"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -284,6 +293,7 @@
v-loading="listLoading5" v-loading="listLoading5"
v-show="genneralshow" v-show="genneralshow"
:data="PurchasePartOut" :data="PurchasePartOut"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
@@ -310,11 +320,26 @@
</el-table> </el-table>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
<!--编辑零件数量对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="盘点修改" center width="380px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" class="demo-ruleForm">
<el-form-item label="零件数量" prop="Number" label-width="100px" size="small">
<el-input v-model="form2.Number" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="修改原因" prop="AlterReason" label-width="100px">
<el-input v-model="form2.AlterReason" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff2('form2')">取消</el-button>
<el-button type="primary" @click="submitChannge()"> </el-button>
</div>
</el-dialog>
<el-tab-pane label="采购" name="second"> <el-tab-pane label="采购" name="second">
<el-card v-show="purchaseshow"> <el-card v-show="purchaseshow">
<el-radio-group <el-radio-group
v-model="radio" v-model="radio"
size="small" size="mini"
style="margin: 10px;" style="margin: 10px;"
@change="GeneralShow()"> @change="GeneralShow()">
<el-radio v-model="radio2" :label="3">外购件</el-radio> <el-radio v-model="radio2" :label="3">外购件</el-radio>
@@ -351,6 +376,7 @@
v-loading="listLoading6" v-loading="listLoading6"
:data="tableDataPurchase" :data="tableDataPurchase"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -409,11 +435,13 @@
<el-table <el-table
v-loading="listLoading7" v-loading="listLoading7"
:data="PurchasePartIn" :data="PurchasePartIn"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
label="序号" label="序号"
size="mini"
align="center" align="center"
type="index" type="index"
width="50"/> width="50"/>
@@ -437,6 +465,7 @@
v-loading="listLoading8" v-loading="listLoading8"
:data="PurchasePartOut" :data="PurchasePartOut"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -464,7 +493,7 @@
<el-card v-show="standardshow"> <el-card v-show="standardshow">
<el-radio-group <el-radio-group
v-model="radio" v-model="radio"
size="small" size="mini"
style="margin: 10px;" style="margin: 10px;"
@change="GeneralShow()"> @change="GeneralShow()">
<el-radio v-model="radio2" :label="3">外购件</el-radio> <el-radio v-model="radio2" :label="3">外购件</el-radio>
@@ -501,6 +530,7 @@
v-loading="listLoading9" v-loading="listLoading9"
:data="tableDataStandard" :data="tableDataStandard"
:row-style="tableRowClassName1" :row-style="tableRowClassName1"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
@@ -579,6 +609,7 @@
v-loading="listLoading10" v-loading="listLoading10"
:data="StandardPartIn" :data="StandardPartIn"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -605,6 +636,7 @@
<el-table <el-table
v-loading="listLoading11" v-loading="listLoading11"
:data="StandardPartOut" :data="StandardPartOut"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
@@ -672,6 +704,7 @@
v-loading="listLoadingx1" v-loading="listLoadingx1"
:data="HouseDataBasic" :data="HouseDataBasic"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -735,6 +768,7 @@
<el-table <el-table
v-loading="listLoading10" v-loading="listLoading10"
:data="HouseDataBasicIn" :data="HouseDataBasicIn"
size="mini"
border border
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
@@ -763,6 +797,7 @@
v-loading="listLoading11" v-loading="listLoading11"
:data="HouseDataBasicOut" :data="HouseDataBasicOut"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -827,6 +862,7 @@
v-loading="listLoadingx2" v-loading="listLoadingx2"
:data="HouseDataPurchase" :data="HouseDataPurchase"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -896,6 +932,7 @@
v-loading="listLoading10" v-loading="listLoading10"
:data="HouseDataPurchaseIn" :data="HouseDataPurchaseIn"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -923,6 +960,7 @@
v-loading="listLoading11" v-loading="listLoading11"
:data="HouseDataPurchaseOut" :data="HouseDataPurchaseOut"
border border
size="mini"
style="width: 100%;" style="width: 100%;"
height="200"> height="200">
<el-table-column <el-table-column
@@ -953,7 +991,8 @@
</template> </template>
<script> <script>
import { initProject, searchmachine, searchTeam, searchPurchasePart, searchBasicPart, searchStandardPart, searchGeneralPart, searchPurchasePartIn, searchPurchasePartOut, searchBasicPartIn, searchBasicPartOut, safeAmount, searchStandardPartIn, searchStandardPartOut, searchHourseBasicPart, searchHoursePurchasePart } from '@/api/Inventory/InventoryCheck' import { mapGetters } from 'vuex'
import { initProject, searchmachine, searchTeam, searchPurchasePart, searchBasicPart, searchStandardPart, searchGeneralPart, searchPurchasePartIn, searchPurchasePartOut, searchBasicPartIn, searchBasicPartOut, safeAmount, searchStandardPartIn, searchStandardPartOut, searchHourseBasicPart, searchHoursePurchasePart, CheckAlter } from '@/api/Inventory/InventoryCheck'
export default { export default {
data() { data() {
return { return {
@@ -1036,9 +1075,31 @@ export default {
HouseDataBasicIn: [], HouseDataBasicIn: [],
HouseDataPurchase: [], HouseDataPurchase: [],
HouseDataPurchaseOut: [], HouseDataPurchaseOut: [],
HouseDataPurchaseIn: [] HouseDataPurchaseIn: [],
rules2: { // 表单验证规则
Number: [{ required: true, message: '请输入安全库存量', trigger: 'blur' }],
AlterReason: [{ required: true, message: '请输入安全库存量', trigger: 'blur' }]
},
dialogFormVisible: false,
form2: {
AlterReason: '',
Number: ''
},
project: '',
machinenumber: '',
partnumber: '',
oldnumber: '',
locate: '',
contractdetail: '',
craftnumber: '',
receive: ''
} }
}, },
computed: {
...mapGetters([
'id' // 人员编号
])
},
created() { created() {
this.fetchData() this.fetchData()
}, },
@@ -1239,6 +1300,11 @@ export default {
searchBasicPart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => { searchBasicPart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataBasic = response.data.rows this.tableDataBasic = response.data.rows
this.listLoading = false this.listLoading = false
this.tableDataBasic.map(v => {
this.$set(v, 'changeSafeValue', false)
v.可出库数量 = v.可出库数量
return v
})
this.total = response.data.total this.total = response.data.total
}) })
}, },
@@ -1438,6 +1504,35 @@ export default {
this.HouseDataPurchaseOut = response.data this.HouseDataPurchaseOut = response.data
this.listLoading8 = false this.listLoading8 = false
}) })
},
AlterNumber(row) {
this.project = row.项目流水号
this.machinenumber = row.机床流水号
this.partnumber = row.组件流水号
this.oldnumber = row.可出库数量
this.locate = row.货位流水号
this.contractdetail = row.采购合同明细流水号
this.craftnumber = row.工艺计划流水号
this.receive = row.收件信息ID
this.materiallocate = row.物料与货位对照流水号
this.materialType = row.零件类型代码
this.dialogFormVisible = true
},
submitChannge() {
console.log(this.receive, this.project, this.machinenumber, this.partnumber, this.oldnumber, this.form2.AlterReason, this.form2.Number, this.id, this.locate, this.contractdetail, this.craftnumber, this.materialType, this.materiallocate)
CheckAlter(this.receive, this.project, this.machinenumber, this.partnumber, this.oldnumber, this.form2.AlterReason, this.form2.Number, this.id, this.locate, this.contractdetail, this.craftnumber, this.materialType, this.materiallocate).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.dialogFormVisible = false
this.searchBasciPartinfo()
} else {
this.$message.error('修改失败')
}
})
},
callOff2() {
this.dialogFormVisible = false
this.form2 = {}
} }
} }
} }

View File

@@ -113,7 +113,7 @@
</el-table> </el-table>
</el-card> </el-card>
<!--仓库表单--> <!--仓库表单-->
<el-dialog :visible.sync="dialogFormVisible" title="增加仓库" center width="450px"> <el-dialog :visible.sync="dialogFormVisible" title="仓库" center width="450px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="110px" class="demo-ruleForm"> <el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="110px" class="demo-ruleForm">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@@ -162,7 +162,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="联系人" prop="ContactpeopleValue"> <el-form-item label="联系人" prop="ContactpeopleValue">
<el-select v-model="form.ContactpeopleValue" clearable filterable size="small" placeholder="领用者" style="width: 200px;margin-right:10px"> <el-select v-model="form.ContactpeopleValue" clearable filterable size="small" placeholder="联系人" style="width: 200px;margin-right:10px">
<el-option <el-option
v-for="item in Contactpeople" v-for="item in Contactpeople"
:key="item.value" :key="item.value"

View File

@@ -218,7 +218,6 @@ import { searchRequestCard, initWarehouse, addRequestCard, searchInventoryNum, S
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: '', // 离线合同
data() { data() {
return { return {
purchasecard: '', purchasecard: '',

View File

@@ -97,25 +97,28 @@
</el-table> </el-table>
</el-card> </el-card>
<!--异常出库对话框--> <!--异常出库对话框-->
<el-dialog :visible.sync="dialogFormVisible1" title="编辑直达件" center width="380px"> <el-dialog :visible.sync="dialogFormVisible" title="异常出库" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left"> <el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.ErrorNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="异常数量" prop="ContractNumberValue" label-width="100px" size="small"> <el-form-item label="异常数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.ErrorNumber" size="small" placeholder="到货数量" style="width: 200px"/> <el-input v-model="form.ErrorNumber" size="small" placeholder="异常数量" style="width: 200px"/>
</el-form-item> </el-form-item>
<el-form-item label="异常原因" prop="TotalContractAmount" label-width="100px"> <el-form-item label="异常原因" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.Reason" size="small" placeholder="请输入备注" style="width: 200px"/> <el-input v-model="form.Reason" size="small" placeholder="异常原因" style="width: 200px"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button> <el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="editDirectPartm()"> </el-button> <el-button type="primary" @click="submitEdit()"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { searchList, searchListDetail, PurchasePart, BasicPart, WorkShopPart, ListDetailOut } from '@/api/Inventory/PartOut' import { searchList, searchListDetail, PurchasePart, BasicPart, WorkShopPart, ListDetailOut, ErrorOut } from '@/api/Inventory/PartOut'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
data() { data() {
@@ -150,13 +153,22 @@ export default {
listLoading: '', listLoading: '',
listLoading1: '', listLoading1: '',
rules: { // 表单验证规则 rules: { // 表单验证规则
ErrorNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }], Normalnumber: [{ required: true, message: '请输入正常数量', trigger: 'blur' }],
ErrorNumber: [{ required: true, message: '请输入异常数量', trigger: 'blur' }],
Reason: [{ required: true, message: '请选择领用人', trigger: 'blur' }] Reason: [{ required: true, message: '请选择领用人', trigger: 'blur' }]
}, },
form: { form: {
Normalnumber: '',
ErrorNumber: '', ErrorNumber: '',
Reason: '' Reason: ''
} },
dialogFormVisible: false,
projectnumber: '',
machinenumber: '',
teamnumber: '',
teanmpartnumber: '',
craftnumber: '',
locatenumber: ''
} }
}, },
computed: { computed: {
@@ -235,8 +247,29 @@ export default {
}) })
} }
}, },
ErrorpartOut() { ErrorpartOut(row) {
console.log(21231) this.dialogFormVisible = true
this.projectnumber = row.项目流水号
this.machinenumber = row.机床流水号
this.teamnumber = row.组件流水号
this.teanmpartnumber = row.采购合同明细流水号
this.craftnumber = row.工艺计划流水号
this.locatenumber = row.货位流水号
},
callOff(form) {
this.form = []
this.dialogFormVisible = false
},
submitEdit() {
ErrorOut(this.projectnumber, this.machinenumber, this.teamnumber, this.teanmpartnumber, this.craftnumber, this.locatenumber, this.form.ErrorNumber, this.form.Reason).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.dialogFormVisible = false
this.form = []
} else {
this.$message.error('添加失败')
}
})
} }
} }
} }

View File

@@ -0,0 +1,505 @@
<template>
<div class="app-container">
<el-card>
<el-radio-group
v-model="radio"
size="small"
style="margin: 10px;"
@change="BasicShow()">
<el-radio v-model="radio" :label="1" >修改记录</el-radio>
<el-radio v-model="radio" :label="2" style="margin-left: 2px" >异常记录</el-radio>
</el-radio-group>
<span style="margin-left: 20px">项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
: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="pageCurrent=1;pageSize=10;total=0;getAlterRecord()">查询</el-button>
</el-card>
<el-card v-show="altershow">
<el-table
v-loading="loading1"
:data="tableData1"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<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="组号" 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="数量" 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="记录人" 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="仓库" 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>
<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="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card v-show="errorshow">
<el-table
v-loading="loading1"
:data="tableData2"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<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="组号" 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="异常数量" min-width="50" 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="仓库" 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="零件类型" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.类型名称 }}
</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>
<el-card>
<span>补投单号:</span>
<el-input v-model="repleacecard" placeholder="补投单号" size="small" clearable style="width: 150px"/>
<span>仓库:</span>
<el-select v-model="HouseNumber" placeholder="请选择仓库" size="small" @change="searchDemo();payMethodChange()">
<el-option
v-for="item in House"
: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="pageCurrent3=1;pageSize3=10;total3=0;getReplacement()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
style="margin-left: 10px"
@click="addCard">创建补投单</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="addMateriel">选入物料</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="补投单状态" align="center" width="80" fixed="left">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.是否传递)===0" type="warning" size="small">未传递</el-tag>
<el-tag v-if="parseInt(scope.row.是否传递)===1" type="primary" size="small">已传递</el-tag>
</template>
</el-table-column>
<el-table-column label="补投单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.补投单编号 }}
</template>
</el-table-column>
<el-table-column label="姓名" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="补投时间" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.补投时间 }}
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="280" fixed="right">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.离线合同状态) === 1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)">作废</el-button>
<el-button type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard()">传递</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 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-table v-loading="" :data="tableData4" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="离线请购单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请购单编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.数量" :disabled="disable" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<el-button :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchAlterRecord, searchErrorRecord, searchReplacementCard, addReplacementCard, initWarehouse } from '@/api/Inventory/PartsReplacement'
import { mapGetters } from 'vuex'
export default {
data() {
return {
ProjectValue: '',
Project: [],
MachineValue: '',
Machine: [],
GroupNumValue: '',
GroupNum: '',
tableData1: [],
tableData2: [],
tableData3: [],
tableData4: [],
listLoading: false,
listLoading2: false,
listLoading3: false,
listLoading4: false,
PageCurrent: 1,
PageSize: 10,
total: 0,
PageCurrent2: 1,
PageSize2: 10,
total2: 0,
PageCurrent3: 1,
PageSize3: 10,
total3: 0,
ProjectValue_check: '',
MachineValue_check: '',
GroupNumValue_check: '',
repleacecard: '',
repleacecard_check: '',
people: '',
HouseNumber: '',
House: [],
radio: '',
altershow: true,
errorshow: false
}
},
computed: {
...mapGetters([
'id' // 人员编号
])
},
created() {
this.fetchData()
this.getpeopleid()
this.getHouse()
},
methods: {
// 获取人员编号
getpeopleid() {
this.people = this.id
},
getHouse() {
initWarehouse().then(response => { // 初始化仓库
console.log(response)
for (let i = 0; i < response.data.length; i++) {
this.House.push({
label: response.data[i].仓库名称,
value: response.data[i].仓库流水号
})
}
})
},
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
searchMachine() { // 查询机床
this.Machine = []
this.GroupNum = []
this.MachineValue = ''
this.GroupNumValue = ''
console.log(this.ProjectValue)
if (this.ProjectValue !== '') {
searchmachine(1, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
}
},
searchGroupList() { // 查询组号
this.GroupNum = []
this.GroupNumValue = ''
searchTeam(this.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 查询修改记录
getAlterRecord() {
this.listLoading = true
this.tableData1 = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
} else {
this.ProjectValue_check = 1
}
if (this.MachineValue === '') {
this.MachineValue_check = 0
} else {
this.MachineValue_check = 1
}
if (this.GroupNumValue === '') {
this.GroupNumValue_check = 0
} else {
this.GroupNumValue_check = 1
}
searchAlterRecord(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableData1 = response.data.rows
this.total = response.data.total
this.listLoading = false
})
this.getErrorRecord()
},
// 查询异常记录
getErrorRecord() {
this.listLoading2 = true
this.tableData2 = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
} else {
this.ProjectValue_check = 1
}
if (this.MachineValue === '') {
this.MachineValue_check = 0
} else {
this.MachineValue_check = 1
}
if (this.GroupNumValue === '') {
this.GroupNumValue_check = 0
} else {
this.GroupNumValue_check = 1
}
searchErrorRecord(this.PageCurrent2, this.PageSize2, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
this.listLoading2 = false
})
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
},
handleSizeChange2(val) {
this.PageCurrent2 = 1
this.PageSize2 = val
this.searchPartinfo()
},
handleCurrentChange2(val) {
this.PageCurrent2 = val
this.searchPartinfo()
},
// 查询补投单
getReplacement() {
this.listLoading3 = true
this.tableData3 = []
if (this.repleacecard === '') {
this.repleacecard_check = 0
} else {
this.repleacecard_check = 1
}
searchReplacementCard(this.PageCurrent3, this.PageSize3, this.repleacecard_check, this.repleacecard).then(response => {
this.tableData3 = response.data.rows
this.total3 = response.data.total
this.listLoading3 = false
})
},
addCard() {
addReplacementCard(this.people, this.HouseNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.getReplacement()
} else {
this.$message.error('删除失败')
}
})
},
BasicShow() {
if (this.radio === 1) {
this.altershow = true
this.errorshow = false
} else if (this.radio === 2) {
this.altershow = false
this.errorshow = true
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -11,6 +11,7 @@
:data="tableData1" :data="tableData1"
border border
style="width: 100%;" style="width: 100%;"
size="mini"
height="200" height="200"
@row-click = "searchListDetailt()"> @row-click = "searchListDetailt()">
<el-table-column <el-table-column
@@ -55,6 +56,7 @@
:data="tableDataPicking" :data="tableDataPicking"
border border
style="width: 100%;" style="width: 100%;"
size="mini"
height="200"> height="200">
<el-table-column <el-table-column
label="序号" label="序号"
@@ -152,6 +154,7 @@
:data="tableDataBasic" :data="tableDataBasic"
border border
style="width: 100%;" style="width: 100%;"
size="mini"
height="200"> height="200">
<el-table-column <el-table-column
label="序号" label="序号"
@@ -234,6 +237,7 @@
:data="tableDataPurchase" :data="tableDataPurchase"
border border
style="width: 100%;" style="width: 100%;"
size="mini"
height="200"> height="200">
<el-table-column <el-table-column
label="序号" label="序号"

View File

@@ -0,0 +1,166 @@
<template>
<div>
<el-card>
<el-row>
<span>零件图号:</span>
<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-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column label="打印状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="small">已导出</el-tag>
<el-tag v-else type="warning" size="small">未导出</el-tag>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<table id="BL" border cellspacing="0px" style="table-layout: fixed; width: 600px;display: none">
<colgroup>
<col style="width: 100px">
<col style="width: 150px">
<col style="width: 450px">
</colgroup>
<tr>
<th height="60px">GAOJING</th>
<th colspan="2" height="60px"><span style="font-weight:bold">备料单</span></th>
</tr>
<tr>
<td align="center">零件名称</td>
<td align="center">零件图号</td>
<td align="center">备料</td>
</tr>
<tr v-for="(list, index) in tableData2" :key="index">
<td align="center">{{ list.零件名称 }}</td>
<td align="center">{{ list.零件图号 }}</td>
<td>{{ list.工艺要求 }}</td>
</tr>
</table>
</div>
</template>
<script>
import { searchtable, searchtable2, edit } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
export default {
data() {
return {
tableData2: [],
partName: '',
all: false,
loading: false,
Data: [],
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1 // 后台获取页
}
},
created() {
this.searchTable()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, 0, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {
this.Data = response.data.rows
this.total = response.data.total
}
}).then(() => {
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].备料打印,
工艺要求: response.data[i].工艺要求
})
})
this.loading = false
}
})
},
handleSelectionChange(val) {
this.tableData2 = []
this.tableData2 = val
},
edit() {
for (let i = 0; i < this.tableData2.length; i++) {
edit(this.tableData2[i].工艺计划流水号)
}
},
downLoad(tableid) {
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
this.searchTable()
getExplorer()
method5(tableid)
Cleanup()
}
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -86,7 +86,7 @@
</el-col> </el-col>
<el-col :span="1" class="line"></el-col> <el-col :span="1" class="line"></el-col>
<el-col :span="11"> <el-col :span="11">
<el-date-picker v-model="time_machiningFinish" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="margin-bottom:20px;width:200px"/> <el-date-picker v-model="time_machiningFinish" default-time="23:59:59" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="margin-bottom:20px;width:200px"/>
</el-col> </el-col>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@@ -0,0 +1,141 @@
<template>
<div>
<el-card>
<el-row>
<span>零件图号:</span>
<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" @change="searchTable">查询全部</el-checkbox>
<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">到货</el-button>
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column label="到货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>
import { searchtable, searchtable2, edit, handlechange } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
export default {
data() {
return {
arrest: [],
all: false,
partName: '',
loading: false,
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1 // 后台获取页
}
},
created() {
this.searchTable()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {
this.Data = response.data.rows
this.total = response.data.total
}
}).then(() => {
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[i].工序流水号
})
})
this.loading = false
}
})
},
handleSelectionChange(val) {
this.arrest = val
},
edit() {
if (this.arrest.length === 0) {
this.$message.warning('请选择零件')
} else {
for (let i = 0; i < this.arrest.length; i++) {
edit(this.arrest[i].工艺计划流水号)
handlechange(this.arrest[i].工序流水号, '0000')
if (i === this.arrest.length - 1) {
this.searchTable()
}
}
}
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -605,6 +605,7 @@ export default {
}, },
created() { created() {
this.fetchData() this.fetchData()
this.searchData()
}, },
methods: { methods: {
fetchData() { fetchData() {
@@ -617,7 +618,6 @@ export default {
searchData() { searchData() {
this.loading = true this.loading = true
search(this.pageCurrent, this.pageSize, this.PrNum).then(response => { search(this.pageCurrent, this.pageSize, this.PrNum).then(response => {
console.log(response.data)
this.tableData = response.data.rows this.tableData = response.data.rows
this.total = response.data.total this.total = response.data.total
this.loading = false this.loading = false

View File

@@ -32,7 +32,7 @@
size="small" size="small"
type="date" type="date"
placeholder="请选择结束日期"/> placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">增加</el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">增加</el-button>
</el-card> </el-card>
<el-card> <el-card>

View File

@@ -11,7 +11,7 @@
</el-select> </el-select>
<span style="margin-left: 10px">销售经理</span> <span style="margin-left: 10px">销售经理</span>
<el-input v-model="MarketingManagerValue" readonly clearable size="small" style="width:200px" placeholder="请双击选择营销经理" @dblclick.native="dialogFormVisiblePeople = true" @clear="clear()"/> <el-input v-model="MarketingManagerValue" readonly clearable size="small" style="width:200px" placeholder="请双击选择营销经理" @dblclick.native="dialogFormVisiblePeople = true" @clear="clear()"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD('form2')">新增</el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD('form2')">新增</el-button>
<el-badge :value="value" :max="99" class="item"> <el-badge :value="value" :max="99" class="item">
<el-button size="small" type="text" @click="AccountsReceivable">查看收款信息</el-button> <el-button size="small" type="text" @click="AccountsReceivable">查看收款信息</el-button>
@@ -61,6 +61,11 @@
{{ scope.row.项目名称 }} {{ scope.row.项目名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="已完成进度" width="200">
<template slot-scope="scope">
{{ scope.row.执行进度名 }}
</template>
</el-table-column>
<el-table-column align="center" label="付款方式" width="200"> <el-table-column align="center" label="付款方式" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.付款方式 }} {{ scope.row.付款方式 }}
@@ -138,7 +143,7 @@
<el-pagination <el-pagination
:current-page="PageCurrent" :current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="10" :page-size="PageSize"
:total="total" :total="total"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@@ -233,7 +238,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span></span> <span></span>
<el-input v-model="scope.row.提前x天提醒" size="small" style="width:50px" placeholder="请输入提前X天提醒" @change="editDay(scope.row)"/> <el-input v-model="scope.row.提前x天提醒" size="small" style="width:50px" placeholder="请输入提前X天提醒" @change="editDay(scope.row)"/>
<span></span> <span>内完成</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="状态" width="100px"> <el-table-column align="center" label="状态" width="100px">
@@ -243,12 +248,15 @@
title="收款计划" title="收款计划"
width="200" width="200"
trigger="hover"> trigger="hover">
<div v-show="!scope.row.计划付款时间" style="text-align: center"> <div v-show="(scope.row.计划付款时间 === '' || scope.row.计划付款时间 === null) && parseInt(scope.row.未收金额)!==0 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }} 未完成</h4> <h4>{{ scope.row.执行进度名 }} 未完成</h4>
</div> </div>
<div v-show="scope.row.计划付款时间"> <div v-show="scope.row.计划付款时间 !== '' && scope.row.计划付款时间 !== null && parseInt(scope.row.未收金额)!==0">
<h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.计划付款时间 }}进行收款距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4> <h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.计划付款时间 }}进行收款距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4>
</div> </div>
<div v-show="parseInt(scope.row.未收金额)=== 0 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }}阶段收款已完成</h4>
</div>
<el-tag v-if="scope.row.计划付款时间===''||scope.row.计划付款时间===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag> <el-tag v-if="scope.row.计划付款时间===''||scope.row.计划付款时间===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&parseInt(scope.row.未收金额)===0" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag> <el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&parseInt(scope.row.未收金额)===0" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='未开始'" slot="reference" type="primary" size="small" style="width: 66px">未开始</el-tag> <el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='未开始'" slot="reference" type="primary" size="small" style="width: 66px">未开始</el-tag>
@@ -279,7 +287,7 @@
:current-page="PageCurrent2" :current-page="PageCurrent2"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="10" :page-size="10"
:total="total2" :total="PageSize2"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2" @size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/> @current-change="handleCurrentChange2"/>
@@ -1091,7 +1099,7 @@ export default {
}) })
this.$message.success('删除成功') this.$message.success('删除成功')
} else { } else {
this.$message.error('删除失败') this.$message.error('数据占用')
} }
}) })
}) })
@@ -1146,7 +1154,7 @@ export default {
this.$message.success('删除成功') this.$message.success('删除成功')
this.tableData2 = [] this.tableData2 = []
} else { } else {
this.$message.error('删除失败') this.$message.error('数据占用')
} }
}) })
}) })

View File

@@ -27,7 +27,7 @@
size="small" size="small"
type="date" type="date"
placeholder="请选择结束日期"/> placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD()">增加</el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD()">增加</el-button>
</el-card> </el-card>
<el-card> <el-card>
@@ -148,7 +148,7 @@
{{ scope.row.电话 }} {{ scope.row.电话 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="合同信息备注" width="150"> <el-table-column align="center" label="合同信息备注" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.合同信息备注 }} {{ scope.row.合同信息备注 }}
</template> </template>
@@ -186,7 +186,7 @@
</el-card> </el-card>
<el-card v-show="ExecutionProgressShow"> <el-card v-show="ExecutionProgressShow">
<div> <div>
<h4 style="display: inline-block">合同进度</h4> <h4 style="display: inline-block">项目进度</h4>
<div style="display: inline-block; float:right"> <div style="display: inline-block; float:right">
<span>已完成进度</span> <span>已完成进度</span>
<el-select v-model="executionProgressID" placeholder="请输入目前执行进度" size="small" style="width: 130px;margin-left: 20px" @change="changeExecutionProgressID"> <el-select v-model="executionProgressID" placeholder="请输入目前执行进度" size="small" style="width: 130px;margin-left: 20px" @change="changeExecutionProgressID">
@@ -507,7 +507,7 @@
<!--客户选择--> <!--客户选择-->
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px"> <el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/> <el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange"> <el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
<el-table-column label="省份" align="center" width="80"> <el-table-column label="省份" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -533,7 +533,7 @@
<el-pagination <el-pagination
:current-page="PageCurrent1" :current-page="PageCurrent1"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="10" :page-size="PageSize1"
:total="total1" :total="total1"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1" @size-change="handleSizeChange1"

View File

@@ -104,14 +104,13 @@
:file-list="fileList" :file-list="fileList"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-success="onSuccess" :on-success="onSuccess"
:action="'http://192.168.1.122:8410/submit/upload2.ashx?InvoiceNum='+ invoiceNum" :action="'http://localhost:8411/submit/upload2.ashx?InvoiceNum='+ invoiceNum"
list-type="picture-card"> list-type="picture-card">
<i class="el-icon-plus"/> <i class="el-icon-plus"/>
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVisible"> <el-dialog :visible.sync="dialogVisible">
<img :src="dialogImageUrl" width="100%" alt=""> <img :src="dialogImageUrl" width="100%" alt="">
</el-dialog> </el-dialog>
</div> </div>
</div></el-col> </div></el-col>
</el-row> </el-row>
@@ -928,7 +927,7 @@ export default {
this.$message.sucess('删除成功') this.$message.sucess('删除成功')
this.getSelect(searchCargoBox, ['货箱号', '货箱号编号'], 'cargoBox', this.invoiceNum) this.getSelect(searchCargoBox, ['货箱号', '货箱号编号'], 'cargoBox', this.invoiceNum)
} else { } else {
this.$message.error('删除失败') this.$message.error('数据占用')
} }
}) })
}) })
@@ -1093,7 +1092,7 @@ export default {
return { return {
_id: item.附件号, _id: item.附件号,
name: item.文件标识, name: item.文件标识,
url: 'http://192.168.1.122:8410/webpage/img/' + item.文件标识 url: 'http://localhost:8411/webpage/img/' + item.文件标识
} }
}) })
}, },
@@ -1107,7 +1106,7 @@ export default {
} }
}) })
if (data[0].result === '0') { if (data[0].result === '0') {
this.$message.error('删除失败了。') this.$message.error('删除失败')
} }
}, },
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
@@ -1127,7 +1126,7 @@ export default {
this.$message.error('只能上传图片。。') this.$message.error('只能上传图片。。')
} }
if (!isLt4M) { if (!isLt4M) {
this.$message.error('上传头像图片大小不能超过 4MB!') this.$message.error('上传图片大小不能超过 4MB!')
} }
return isJPG && isLt4M && isInvoiceNum return isJPG && isLt4M && isInvoiceNum

View File

@@ -28,7 +28,7 @@
size="small" size="small"
type="date" type="date"
placeholder="请选择结束日期"/> placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
</el-card> </el-card>
<!--项目表格--> <!--项目表格-->
<el-card> <el-card>
@@ -94,7 +94,7 @@
size="mini" size="mini"
type="primary" type="primary"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click.stop="openAddInvoiceRecordingDialog(); flag = 1">增加记录</el-button> @click.stop="openAddInvoiceRecordingDialog(scope.row); flag = 1">增加记录</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -286,7 +286,7 @@
<!--客户选择--> <!--客户选择-->
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px"> <el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/> <el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange"> <el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
<el-table-column label="省份" align="center" width="80"> <el-table-column label="省份" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -391,6 +391,7 @@ export default {
}, },
created() { created() {
this.init() this.init()
this.fetchTableData1()
}, },
methods: { methods: {
// 初始化条件 // 初始化条件
@@ -466,7 +467,7 @@ export default {
sums[index] = this.taxRate * 100 + '% (税率)' sums[index] = this.taxRate * 100 + '% (税率)'
return return
} else if (index === 9) { } else if (index === 9) {
sums[index] = parseFloat(sums[7]) * this.taxRate + ' 元(税额)' sums[index] = (parseInt(sums[7]) * 100 * this.taxRate) / 100 + ' 元(税额)'
return return
} else if (index === 10) { } else if (index === 10) {
sums[index] = parseFloat(sums[7]) - parseFloat(sums[9]) + ' 元(未税)' sums[index] = parseFloat(sums[7]) - parseFloat(sums[9]) + ' 元(未税)'
@@ -491,7 +492,7 @@ export default {
this.fetchTableData1() this.fetchTableData1()
this.fetchTableData2(row) this.fetchTableData2(row)
} else { } else {
this.$message.error('修改失败') this.$message.error('数据占用')
} }
}) })
}, },
@@ -522,7 +523,8 @@ export default {
this.peopleid = '' this.peopleid = ''
}, },
// 打开增加开票记录对话框 // 打开增加开票记录对话框
openAddInvoiceRecordingDialog() { openAddInvoiceRecordingDialog(row) {
this.projectid = row.项目流水号
this.addForm('form') this.addForm('form')
this.title = '增加' this.title = '增加'
this.dialogFormVisible1 = true this.dialogFormVisible1 = true
@@ -596,7 +598,7 @@ export default {
this.tableData2 = data this.tableData2 = data
}) })
} else { } else {
this.$message.error('增加失败') this.$message.error('数据占用')
} }
}) })
}, },
@@ -630,7 +632,7 @@ export default {
this.tableData2 = data this.tableData2 = data
}) })
} else { } else {
this.$message.error('修改失败') this.$message.error('数据占用')
} }
}) })
}, },

View File

@@ -0,0 +1,810 @@
<template>
<div>
<el-card>
<span>项目名称</span>
<el-select v-model="entryNameValue" filterable placeholder="项目名称" style="margin-right: 10px" size="small" clearable>
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">开始日期</span>
<el-date-picker
v-model="startTime"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择开始日期"/>
<span style="margin-left: 10px">结束日期</span>
<el-date-picker
v-model="endTime"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableData1"
style="width: 100%"
height="400"
border
size="mini"
highlight-current-row
@row-click="fetchTableData2">
<el-table-column align="center" label="合同编号" width="200">
<template slot-scope="scope">
<el-tag type="primary">{{ scope.row.合同编号 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" width="200">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="已完成进度" width="100">
<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="80">
<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="80">
<template slot-scope="scope">
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column align="center" label="联系电话" width="100">
<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 label="操作" fixed="right" align="center" width="260px">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用增加履约保证金"
size="mini"
type="primary"
icon="el-icon-circle-plus-outline"
@click.stop="openPerformanceBondDialog(scope.row); flag = 1">履约保证金</el-button>
<el-button
:disabled="scope.row.是否禁用增加履约保函"
size="mini"
type="primary"
icon="el-icon-circle-plus-outline"
@click.stop="addPerformanceGuarantee(scope.row)">履约保函</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<template>
<el-tabs v-model="activeName" type="card">
<el-tab-pane :disabled="performanceBondDisabled" label="履约保证金" name="first">
<el-table
v-loading="listLoading2"
:data="tableData2"
highlight-current-row
style="width: 100%"
height="100"
border
size="mini">
<el-table-column align="center" label="履约保证金金额">
<template slot-scope="scope">
<el-tag type="primary" size="small">{{ scope.row.履约保证金金额 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="保证金类型">
<template slot-scope="scope">
{{ scope.row.保证金类型 }}
</template>
</el-table-column>
<el-table-column align="center" label="收回条件">
<template slot-scope="scope">
{{ scope.row.执行进度名 }}
</template>
</el-table-column>
<el-table-column align="center" label="截止时间">
<template slot-scope="scope">
{{ scope.row.提前X天提醒我 }}天内收回
</template>
</el-table-column>
<el-table-column align="center" label="是否收回">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.是否收回) === 1" slot="reference" size="small" type="success" style="width: 66px">已收回</el-tag>
<el-tag v-else-if="parseInt(scope.row.是否收回) === 0" slot="reference" type="danger" size="small" style="width: 66px">未收回</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="实际收回日期">
<template slot-scope="scope">
{{ scope.row.实际收回日期 === '' || scope.row.实际收回日期 === null ? scope.row.实际收回日期 = '暂未收回' : scope.row.实际收回日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="状态">
<template slot-scope="scope">
<el-popover
placement="top-start"
title="收回计划"
width="200"
trigger="hover">
<div v-show="(scope.row.计划收款日期 === '' || scope.row.计划收款日期 === null) && parseInt(scope.row.是否收回)!== 1 " style="text-align: center">
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
</div>
<div v-show="scope.row.计划收款日期 !== '' && scope.row.计划收款日期 !== null && parseInt(scope.row.是否收回)!== 1">
<h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.计划收款日期 }}进行收款距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4>
</div>
<div v-show="parseInt(scope.row.是否收回)=== 1 " style="text-align: center">
<h4>已于{{ scope.row.实际收回日期 }}收回</h4>
</div>
<el-tag v-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null && parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 1" slot="reference" size="small" type="warning" style="width: 66px">即将拖期</el-tag>
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 2" slot="reference" type="danger" size="small" style="width: 66px">已经拖期</el-tag>
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 0" slot="reference" type="primer" size="small" style="width: 66px">无计划</el-tag>
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 1" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
<el-tag v-else-if="scope.row.计划收款日期===''||scope.row.计划收款日期===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="260px">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用收回"
size="mini"
type="success"
@click.stop="takeBack(scope.row)">收回</el-button>
<el-button
size="mini"
type="warning"
@click.stop="openEditPerformanceBondDialog(scope.row); flag = 2">编辑</el-button>
<el-button
size="mini"
type="danger"
@click.stop="delPerformanceBond(scope.row)">删除</el-button >
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane :disabled="performanceGuaranteeDisabled" label="履约保函" name="second">
<div v-show="performanceGuaranteeShow">
<el-button type="danger" icon="el-icon-delete" size="small" style="float: right;display: inline-block" @click="delPerformanceGuarantee">删除</el-button>
<div style="width: 150px; height: 150px; margin: auto;left: 50%;right: 50%">
<el-upload
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:file-list="fileList"
:before-upload="beforeUpload"
:on-success="onSuccess"
:action="'http://localhost:8411/submit/upload3.ashx?ProjectId='+ projectId"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img :src="dialogImageUrl" width="100%" alt="">
</el-dialog>
</div>
</div>
</el-tab-pane>
</el-tabs>
</template>
</el-card>
<el-dialog :visible.sync="dialogTimeVisible" title="实际收回日期" center style="min-height: 300px" width="23%">
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item label="实际收回日期" prop="实际收回日期">
<el-date-picker
v-model="form.实际收回日期"
style="width: 200px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择实际收回日期"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOffTime('form')">取消</el-button>
<el-button type="primary" @click="submitTime('form')"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title1" :visible.sync="dialogFormVisible1" center style="min-height: 300px" width="40%">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="120px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="保证金金额" prop="保证金金额">
<el-input-number v-model="form2.保证金金额" :precision="2" :step="0.1" style="width: 200px" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保证金类型" prop="保证金类型">
<el-select v-model="form2.保证金类型" filterable placeholder="请选择保证金类型" style="width: 200px" size="small">
<el-option
v-for="item in performanceBondType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="收回条件" prop="收回条件">
<el-select v-model="form2.收回条件" filterable placeholder="请选择收回条件" style="width: 200px" size="small">
<el-option
v-for="item in plannedTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="截止时间(天)" prop="截止时间">
<el-input-number v-model="form2.截止时间" placeholder="请输入截止时间" style="width: 200px" size="small"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOffPerformanceBondDialog('form2')">取消</el-button>
<el-button type="primary" @click="submitPerformanceBondDialog('form2')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import elInput from 'element-ui/packages/input'
import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack, executionProgressID, initType, addPerformanceBond, editPerformanceBond, delPerformanceBond, addPerformanceGuarantee, delPerformanceGuarantee } from '@/api/MarketingCenter/PerformanceBond'
export default {
components: {
elInput
},
data() {
const validateValue = (rule, value, callback) => {
if (value === 0) {
callback(new Error('金额不能为0'))
} else {
callback()
}
}
return {
title1: '', // 履约保证金新增或编辑对话框
entryNameValue: '', // 查询条件_项目名称
entryName: [], // 查询条件_项目名称数组
startTime: '', // 查询条件_开始时间
endTime: '', // 查询条件_结束时间
PageSize: 10, // 项目信息表格初始一页显示十条
PageCurrent: 1, // 项目信息表格一次翻一页
total: null,
tableData1: [], // 项目信息表格数据
listLoading1: false, // 项目信息表格加载动画
flag: '', // 旗帜变量
activeName: 'first', // 标签页初始
projectId: '', // 项目流水号中间变量
tableData2: [], // 履约保证金信息
listLoading2: false,
dialogTimeVisible: false,
performanceBondCode: '', // 履约保证金流水号
dialogFormVisible1: false, // 履约保证金对话框
plannedTime: [],
performanceBondType: [],
performanceBondDisabled: true, // 履约保证金标签页是否禁用
performanceGuaranteeDisabled: true, // 履约保函是否禁用
dialogVisible: false, // 履约保函复印件
dialogImageUrl: '',
fileList: [],
performanceGuaranteeShow: true,
form: {
实际收回日期: ''
},
form2: {
保证金金额: '',
保证金类型: 1,
收回条件: 1,
截止时间: 15
},
rules: { // 表单验证规则
实际收回日期: [{ required: true, message: '请选择实际收回日期', trigger: 'change' }]
},
rules2: { // 表单验证规则
保证金金额: [
{ required: true, message: '请输入保证金金额', trigger: 'change' },
{ required: true, trigger: 'blur', validator: validateValue }],
保证金类型: [{ required: true, message: '请选择保证金类型', trigger: 'change' }],
收回条件: [{ required: true, message: '请选择收回条件', trigger: 'change' }],
截止时间: [{ required: true, message: '请输入截止时间', trigger: 'change' }]
}
}
},
created() {
this.init()
this.fetchTableData1()
},
methods: {
// 初始化条件
init() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
this.getSelect(executionProgressID, ['执行进度名', '执行进度ID'], 'plannedTime')
this.getSelect(initType, ['保证金类型', '保证金类型流水号'], 'performanceBondType')
},
// 查询合同(项目)信息
fetchTableData1() {
if (this.entryNameValue === '' || this.entryNameValue === null) {
this.entryNameValue_check = 0
} else {
this.entryNameValue_check = 1
}
if (this.startTime === '' || this.startTime === null) {
this.startTime_check = 0
} else {
this.startTime_check = 1
}
if (this.endTime === '' || this.endTime === null) {
this.endTime_check = 0
} else {
this.endTime_check = 1
}
this.listLoading1 = true
searchTableData1(this.PageCurrent, this.PageSize, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime).then(response => {
this.tableData2 = []
this.listLoading1 = false
const data = response.data
for (let i = 0; i < data.rows.length; i++) {
data.rows[i].合同签订日期 = data.rows[i].合同签订日期.substring(0, data.rows[i].合同签订日期.length - 8)
parseInt(data.rows[i].履约保证金类型) !== 0 ? data.rows[i].是否禁用增加履约保证金 = true : data.rows[i].是否禁用增加履约保证金 = false
parseInt(data.rows[i].履约保证金类型) !== 0 ? data.rows[i].是否禁用增加履约保函 = true : data.rows[i].是否禁用增加履约保函 = false
}
this.tableData1 = data.rows
this.total = data.total
})
},
// 项目信息表格改变每页显示条数
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.tableData2 = []
this.fetchTableData1()
},
// 项目信息表格翻页
handleCurrentChange(val) {
this.PageCurrent = val
this.tableData2 = []
this.fetchTableData1()
},
// 履约保证金查询
fetchTableData2(row) {
this.projectId = row.项目流水号
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.tableData2 = []
this.performanceGuaranteeShow = false
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
}
})
},
takeBack(row) {
this.addForm('form')
this.performanceBondCode = row.履约保证金流水号
this.dialogTimeVisible = true
},
callOffTime() {
this.dialogTimeVisible = false
},
submitTime(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
takeBack(this.performanceBondCode, this.form.实际收回日期).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogTimeVisible = false
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
}
})
} else {
this.$message.error('操作失败')
}
})
}
})
},
openPerformanceBondDialog(row) {
this.addForm('form2')
this.title1 = '增加履约保证金'
this.dialogFormVisible1 = true
this.projectId = row.项目流水号
this.tableData2 = []
},
callOffPerformanceBondDialog() {
this.dialogFormVisible1 = false
},
submitPerformanceBondDialog(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.flag === 1) {
addPerformanceBond(this.projectId, this.form2.保证金金额, this.form2.保证金类型, this.form2.收回条件, this.form2.截止时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.fetchTableData1()
this.dialogFormVisible1 = false
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
}
})
} else {
this.$message.error('操作失败')
}
})
} else if (this.flag === 2) {
editPerformanceBond(this.projectId, this.form2.保证金金额, this.form2.保证金类型, this.form2.收回条件, this.form2.截止时间, this.performanceBondCode).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogFormVisible1 = false
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
this.tableData2 = []
this.performanceGuaranteeShow = false
}
})
} else {
this.$message.error('操作失败')
}
})
}
}
})
},
openEditPerformanceBondDialog(row) {
this.dialogFormVisible1 = true
this.performanceBondCode = row.履约保证金流水号
this.form2.保证金金额 = row.履约保证金金额
this.form2.保证金类型 = row.保金类型
this.form2.收回条件 = parseInt(row.执行进度流水号)
this.title1 = '编辑履约保证金'
},
delPerformanceBond(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPerformanceBond(this.projectId, row.履约保证金流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.activeName = 'first'
this.listLoading2 = true
this.fetchTableData1()
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else {
this.$message.error('数据占用')
}
})
})
},
addPerformanceGuarantee(row) {
this.projectId = row.项目流水号
this.$confirm('是否新增履约保函', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addPerformanceGuarantee(this.projectId).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.fetchTableData1()
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.tableData2 = []
this.performanceGuaranteeShow = false
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
}
})
} else {
this.$message.error('添加失败')
}
})
})
},
async getFileList() {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 合同信息管理_履约保证金_履约保函 where 是否启用 = 1 and 项目流水号 = ${this.projectId}`
}
})
this.fileList = data.map(item => {
return {
_id: item.履约保函流水号,
name: item.文件标识,
url: 'http://localhost:8411/webpage/img/' + item.文件标识
}
})
},
async handleRemove(file, fileList) {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '4',
name: `update 合同信息管理_履约保证金_履约保函 set 是否启用 = 0 where 履约保函流水号 = ${file._id}`
}
})
if (data[0].result === '0') {
this.$message.error('上传失败')
}
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
beforeUpload(file) {
const isJPG = /^image\/.*/.test(file.type)
const isLt4M = file.size / 1024 / 1024 < 4
const isInvoiceNum = !!this.projectId
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
if (!isLt4M) {
this.$message.error('上传图片大小不能超过 4MB!')
}
return isJPG && isLt4M && isInvoiceNum
},
onSuccess(res, file, fileList) {
fileList = []
if (res[0].result === '1') {
this.getFileList()
} else {
this.$message.error('上传失败')
}
},
delPerformanceGuarantee() {
this.$confirm('是否删除履约保函', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPerformanceGuarantee(this.projectId).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.fetchTableData1()
typeOfPerformanceBond(this.projectId).then(response => {
const data = response.data[0].履约保证金类型
return data
}).then(data => {
if (data === 1) {
this.activeName = 'first'
this.listLoading2 = true
this.performanceBondDisabled = false
this.performanceGuaranteeDisabled = true
searchTableData2(this.projectId).then(response => {
this.listLoading2 = false
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
data[i].计划收款日期 === '' || data[i].计划收款日期 === null || parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
}
this.tableData2 = data
})
} else if (data === 2) {
this.activeName = 'second'
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = false
this.performanceGuaranteeShow = true
this.getFileList()
} else {
this.$message.warning('未缴纳履约保证金')
this.tableData2 = []
this.performanceGuaranteeShow = false
this.performanceBondDisabled = true
this.performanceGuaranteeDisabled = true
}
})
} else {
this.$message.error('删除失败')
}
})
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -12,7 +12,7 @@
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button> <el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addSafetyMargin();flag1 = 1">增加</el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addSafetyMargin();flag1 = 1">增加</el-button>
<span>预警颜色说明</span> <span>预警颜色说明</span>
<el-tag type="info">未到时间</el-tag> <el-tag type="info">未到时间</el-tag>

View File

@@ -68,6 +68,12 @@
<el-tag v-else type="info" size="small">未付款</el-tag> <el-tag v-else type="info" size="small">未付款</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="到货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.单据状态==='3'" type="success" size="small">已到货</el-tag>
<el-tag v-else type="info" size="small">未到货</el-tag>
</template>
</el-table-column>
<el-table-column label="表单号" align="center" width="280px"> <el-table-column label="表单号" align="center" width="280px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.表单号 }} {{ scope.row.表单号 }}
@@ -143,9 +149,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款日期" align="center" width="240px"> <el-table-column label="付款日期" align="center" width="240px">
<!--<template slot-scope="scope">-->
<!--{{scope.row.实际付款时间}}-->
<!--</template>-->
<el-table-column label="入库" align="center" width="140px"> <el-table-column label="入库" align="center" width="140px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.入库时间 }} {{ scope.row.入库时间 }}
@@ -176,7 +179,7 @@
class="el-icon-edit" class="el-icon-edit"
@click="Withdrawing(scope.$index, scope.row, 'form')">扣款</el-button> @click="Withdrawing(scope.$index, scope.row, 'form')">扣款</el-button>
<el-button <el-button
:disabled="scope.row.实际付款时间!==''" :disabled="scope.row.实际付款时间!==''||scope.row.单据状态!=='3'"
size="mini" size="mini"
type="success" type="success"
class="el-icon-check" class="el-icon-check"
@@ -376,8 +379,6 @@ export default {
day = '0' + day day = '0' + day
} }
this.实际付款时间 = time.getFullYear() + '/' + month + '/' + day this.实际付款时间 = time.getFullYear() + '/' + month + '/' + day
// payment(row.外协加工任务单流水号).then(response => {
// }).then(() => {
payTime(row.外协加工任务单流水号, this.实际付款时间).then(response => { payTime(row.外协加工任务单流水号, this.实际付款时间).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('付款成功') this.$message.success('付款成功')
@@ -386,7 +387,6 @@ export default {
this.$message.error('付款失败') this.$message.error('付款失败')
} }
}) })
// })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',

View File

@@ -329,12 +329,12 @@
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="calculatingPrice">计算价格</el-button> <el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="calculatingPrice">计算价格</el-button>
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="confirmPrice">确定价格</el-button> <el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="confirmPrice">确定价格</el-button>
<el-button type="success" size="mini" icon="el-icon-success" style="margin-left:10px;margin-top: 15px" @click="Deal">成交</el-button> <el-button type="success" size="mini" icon="el-icon-success" style="margin-left:10px;margin-top: 15px" @click="Deal">成交</el-button>
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;margin-top: 15px" @click="downLoadCjn('cjn')">导出外协加工任务单</el-button> <el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;margin-top: 15px" @click="downLoadRWD('RWD')">导出外协加工任务单</el-button>
</div> </div>
</el-card> </el-card>
<el-card v-show="card"> <el-card v-show="card">
<table id="cjn" cellspacing="0px" align="center" width="100%" style=""> <table id="RWD" cellspacing="0px" align="center" width="100%" style="">
<tbody id="1"> <tbody id="1">
<tr> <tr>
<td colspan="4" style="text-align: left;font-size: 30px;font-weight: bold">GAOJING</td> <td colspan="4" style="text-align: left;font-size: 30px;font-weight: bold">GAOJING</td>
@@ -717,7 +717,7 @@ export default {
} }
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费 this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计) this.大写金额 = convertCurrency(this.总计)
// cjn end // RWD end
if (response.data.length === 0) { if (response.data.length === 0) {
this.loading = false this.loading = false
} }
@@ -1016,7 +1016,7 @@ export default {
if (response.data.length === 0) { if (response.data.length === 0) {
this.loading = false this.loading = false
} }
// cjn end // RWD end
if (response.data.length === 0) { if (response.data.length === 0) {
this.loading = false this.loading = false
} }
@@ -1140,7 +1140,7 @@ export default {
} }
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费 this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计) this.大写金额 = convertCurrency(this.总计)
// cjn end // RWD end
if (response.data.length === 0) { if (response.data.length === 0) {
this.loading = false this.loading = false
} }
@@ -1533,7 +1533,7 @@ export default {
this.$message.warning('请选择订单') this.$message.warning('请选择订单')
} }
}, },
downLoadCjn(tableid) { downLoadRWD(tableid) {
if (this.List3.length === 0) { if (this.List3.length === 0) {
this.$message.warning('暂无数据') this.$message.warning('暂无数据')
} else { } else {

View File

@@ -20,18 +20,18 @@
<el-card> <el-card>
<el-table v-loading="loading2" :data="List" highlight-current-row height="350" border @row-click="searchProcess" > <el-table v-loading="loading2" :data="List" highlight-current-row height="350" border @row-click="searchProcess" >
<el-table-column label="付款状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.实际付款时间!==''" type="success" size="small" style="margin: 0px">已付款</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未付款</el-tag>
</template>
</el-table-column>
<el-table-column label="收货状态" width="100" align="center"> <el-table-column label="收货状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.单据状态==='作废'" type="success" size="small" style="margin: 0px">已收货</el-tag> <el-tag v-if="scope.row.单据状态==='作废'" type="success" size="small" style="margin: 0px">已收货</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未收货</el-tag> <el-tag v-else type="info" size="small" style="margin: 0px">未收货</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.实际付款时间!==''" type="success" size="small" style="margin: 0px">已付款</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未付款</el-tag>
</template>
</el-table-column>
<el-table-column label="表单号" align="center" min-width="200px"> <el-table-column label="表单号" align="center" min-width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.表单号 }} {{ scope.row.表单号 }}

View File

@@ -54,7 +54,7 @@
<el-card> <el-card>
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 300px;" height="300px" size="mini"> <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"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供应商名称 }} {{ scope.row.供应商名称 }}
</template> </template>
@@ -64,12 +64,12 @@
{{ scope.row.请款时间 }} {{ scope.row.请款时间 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款人" align="center" min-width="150"> <el-table-column label="请款人" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="150" prop="请款金额"> <el-table-column label="请款金额" align="center" min-width="100" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ scope.row.请款金额 }}
</template> </template>
@@ -164,7 +164,7 @@ export default {
this.searchTable1() this.searchTable1()
}, },
searchTable2() { searchTable2() {
initApprovalOffline(this.pageCurrent2, this.pageSize2, 2).then(response => { initApprovalOffline(this.pageCurrent2, this.pageSize2, 1).then(response => {
console.log(response.data.rows) console.log(response.data.rows)
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
this.total2 = response.data.total this.total2 = response.data.total
@@ -227,7 +227,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 2).then(response => { execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 1).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('执行成功') this.$message.success('执行成功')
this.searchTable2() this.searchTable2()
@@ -245,7 +245,7 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消' cancelButtonText: '取消'
}).then(({ value }) => { }).then(({ value }) => {
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 2).then(response => { execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 1).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('执行成功') this.$message.success('执行成功')
this.searchTable2() this.searchTable2()

View File

@@ -54,7 +54,7 @@
<el-card> <el-card>
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 300px;" height="300px" size="mini"> <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"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供应商名称 }} {{ scope.row.供应商名称 }}
</template> </template>
@@ -64,12 +64,12 @@
{{ scope.row.请款时间 }} {{ scope.row.请款时间 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款人" align="center" min-width="150"> <el-table-column label="请款人" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="150" prop="请款金额"> <el-table-column label="请款金额" align="center" min-width="100" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ scope.row.请款金额 }}
</template> </template>
@@ -163,7 +163,7 @@ export default {
this.searchTable1() this.searchTable1()
}, },
searchTable2() { searchTable2() {
initApprovalOffline(this.pageCurrent2, this.pageSize2, 3).then(response => { initApprovalOffline(this.pageCurrent2, this.pageSize2, 2).then(response => {
console.log(response.data.rows) console.log(response.data.rows)
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
this.total2 = response.data.total this.total2 = response.data.total
@@ -227,7 +227,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 3).then(response => { execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 2).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('执行成功') this.$message.success('执行成功')
this.searchTable2() this.searchTable2()
@@ -245,7 +245,7 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消' cancelButtonText: '取消'
}).then(({ value }) => { }).then(({ value }) => {
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 3).then(response => { execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 2).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('执行成功') this.$message.success('执行成功')
this.searchTable2() this.searchTable2()

View File

@@ -1,148 +1,148 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<span>物料名称:</span> <div slot="header">
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/> <span>物料名称:</span>
<span>库存状态:</span> <el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<el-select v-model="inventoryStateValue" placeholder="库存状态" size="small" clearable> <span>库存状态:</span>
<el-option <el-select v-model="inventoryStateValue" placeholder="库存状态" size="small" clearable>
v-for="item in inventoryState" <el-option
:key="item.value" v-for="item in inventoryState"
:label="item.label" :key="item.value"
:value="item.value"/> :label="item.label"
</el-select> :value="item.value"/>
<span>采购状态:</span> </el-select>
<el-select v-model="purchaseStateValue" placeholder="库存状态" size="small"> <span>采购状态:</span>
<el-option <el-select v-model="purchaseStateValue" placeholder="库存状态" size="small">
v-for="item in purchaseState" <el-option
:key="item.value" v-for="item in purchaseState"
:label="item.label" :key="item.value"
:value="item.value"/> :label="item.label"
</el-select> :value="item.value"/>
<el-button </el-select>
type="success" <el-button
size="small" type="success"
icon="el-icon-search" size="small"
style="margin-left: 10px" icon="el-icon-search"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button> style="margin-left: 10px"
</el-card> @click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
<el-button style="float: right; padding: 10px" type="text" @click="showMaterialTable=!showMaterialTable">{{ showMaterialTable ? '收起' : '展开' }}</el-button>
<el-card> </div>
<el-table <div v-show="showMaterialTable">
v-loading="loading1" <el-table
:data="tableData1" v-loading="loading1"
border :data="tableData1"
style="width: 100%;max-height: 300px;" border
height="300px" style="width: 100%;max-height: 460px;"
size="mini" height="460"
@selection-change="handleSelectionChange"> size="mini"
<el-table-column type="selection" align="center" width="55"/> @selection-change="handleSelectionChange">
<el-table-column label="库存状态" width="100" align="center"> <el-table-column type="selection" align="center" width="55"/>
<template slot-scope="scope"> <el-table-column label="库存状态" width="100" align="center">
<el-tag v-if="parseInt(scope.row.库存是否不足)===1" type="danger" size="small">不足</el-tag> <template slot-scope="scope">
<el-tag v-else type="success" size="small"></el-tag> <el-tag v-if="parseInt(scope.row.库存是否不足)===1" type="danger" size="small"></el-tag>
</template> <el-tag v-else type="success" size="small">充足</el-tag>
</el-table-column>
<el-table-column label="物料名称" min-width="200" align="center">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料型号" min-width="200" align="center">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="物料规格" min-width="200" align="center">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="供货商" min-width="200" align="center">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column label="当前库存量" min-width="200" align="center">
<template slot-scope="scope">
{{ scope.row.当前库存量 }}
</template>
</el-table-column>
<el-table-column label="安全库存量" min-width="200" align="center">
<template slot-scope="scope">
<template v-if="scope.row.changeSafeValue">
<el-input v-model="scope.row.安全库存量" class="edit-input" size="mini"/>
<el-button class="cancel-btn" size="mini" icon="el-icon-refresh" type="warning" @click="cancelEdit(scope.row)">取消</el-button>
</template> </template>
<span v-else>{{ scope.row.安全库存量 }}</span> </el-table-column>
</template> <el-table-column label="物料名称" min-width="150" align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column label="设置" min-width="100" align="center"> {{ scope.row.物料名称 }}
<template slot-scope="scope"> </template>
<el-button v-if="scope.row.changeSafeValue" type="mini" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button> </el-table-column>
<el-button <el-table-column label="物料型号" min-width="150" align="center">
v-else <template slot-scope="scope">
type="primary" {{ scope.row.物料型号 }}
size="mini" </template>
icon="el-icon-edit" </el-table-column>
@click="scope.row.changeSafeValue=!scope.row.changeSafeValue">设置</el-button> <el-table-column label="物料规格" min-width="150" align="center">
</template> <template slot-scope="scope">
</el-table-column> {{ scope.row.物料规格 }}
</el-table> </template>
<div class="block" style="margin-top: 10px;"> </el-table-column>
<el-pagination <el-table-column label="供货商" min-width="150" align="center">
:current-page="pageCurrent1" <template slot-scope="scope">
:page-sizes="[10, 20, 30, 40]" {{ scope.row.供货商 }}
:page-size="pageSize1" </template>
:total="total1" </el-table-column>
style="display:inline-block;width:50%" <el-table-column label="当前库存量" min-width="90" align="center">
layout="total, sizes, prev, pager, next, jumper" <template slot-scope="scope">
@size-change="handleSizeChange1" {{ scope.row.当前库存量 }}
@current-change="handleCurrentChange1"/> </template>
</el-table-column>
<el-table-column label="安全库存量" min-width="200" align="center">
<template slot-scope="scope">
<template v-if="scope.row.changeSafeValue">
<el-input v-model="scope.row.安全库存量" class="edit-input" size="mini"/>
<el-button class="cancel-btn" size="mini" icon="el-icon-refresh" type="warning" @click="cancelEdit(scope.row)">取消</el-button>
</template>
<span v-else>{{ scope.row.安全库存量 }}</span>
</template>
</el-table-column>
<el-table-column label="设置" min-width="100" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.changeSafeValue" type="mini" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button
v-else
type="primary"
size="mini"
icon="el-icon-edit"
@click="scope.row.changeSafeValue=!scope.row.changeSafeValue">设置</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>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
<span>离线合同号:</span> <div slot="header">
<el-input v-model="offlineContract" placeholder="离线合同号" size="small" clearable/> <span>离线合同号:</span>
<span>供应商:</span> <el-input v-model="offlineContract" placeholder="离线合同号" size="small" clearable/>
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/> <span>供应商:</span>
<el-button <el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
type="success" <el-button
size="small" type="success"
icon="el-icon-search" size="small"
style="margin-left: 10px" icon="el-icon-search"
@click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button> style="margin-left: 10px"
<el-button @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
type="primary" <el-button
size="small" type="primary"
icon="el-icon-plus" size="small"
style="margin-left: 10px" icon="el-icon-plus"
@click="addOfflineContract">创建离线合同</el-button> style="margin-left: 10px"
<el-button @click="addOfflineContract">创建离线合同</el-button>
type="primary" <el-button
size="small" type="primary"
icon="el-icon-download" size="small"
style="margin-left: 10px" icon="el-icon-download"
@click="addMateriel">选入物料</el-button> style="margin-left: 10px"
</el-card> @click="addMateriel">选入物料</el-button>
</div>
<el-card> <el-table v-loading="" :data="tableData2" border style="max-height: 460px;" height="460px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table v-loading="" :data="tableData2" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="合同状态" align="center" width="80" fixed="left"> <el-table-column label="合同状态" align="center" width="80" fixed="left">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.离线合同状态)===1" type="warning" size="small">编辑中</el-tag> <el-tag v-if="Number(scope.row.离线合同状态)===1" type="warning" size="small">编辑中</el-tag>
<el-tag v-if="parseInt(scope.row.离线合同状态)===2" type="primary" size="small">采购</el-tag> <el-tag v-if="Number(scope.row.离线合同状态)===2" type="success" size="small">采购</el-tag>
<el-tag v-if="parseInt(scope.row.离线合同状态)===4" type="success" size="small">到货</el-tag> <el-tag v-if="Number(scope.row.离线合同状态)===5" type="danger" size="small">作废</el-tag>
<el-tag v-if="parseInt(scope.row.离线合同状态)===5" type="info" size="small">已作废</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="离线合同编号" align="center" min-width="150"> <el-table-column label="离线合同编号" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.离线合同编号 }} {{ scope.row.离线合同编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="离线合同名称" align="center" min-width="150"> <el-table-column label="离线合同名称" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.离线合同名称 }} {{ scope.row.离线合同名称 }}
</template> </template>
@@ -157,41 +157,26 @@
{{ scope.row.采购员 }} {{ scope.row.采购员 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建日期" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.创建日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" align="center" width="100"> <el-table-column label="规定到货时间" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.规定到货时间.split(' ')[0] }} {{ scope.row.规定到货时间.split(' ')[0] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款方式" align="center" width="100"> <el-table-column label="离线合同备注" align="center" min-width="250">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.付款方式内容 }} {{ scope.row.离线合同备注 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="第一次付款时间" align="center" min-width="150"> <el-table-column label="操作" align="center" width="200" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.第一次付款时间节点 }} <el-button :disabled="parseInt(scope.row.离线合同状态)!==1" type="primary" size="mini" icon="el-icon-edit" @click="editOfflineContract(scope.row)"/>
</template> <el-button :disabled="parseInt(scope.row.离线合同状态)!==1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)"/>
</el-table-column> <el-button type="warning" size="mini" icon="el-icon-download"/>
<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" width="280" fixed="right">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.离线合同状态)!==1" type="primary" size="mini" icon="el-icon-edit" @click="editOfflineContract(scope.row)">编辑</el-button>
<el-button :disabled="parseInt(scope.row.离线合同状态)!==1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)">作废</el-button>
<el-button type="warning" size="mini" icon="el-icon-download">导出</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -205,6 +190,7 @@
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2" @size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/> @current-change="handleCurrentChange2"/>
<el-button :disabled="disable" type="success" size="mini" style="float:right" icon="el-icon-circle-check-outline" @click="doneOfflineContact">生成离线合同</el-button>
</div> </div>
<el-table v-loading="" :data="tableData3" :summary-method="getSummaries" border style="max-height: 300px;" height="300px" size="mini" show-summary> <el-table v-loading="" :data="tableData3" :summary-method="getSummaries" border style="max-height: 300px;" height="300px" size="mini" show-summary>
<el-table-column label="离线合同编号" align="center" min-width="150"> <el-table-column label="离线合同编号" align="center" min-width="150">
@@ -247,6 +233,11 @@
{{ parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0) }} {{ parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="disable" 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"> <el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)">移除</el-button> <el-button :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)">移除</el-button>
@@ -255,26 +246,6 @@
</el-table> </el-table>
</el-card> </el-card>
<el-card>
<el-table
:data="tableData4"
:show-header="false"
:highlight-current-row="!disable"
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" :readonly="disable" type="textarea" style="width:calc(99% - 250px);float:right;margin-bottom: 20px" resize="none"/>
<el-button :disabled="disable" type="success" size="mini" icon="el-icon-circle-check-outline" @click="doneOfflineContact">生成离线合同</el-button>
</el-card>
<el-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px"> <el-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px">
<el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm"> <el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm">
<el-row> <el-row>
@@ -386,8 +357,8 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<el-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="800px"> <el-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="750px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="120px"> <el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="120px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="离线合同编号" prop="离线合同编号"> <el-form-item label="离线合同编号" prop="离线合同编号">
@@ -422,67 +393,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运费" prop="运费"> <el-form-item label="离线合同备注" prop="离线合同备注">
<el-input v-model="form2.运费" size="small"/> <el-input v-model="form2.离线合同备注" size="small" type="textarea" style="width: 550px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="付款方式" prop="付款方式">
<el-select v-model="form2.付款方式" 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="12">
<el-form-item label="第一次付款时间" prop="第一次付款时间">
<el-select v-model="form2.第一次付款时间" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="第二次付款时间" prop="第二次付款时间">
<el-select v-model="form2.第二次付款时间" :disabled="disable2" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="第三次付款时间" prop="第三次付款时间">
<el-select v-model="form2.第三次付款时间" :disabled="disable3" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="第四次付款时间" prop="第四次付款时间">
<el-select v-model="form2.第四次付款时间" :disabled="disable4" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -506,14 +418,15 @@
</template> </template>
<script> <script>
import { searchInventoryNum, searchOfflineContract, searchOfflineContract2, searchSupplier, initPayMethod, initPayTimeNode, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel, import { searchInventoryNum, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel,
addMateriel, deleteMateriel, doneOfflineContact, searchContractDemo, setSafeValue } from '@/api/PurchasingCenter/OfflineContract' addMateriel, deleteMateriel, doneOfflineContact, setSafeValue } from '@/api/PurchasingCenter/OfflineContract'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: '', // 离线合同 name: '', // 离线合同
data() { data() {
return { return {
showMaterialTable: true,
loading1: false, loading1: false,
title2: '', title2: '',
purchaseStateValue: 2, // 采购状态 全部 purchaseStateValue: 2, // 采购状态 全部
@@ -550,7 +463,6 @@ export default {
offlineContract: '', // 离线合同号 offlineContract: '', // 离线合同号
supplierName0: '', // 供应商名称(外面的) supplierName0: '', // 供应商名称(外面的)
supplierName: '', // 供应商名称 supplierName: '', // 供应商名称
payMethod: [], // 付款方式
payTime: [], // 付款时间节点 payTime: [], // 付款时间节点
tableData2: [], tableData2: [],
total2: 0, total2: 0,
@@ -591,12 +503,7 @@ export default {
供应商流水号: '', 供应商流水号: '',
供应商名称: '', 供应商名称: '',
规定到货时间: '', 规定到货时间: '',
运费: '', 离线合同备注: '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
付款方式: '',
第一次付款时间: 1,
第二次付款时间: 1,
第三次付款时间: 1,
第四次付款时间: 1
}, },
rules2: { // 离线合同表单验证规则 rules2: { // 离线合同表单验证规则
离线合同编号: [{ required: true, message: '请填写离线合同编号' }], 离线合同编号: [{ required: true, message: '请填写离线合同编号' }],
@@ -607,7 +514,6 @@ export default {
付款方式: [{ required: true, message: '请选择付款方式' }] 付款方式: [{ required: true, message: '请选择付款方式' }]
}, },
tableData3: [], tableData3: [],
textArea: '请选择',
materielGroup: [], // 物料流水号组 materielGroup: [], // 物料流水号组
partGroup: [], // 离线合同明细流水号组 partGroup: [], // 离线合同明细流水号组
numGroup: [], // 数量组 numGroup: [], // 数量组
@@ -615,11 +521,8 @@ export default {
totalPrice: 0, // 合同总额 totalPrice: 0, // 合同总额
tableData4: [], // 合同模板 tableData4: [], // 合同模板
stipulateArrivalTime: '', // 规定到货时间 stipulateArrivalTime: '', // 规定到货时间
payMethodName: '', // 付款方式名称 离线合同状态: '',
paramRow: '', // 参数row paramRow: '', // 参数row
disable2: true,
disable3: true,
disable4: true,
disable: true // 其他的禁用 disable: true // 其他的禁用
} }
}, },
@@ -633,29 +536,11 @@ export default {
}, },
created() { created() {
this.fetchData() this.fetchData()
this.searchTable1()
this.searchTable2()
}, },
methods: { methods: {
fetchData() { fetchData() {},
initPayMethod().then(response => { // 初始化付款方式
for (let i = 0; i < response.data.length; i++) {
this.payMethod.push({
label: response.data[i].付款方式内容,
value: response.data[i].付款方式流水号
})
}
})
initPayTimeNode().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.payTime.push({
label: response.data[i].付款时间节点名称,
value: response.data[i].付款时间节点流水号
})
}
})
searchContractDemo().then(response => { // 初始化合同模板
this.tableData4 = response.data
})
},
searchTable1() { // 查询物料库物料 searchTable1() { // 查询物料库物料
this.loading1 = true this.loading1 = true
this.materialName ? this.check1 = 1 : this.check1 = 0 this.materialName ? this.check1 = 1 : this.check1 = 0
@@ -729,14 +614,36 @@ export default {
this.form2.供应商流水号 = '' this.form2.供应商流水号 = ''
this.form2.供应商名称 = '' this.form2.供应商名称 = ''
this.form2.规定到货时间 = '' this.form2.规定到货时间 = ''
this.form2.运费 = '' this.form2.离线合同备注 = '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
this.form2.付款方式 = ''
this.form2.第一次付款时间 = 1
this.form2.第二次付款时间 = 0
this.form2.第三次付款时间 = 0
this.form2.第四次付款时间 = 0
this.dialogVisible2 = true this.dialogVisible2 = true
}, },
submitAddOfflineContract() { // 新建离线合同
this.$refs['form2'].validate((valid) => {
if (valid) {
const numGroup1 = [] // 空数组,放现有的询价单号
searchOfflineContract2().then(response => { // 先查询判断是否存在
for (let i = 0; i < response.data.length; i++) {
numGroup1.push(response.data[i].离线合同编号)
}
}).then(() => {
if (numGroup1.indexOf(this.form2.离线合同编号) !== -1) {
this.$message.error('该离线合同编号已存在')
} else {
addOfflineContract(this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.离线合同备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新建离线合同成功')
this.searchTable2()
this.dialogVisible2 = false
} else { this.$message.error('新建离线合同失败') }
})
}
})
} else {
console.log('error submit!!')
return false
}
})
},
editOfflineContract(row) { editOfflineContract(row) {
console.log(row) console.log(row)
if (this.$refs['form2'] !== undefined) { if (this.$refs['form2'] !== undefined) {
@@ -749,21 +656,12 @@ export default {
this.form2.供应商流水号 = row.供应商流水号 this.form2.供应商流水号 = row.供应商流水号
this.form2.供应商名称 = row.供应商名称 this.form2.供应商名称 = row.供应商名称
this.form2.规定到货时间 = row.规定到货时间 this.form2.规定到货时间 = row.规定到货时间
this.form2.运费 = row.运费 this.form2.离线合同备注 = row.离线合同备注
this.form2.付款方式 = parseInt(row.付款方式流水号)
this.form2.第一次付款时间 = parseInt(row.第一次付款时间节点流水号)
this.form2.第二次付款时间 = parseInt(row.第二次付款时间节点流水号)
this.form2.第三次付款时间 = parseInt(row.第三次付款时间节点流水号)
this.form2.第四次付款时间 = parseInt(row.第四次付款时间节点流水号)
this.payMethodChange()
this.dialogVisible2 = true this.dialogVisible2 = true
}, },
submitEditOfflineContract() { submitEditOfflineContract() {
this.$refs['form2'].validate((valid) => { this.$refs['form2'].validate((valid) => {
if (valid) { if (valid) {
this.disable2 ? this.form2.第二次付款时间 = 0 : this.form2.第二次付款时间
this.disable3 ? this.form2.第三次付款时间 = 0 : this.form2.第三次付款时间
this.disable4 ? this.form2.第四次付款时间 = 0 : this.form2.第四次付款时间
const numGroup1 = [] // 空数组,放现有的离线合同号 const numGroup1 = [] // 空数组,放现有的离线合同号
const numGroup2 = [] // 空数组,放现有的离线合同流水号 const numGroup2 = [] // 空数组,放现有的离线合同流水号
searchOfflineContract2().then(response => { // 先查询判断是否存在 searchOfflineContract2().then(response => { // 先查询判断是否存在
@@ -775,7 +673,7 @@ export default {
if (numGroup1.indexOf(this.form2.离线合同编号) !== -1 && numGroup1.indexOf(this.form2.离线合同编号) !== numGroup2.indexOf(parseInt(this.form2.离线合同流水号))) { if (numGroup1.indexOf(this.form2.离线合同编号) !== -1 && numGroup1.indexOf(this.form2.离线合同编号) !== numGroup2.indexOf(parseInt(this.form2.离线合同流水号))) {
this.$message.error('该离线合同编号已存在') this.$message.error('该离线合同编号已存在')
} else { } else {
editOfflineContract(this.form2.离线合同流水号, this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.运费, this.form2.付款方式, this.form2.第一次付款时间, this.form2.第二次付款时间, this.form2.第三次付款时间, this.form2.第四次付款时间).then(response => { editOfflineContract(this.form2.离线合同流水号, this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.离线合同备注).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('修改离线合同成功') this.$message.success('修改离线合同成功')
this.searchTable2() this.searchTable2()
@@ -812,36 +710,6 @@ export default {
}) })
}) })
}, },
submitAddOfflineContract() { // 新建离线合同
this.$refs['form2'].validate((valid) => {
if (valid) {
this.disable2 ? this.form2.第二次付款时间 = 0 : this.form2.第二次付款时间
this.disable3 ? this.form2.第三次付款时间 = 0 : this.form2.第三次付款时间
this.disable4 ? this.form2.第四次付款时间 = 0 : this.form2.第四次付款时间
const numGroup1 = [] // 空数组,放现有的询价单号
searchOfflineContract2().then(response => { // 先查询判断是否存在
for (let i = 0; i < response.data.length; i++) {
numGroup1.push(response.data[i].离线合同编号)
}
}).then(() => {
if (numGroup1.indexOf(this.form2.离线合同编号) !== -1) {
this.$message.error('该离线合同编号已存在')
} else {
addOfflineContract(this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.运费, this.form2.付款方式, this.form2.第一次付款时间, this.form2.第二次付款时间, this.form2.第三次付款时间, this.form2.第四次付款时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新建离线合同成功')
this.searchTable2()
this.dialogVisible2 = false
} else { this.$message.error('新建离线合同失败') }
})
}
})
} else {
console.log('error submit!!')
return false
}
})
},
searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据 searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据
this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '') this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '')
this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '') this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '')
@@ -896,17 +764,12 @@ export default {
}, },
searchTable3(row) { // 查询离线合同明细 searchTable3(row) { // 查询离线合同明细
this.stipulateArrivalTime = row.规定到货时间.split(' ')[0] this.stipulateArrivalTime = row.规定到货时间.split(' ')[0]
this.payMethodName = row.付款方式内容
this.offlineContractNum = row.离线合同流水号 this.offlineContractNum = row.离线合同流水号
this.离线合同状态 = row.离线合同状态
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
}) })
this.textArea = row.合同文本 Number(row.离线合同状态) !== 1 ? this.disable = true : this.disable = false // 是否为编辑模式
if (parseInt(row.离线合同状态) !== 1) { // 是否未编辑模式
this.disable = true
} else {
this.disable = false
}
}, },
getSummaries(param) { // 合计 getSummaries(param) { // 合计
const { columns, data } = param const { columns, data } = param
@@ -934,14 +797,22 @@ export default {
return sums return sums
}, },
addMateriel() { // 将物料选入离线合同 addMateriel() { // 将物料选入离线合同
addMateriel(this.offlineContractNum, this.materielGroup).then(response => { if (!this.offlineContractNum) {
if (response.data[0].result === '1') { this.$message.warning('请选择离线合同')
this.$message.success('选入成功') } else if (Number(this.离线合同状态) !== 1) {
searchMateriel(this.offlineContractNum).then(response => { this.$message.warning('请选择可编辑的离线合同')
this.tableData3 = response.data } else if (this.materielGroup.length === 0) {
}) this.$message.warning('请勾选物料')
} else { this.$message.error('选入失败') } } else {
}) addMateriel(this.offlineContractNum, this.materielGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('选入失败') }
})
}
}, },
deleteMateriel(row) { // 移除物料 deleteMateriel(row) { // 移除物料
this.$confirm('确定移除该物料?', '提示', { this.$confirm('确定移除该物料?', '提示', {
@@ -980,12 +851,13 @@ export default {
this.numGroup.push(this.tableData3[i].数量) this.numGroup.push(this.tableData3[i].数量)
this.priceGroup.push(this.tableData3[i].单价) this.priceGroup.push(this.tableData3[i].单价)
} }
doneOfflineContact(this.offlineContractNum, this.totalPrice, this.textArea, this.partGroup, this.numGroup, this.priceGroup).then(response => { doneOfflineContact(this.offlineContractNum, this.totalPrice, this.partGroup, this.numGroup, this.priceGroup).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('离线合同生成成功') this.$message.success('离线合同生成成功')
this.searchTable2() this.searchTable2()
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
this.disable = true // 是否为编辑模式
}) })
} else { this.$message.error('离线合同生成失败') } } else { this.$message.error('离线合同生成失败') }
}) })
@@ -995,49 +867,6 @@ export default {
message: '已取消操作' message: '已取消操作'
}) })
}) })
},
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
if (!this.disable) {
searchContractDemo(this.paramRow.合同模板流水号).then(response => {
this.textArea = response.data[0].合同模板内容.replace('stipulateArrivalTime', this.stipulateArrivalTime).replace('payMethodName', this.payMethodName)
})
}
},
payMethodChange() { // 付款方式改变
for (let i = 0; i < this.payMethod.length; i++) {
if (this.payMethod[i].value === this.form2.付款方式) {
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
break
case 2:
this.disable2 = false
this.disable3 = true
this.disable4 = true
break
case 3:
this.disable2 = false
this.disable3 = false
this.disable4 = true
break
case 4:
this.disable2 = false
this.disable3 = false
this.disable4 = false
break
}
} }
} }
} }

View File

@@ -35,45 +35,39 @@
{{ scope.row.请款时间 }} {{ scope.row.请款时间 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款人" align="center" min-width="100"> <el-table-column label="请款人" align="center" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额"> <el-table-column label="请款金额" align="center" min-width="90" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ scope.row.请款金额 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款付款情况" align="center"> <el-table-column label="请款付款情况" align="center">
<el-table-column label="审核情况内容" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.审核情况内容 }}
</template>
</el-table-column>
<el-table-column label="未通过审核原因" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审核原因 }}
</template>
</el-table-column>
<el-table-column label="审批情况内容" width="100" align="center"> <el-table-column label="审批情况内容" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.审批情况内容 }} <el-tag v-if="Number(scope.row.审批情况流水号)===3" type="primary" size="small">未审批</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===1" type="success" size="small">已通过</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===2" type="danger" size="small">不通过</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="未通过审批原因" width="110" align="center"> <el-table-column label="未通过审批原因" width="110" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.未通过审批原因 }} {{ scope.row.未通过审批原因 === '通过' ? '—' : scope.row.未通过审批原因 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款情况" width="100" align="center"> <el-table-column label="付款情况" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.付款情况内容 }} <el-tag v-if="Number(scope.row.付款情况流水号)===3" type="primary" size="small">未操作</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===1" type="success" size="small">已同意</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===2" type="danger" size="small">不同意</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="未付款原因" width="100" align="center"> <el-table-column label="未付款原因" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.未付款原因 }} {{ scope.row.未付款原因 === '通过' ? '—' : scope.row.未付款原因 }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@@ -93,9 +87,9 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-left: 10px" @click="searchTable02(scope.row)">查看详情</el-button> <el-button slot="reference" type="success" size="mini" icon="el-icon-search" @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover> </el-popover>
<el-button :disabled="parseInt(scope.row.审情况流水号)===1" type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px" @click="cancelRequestFund(scope.row)">取消请款</el-button> <el-button :disabled="Number(scope.row.审情况流水号)!==3" type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px" @click="cancelRequestFund(scope.row)">取消请款</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -233,6 +227,7 @@ export default {
}, },
created() { created() {
this.fetchData() this.fetchData()
this.searchTable1()
}, },
methods: { methods: {
fetchData() { fetchData() {

View File

@@ -25,19 +25,19 @@
{{ scope.row.项目名称 }} {{ scope.row.项目名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料名称" align="center" min-width="100"> <el-table-column label="图号" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料名称 }} {{ scope.row.图号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料型号" align="center" min-width="100"> <el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料型号 }} {{ scope.row.名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料规格" align="center" min-width="100"> <el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料规格 }} {{ scope.row.规格 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" min-width="100"> <el-table-column label="数量" align="center" min-width="100">
@@ -50,9 +50,14 @@
{{ scope.row.单价 }} {{ scope.row.单价 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="小计(元)" align="center" min-width="100" prop="金额"> <el-table-column label="优惠后单价" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.金额 }} {{ scope.row.优惠后单价 }}
</template>
</el-table-column>
<el-table-column label="优惠后小计(元)" align="center" min-width="100" prop="金额">
<template slot-scope="scope">
{{ scope.row.金额 = Number(scope.row.优惠后单价) * Number(scope.row.数量) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@@ -1,5 +1,68 @@
<template> <template>
<div class="app-container"> <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=""
style="width:300px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="searchTable0()">查询</el-button>
</el-card>
<el-card>
<el-table :data="tableData0" size="mini" border style="max-height: 250px;" height="250px" highlight-current-row @row-click="searchContract">
<el-table-column label="计划状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="timeToStamp(scope.row.计划付款日期) <= getDate" type="danger" size="small">已拖期</el-tag>
<el-tag v-if="timeToStamp(scope.row.计划付款日期) > getDate" type="success" size="small">未拖期</el-tag>
</template>
</el-table-column>
<el-table-column label="计划付款日期" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款日期.split(' ')[0] }}
</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="采购合同编号" 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="供应商" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-card> <el-card>
<span>合同号:</span> <span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable> <el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
@@ -85,7 +148,9 @@
</el-table-column> </el-table-column>
<el-table-column label="审批情况" width="80" align="center"> <el-table-column label="审批情况" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.审批情况内容 }} <el-tag v-if="Number(scope.row.审批情况流水号)===3" type="primary" size="small">未审批</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===1" type="success" size="small">已通过</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===2" type="danger" size="small">不通过</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="未通过审批原因" width="110" align="center"> <el-table-column label="未通过审批原因" width="110" align="center">
@@ -95,7 +160,9 @@
</el-table-column> </el-table-column>
<el-table-column label="付款情况" width="80" align="center"> <el-table-column label="付款情况" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.付款情况内容 }} <el-tag v-if="Number(scope.row.付款情况流水号)===3" type="primary" size="small">未操作</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===1" type="success" size="small">已同意</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===2" type="danger" size="small">不同意</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="未付款原因" width="110" align="center"> <el-table-column label="未付款原因" width="110" align="center">
@@ -124,12 +191,60 @@
</template> </template>
<script> <script>
import { initContract, searchTable1, searchCondition, requestFund, cancelRequestFund, searchContract } from '@/api/PurchasingCenter/PurchaseContractRequestFund' import { searchTable0, initContract, searchTable1, searchCondition, requestFund, cancelRequestFund, searchContract } from '@/api/PurchasingCenter/PurchaseContractRequestFund'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getNowTime, timeToStamp } from '@/utils/tool'
export default { export default {
data() { data() {
return { return {
getDate: null,
tableData0: [],
check: 0,
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])
}
}, {
text: '未来两个月',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 2)
picker.$emit('pick', [start, end])
}
}, {
text: '未来三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 3)
picker.$emit('pick', [start, end])
}
}, {
text: '未来半年',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 6)
picker.$emit('pick', [start, end])
}
}]
},
dateRange: '',
tableData11: [], tableData11: [],
total1: 0, total1: 0,
pageCurrent1: 1, pageCurrent1: 1,
@@ -154,8 +269,18 @@ export default {
created() { created() {
this.fetchData() this.fetchData()
this.searchTable1() this.searchTable1()
this.searchTable0()
}, },
methods: { methods: {
timeToStamp(param) { // 转时间戳
return timeToStamp(param)
},
searchTable0() { // 查询付款计划
this.dateRange ? this.check = 1 : (this.check = 0, this.dateRange = '')
searchTable0(this.check, this.dateRange[0], this.dateRange[1]).then(response => {
this.tableData0 = response.data
})
},
fetchData() { fetchData() {
initContract().then(response => { initContract().then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
@@ -167,6 +292,7 @@ export default {
}) })
}, },
searchTable1() { // 查询 searchTable1() { // 查询
this.getDate = timeToStamp(getNowTime()) // 获取当前时间
this.tableData1 = [] this.tableData1 = []
this.returns = '' this.returns = ''
this.contractNumValue ? this.check1 = 1 : this.check1 = 0 this.contractNumValue ? this.check1 = 1 : this.check1 = 0
@@ -245,11 +371,14 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-tag{
margin: 0
}
.el-card{ .el-card{
margin-bottom: 15px; margin-bottom: 15px;
} }
.el-date-editor{ .el-date-editor{
width:150px!important; width:150px;
} }
.el-select{ .el-select{
width:200px width:200px

View File

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

View File

@@ -1,25 +1,25 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<span>项目名称:</span> <span>供应商名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable> <el-select v-model="supplierNumValue" placeholder="供应商" size="small" filterable clearable @change="searchContract1">
<el-option <el-option
v-for="item in project" v-for="item in supplierNum"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<span>采购合同号:</span> <!--<span>采购合同号:</span>-->
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable> <!--<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>-->
<el-option <!--<el-option-->
v-for="item in contractNum" <!--v-for="item in contractNums"-->
:key="item.value" <!--:key="item.value"-->
:label="item.label" <!--:label="item.label"-->
:value="item.value"> <!--:value="item.value">-->
<div style="float: left">{{ item.label }}</div> <!--<div style="float: left">{{ item.label }}</div>-->
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div> <!--<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
<el-button <el-button
type="success" type="success"
size="small" size="small"
@@ -27,6 +27,7 @@
style="margin-left: 10px" style="margin-left: 10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button> @click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
<el-button <el-button
:disabled="office"
type="primary" type="primary"
size="small" size="small"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@@ -35,28 +36,43 @@
</el-card> </el-card>
<el-card> <el-card>
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 400px" height="400px" stripe border @row-click="searchPic"> <el-table v-loading="" :data="tableData1" show-summary size="mini" style="max-height: 400px" height="400px" stripe border highlight-current-row @row-click="searchPic">
<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="150px"> <el-table-column align="center" label="供应商" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供应商名称 }} {{ scope.row.供应商名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="项目名称" min-width="100px"> <el-table-column align="center" label="关联合同" min-width="80px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.项目名称 ? scope.row.项目名称 : '—' }} <el-popover placement="right" width="400" trigger="click">
<el-table :data="tableData01" stripe size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="100" align="center" label="合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="合同名称">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同名称 : scope.row.离线合同名称 }}
</template>
</el-table-column>
<el-table-column prop="合同总额" min-width="80" align="center" label="合同总额">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.合同总额 = scope.row.采购合同总额 : scope.row.合同总额 = scope.row.离线合同总额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" plain type="success" size="mini" icon="el-icon-search" @click="invoiceDetail(scope.row)"/>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="开票金额" min-width="100px"> <el-table-column align="center" label="备注" min-width="150px">
<template slot-scope="scope">
{{ scope.row.备注 ? scope.row.备注 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="开票金额" min-width="100px" prop="开票金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.开票金额 }} {{ scope.row.开票金额 }}
</template> </template>
@@ -82,19 +98,36 @@
{{ scope.row.接收人 ? scope.row.接收人 : '—' }} {{ scope.row.接收人 ? scope.row.接收人 : '—' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="接收时间" min-width="80px"> <el-table-column align="center" label="接收时间" min-width="135px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.接收时间 ? scope.row.接收时间 : '—' }} {{ scope.row.接收时间 ? scope.row.接收时间 : '—' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="发票号" min-width="120px">
<template slot-scope="scope">
{{ scope.row.发票号 ? scope.row.发票号 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="开户行" min-width="120px">
<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.开票时间 ? scope.row.开票时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="200px"> <el-table-column align="center" label="操作" fixed="right" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:disabled="!office"
type="primary" type="primary"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleEdit(scope.row)">编辑</el-button> @click="handleEdit(scope.row)">编辑</el-button>
<el-button <el-button
:disabled="office||!!scope.row.接收人"
type="danger" type="danger"
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
@@ -113,38 +146,25 @@
@size-change="handleSizeChange1" @size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/> @current-change="handleCurrentChange1"/>
</div> </div>
<el-table v-loading="" :data="tableData2" size="mini" 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="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>
<img :src="scanSrc" alt="发票扫描件" width="100%"> <img :src="scanSrc" alt="发票扫描件" width="100%">
</el-card> </el-card>
<el-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="460px"> <el-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="460px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="90px"> <el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="90px">
<el-row> <el-row>
<el-form-item label="合同编号" prop="contractNumValue"> <el-form-item label="供应商" prop="supplierNumValue">
<el-select v-model="form1.contractNumValue" placeholder="合同编号" size="small" filterable clearable> <el-select v-model="form1.supplierNumValue" placeholder="供应商" size="small" filterable @change="searchContract2">
<el-option <el-option
v-for="item in contractNum" v-for="item in supplierNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="合同编号" prop="contractNumValue">
<el-select v-model="form1.contractNumValue" multiple placeholder="合同编号" size="small" filterable clearable>
<el-option
v-for="item in contractNums"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
@@ -152,6 +172,16 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div> <div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option> </el-option>
</el-select> </el-select>
<el-tooltip :content="offline" placement="top">
<el-switch
v-model="offline"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="非离线"
inactive-value="离线"
style="margin: 10px"
@change="offlineChange2"/>
</el-tooltip>
</el-form-item> </el-form-item>
<el-form-item label="开票金额" prop="money"> <el-form-item label="开票金额" prop="money">
<el-input v-model="form1.money" size="small" placeholder="开票金额"/> <el-input v-model="form1.money" size="small" placeholder="开票金额"/>
@@ -165,6 +195,9 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注">
<el-input v-model="form1.remark" size="small" placeholder="备注"/>
</el-form-item>
<el-form-item label="发票扫描件"> <el-form-item label="发票扫描件">
<el-upload <el-upload
id="invoiceScan" id="invoiceScan"
@@ -174,7 +207,7 @@
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-exceed="warningExceed" :on-exceed="warningExceed"
:limit="limit" :limit="limit"
:action="upload+'?contractNumValue='+form1.contractNumValue+'&money='+form1.money+'&sendPersonValue='+form1.sendPersonValue" :action="upload+'?contractNumValue='+form1.contractNumValue+'&money='+form1.money+'&sendPersonValue='+form1.sendPersonValue+'&remark='+form1.remark+'&supplierNumValue='+form1.supplierNumValue+'&offline='+offline"
list-type="picture-card"> list-type="picture-card">
<i class="el-icon-plus"/> <i class="el-icon-plus"/>
</el-upload> </el-upload>
@@ -183,49 +216,145 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1 = false">取消</el-button> <el-button size="small" @click="dialogVisible1 = false">取消</el-button>
<el-button v-show="title1==='增加'" size="small" type="primary" @click="submitAdd('form1')">确定</el-button> <el-button size="small" type="primary" @click="submitAdd('form1')">确定</el-button>
<el-button v-show="title1==='编辑'" size="small" type="primary" @click="submitEdit('form1')">确定</el-button> </div>
</el-dialog>
<el-dialog :title="title1" :visible.sync="dialogVisible2" center style="min-height: 300px" width="1200px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="供应商">
<el-input v-model="form1.supplierName" size="small" disabled placeholder="供应商"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开票金额">
<el-input v-model="form1.money" size="small" disabled placeholder="开票金额"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="传送人">
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="接收人">
<el-select v-model="form1.receivePersonValue" placeholder="接收人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="备注">
<el-input v-model="form1.remark" size="small" disabled placeholder="备注"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="发票号" prop="invoiceNum">
<el-input v-model="form1.invoiceNum" size="small" placeholder="发票号"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开户行" prop="bank">
<el-input v-model="form1.bank" size="small" placeholder="开户行"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开票时间" prop="invoiceTime">
<el-date-picker
v-model="form1.invoiceTime"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="开票时间"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="扫描件">
<img :src="scanSrc" alt="发票扫描件" width="1000px">
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible2 = false">取消</el-button>
<el-button size="small" type="primary" @click="submitEdit('form1')">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { searchInvoice, editInvoice, deleteInvoice, initSender, initProject, initContract } from '@/api/PurchasingCenter/PurchaseInvoiceDelivery' import { searchInvoice, editInvoice, deleteInvoice, initSender, initSupplier, searchContract, searchOffline, invoiceDetail } from '@/api/PurchasingCenter/PurchaseInvoiceDelivery'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { upload } from '@/utils/request' import { uploadInvoiceScan } from '@/utils/request'
import request from '@/utils/request' import request from '@/utils/request'
export default { export default {
name: '', // 采购发票交接 name: '', // 采购发票交接
data() { data() {
return { return {
offline: '非离线',
check1: 0,
office: false,
scanSrc: '', scanSrc: '',
upload: `http://localhost:8411/submit/uploadInvoiceScan.ashx`, upload: uploadInvoiceScan,
limit: 1, limit: 1,
sender: [], sender: [],
contractNumValue: '', contractNumValue: '',
contractNum: [], contractNums: [], // options
projectValue: '',
project: [],
pageCurrent1: 1, pageCurrent1: 1,
pageSize1: 10, pageSize1: 10,
total1: 0, total1: 0,
tableData1: [], tableData1: [],
tableData2: [], tableData01: [],
dialogVisible1: false, dialogVisible1: false,
dialogVisible2: false, // 办公室
title1: '', title1: '',
supplierNumValue: '',
supplierNum: [],
form1: { form1: {
contractNumValue: '', supplierNumValue: '',
supplierName: '',
invoiceDeliveryNum: '',
contractNumValue: [], // 多选select值
money: '', money: '',
sendPersonValue: '' sendPersonValue: '',
receivePersonValue: '',
invoiceNum: '',
bank: '',
invoiceTime: '',
remark: ''
}, },
rules1: { rules1: {
contractNumValue: [ supplierNumValue: [
{ required: true, message: '请选择合同号' } { required: true, message: '请选择供应商' }
], ],
money: [ money: [
{ required: true, message: '请填写金额' } { required: true, message: '请填写金额' }
],
invoiceNum: [
{ required: true, message: '请填写发票号' }
],
bank: [
{ required: true, message: '请填写开户行' }
],
invoiceTime: [
{ required: true, message: '请填写开票时间' }
] ]
} }
} }
@@ -243,22 +372,38 @@ export default {
this.searchTable1() this.searchTable1()
}, },
methods: { methods: {
fetchData() { // 初始化数据 offlineChange2() { // 切换离线非离线(内)
console.log(upload) if (this.offline === '离线') {
initContract().then(response => { this.searchOffline2()
} else {
this.searchContract2()
}
},
invoiceDetail(row) {
invoiceDetail(row.发票交接流水号).then(response => {
this.tableData01 = response.data
})
},
searchOffline1() {}, // 根据供应商查离线合同(外)
searchOffline2() { // 根据供应商查离线合同(内)
this.form1.contractNumValue = []
this.contractNums = []
searchOffline(this.form1.supplierNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({ this.contractNums.push({
label: response.data[i].采购合同编号, label: response.data[i].离线合同编号,
name: response.data[i].采购合同名称, name: response.data[i].离线合同名称,
value: response.data[i].采购合同流水号 value: response.data[i].离线合同流水号
}) })
} }
}) })
initProject().then(response => { },
fetchData() { // 初始化数据
initSupplier().then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.project.push({ this.supplierNum.push({
label: response.data[i].项目名称, label: response.data[i].供应商名称,
value: response.data[i].项目流水号 value: response.data[i].供应商流水号
}) })
} }
}) })
@@ -271,10 +416,36 @@ export default {
} }
}) })
}, },
// searchContract1() { // 根据供应商查合同(外)
// this.contractNumValue = ''
// this.contractNums = []
// searchContract(this.supplierNumValue).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// this.contractNums.push({
// label: response.data[i].采购合同编号,
// name: response.data[i].采购合同名称,
// value: response.data[i].采购合同流水号
// })
// }
// })
// },
searchContract2() { // 根据供应商查合同(内)
this.form1.contractNumValue = []
this.contractNums = []
searchContract(this.form1.supplierNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable1() { // 查询表1 searchTable1() { // 查询表1
this.projectValue ? this.check1 = 1 : this.check1 = 0 this.supplierNumValue ? this.check1 = 1 : this.check1 = 0
this.contractNumValue ? this.check2 = 1 : this.check2 = 0 this.contractNumValue ? this.check2 = 1 : this.check2 = 0
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.contractNumValue).then(response => { searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.supplierNumValue, this.check2, this.contractNumValue).then(response => {
this.tableData1 = response.data.rows this.tableData1 = response.data.rows
this.total1 = response.data.total this.total1 = response.data.total
}) })
@@ -294,8 +465,10 @@ export default {
this.$refs['form1'].resetFields() this.$refs['form1'].resetFields()
} }
this.title1 = '增加' this.title1 = '增加'
this.contractNum = []
this.form1.projectValue = '' this.form1.projectValue = ''
this.form1.contractNumValue = '' this.form1.supplierNumValue = ''
this.form1.contractNumValue = []
this.form1.money = '' this.form1.money = ''
this.form1.sendPersonValue = Number(this.id) this.form1.sendPersonValue = Number(this.id)
this.form1.remark = '' this.form1.remark = ''
@@ -314,7 +487,7 @@ export default {
} }
}) })
}, },
beforeUpload(file) { beforeUpload(file) { // 上船前检测
const isJPG = /^image\/.*/.test(file.type) const isJPG = /^image\/.*/.test(file.type)
const isLt4M = file.size / 1024 / 1024 < 4 const isLt4M = file.size / 1024 / 1024 < 4
if (!isJPG) { if (!isJPG) {
@@ -330,6 +503,7 @@ export default {
this.$message.success('增加成功') this.$message.success('增加成功')
this.dialogVisible1 = false this.dialogVisible1 = false
this.searchTable1() this.searchTable1()
this.$refs.upload.clearFiles()
} else { } else {
this.$message.error('增加失败') this.$message.error('增加失败')
} }
@@ -339,35 +513,24 @@ export default {
this.$refs['form1'].resetFields() this.$refs['form1'].resetFields()
} }
this.title1 = '编辑' this.title1 = '编辑'
this.dialogVisible1 = true this.dialogVisible2 = true
this.form1.contractNum = parseInt(row.采购合同流水号) this.form1.invoiceDeliveryNum = row.发票交接流水号
this.form1.invoiceNum = row.发票号 this.form1.supplierName = row.供应商名称
this.form1.invoiceNumValue = row.发票流水号
this.form1.invoiceTime = row.开票时间
this.form1.money = row.开票金额 this.form1.money = row.开票金额
this.form1.sendPersonValue = parseInt(row.传送人) this.form1.sendPersonValue = parseInt(row.传送人流水号)
this.form1.receivePersonValue = parseInt(row.接收人) this.form1.receivePersonValue = Number(this.id)
this.form1.invoiceNum = row.发票号
this.form1.bank = row.开户行
this.form1.invoiceTime = row.开票时间
this.form1.remark = 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 = ''
}
}, },
submitEdit(formName) { submitEdit(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (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 => { editInvoice(this.form1.invoiceDeliveryNum, this.form1.invoiceNum, this.form1.bank, this.form1.invoiceTime, this.form1.receivePersonValue).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') { if (response.data[0].result === '1') {
this.$message.success('编辑成功') this.$message.success('编辑成功')
this.dialogVisible1 = false this.dialogVisible2 = false
this.searchTable1() this.searchTable1()
} else { this.$message.error('编辑失败') } } else { this.$message.error('编辑失败') }
}) })
@@ -378,14 +541,12 @@ export default {
}) })
}, },
handleDelete(row) { handleDelete(row) {
console.log(row)
this.$confirm('确认删除吗?', '提示', { this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteInvoice(row.发票流水号).then(response => { deleteInvoice(row.发票交接流水号).then(response => {
console.log(response.data)
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success('删除成功')
this.dialogVisible1 = false this.dialogVisible1 = false
@@ -409,7 +570,6 @@ export default {
} }
}) })
this.scanSrc = 'http://localhost:8411/webpage/file/' + data[0].文件标识 + '.' + data[0].文件后缀 this.scanSrc = 'http://localhost:8411/webpage/file/' + data[0].文件标识 + '.' + data[0].文件后缀
console.log(this.scanSrc)
} }
} }
} }

View File

@@ -11,14 +11,8 @@
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<span>分配情况:</span> <span>物料状态:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px"> <el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button <el-button
type="success" type="success"
size="small" size="small"
@@ -90,6 +84,14 @@
stripe stripe
@selection-change="handleSelectionChange1"> @selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/> <el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="采购情况" min-width="70px">
<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"> <el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.项目名称 }} {{ scope.row.项目名称 }}
@@ -140,7 +142,12 @@
{{ scope.row.物料计划到货时间.split(' ')[0] }} {{ scope.row.物料计划到货时间.split(' ')[0] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer"> <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="80px" prop="buyer">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }} {{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template> </template>
@@ -169,14 +176,8 @@
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<span>分配情况:</span> <span>物料状态:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px"> <el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button <el-button
type="success" type="success"
size="small" size="small"
@@ -217,6 +218,14 @@
stripe stripe
@selection-change="handleSelectionChange2"> @selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" type="selection"/> <el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="采购情况" min-width="70px">
<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"> <el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.项目名称 }} {{ scope.row.项目名称 }}
@@ -262,7 +271,12 @@
{{ scope.row.物料计划到货时间.split(' ')[0] }} {{ scope.row.物料计划到货时间.split(' ')[0] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer"> <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="80px" prop="buyer">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }} {{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template> </template>
@@ -300,8 +314,8 @@ export default {
projectValue: '', projectValue: '',
project: [], project: [],
materialName: '', materialName: '',
allocateStateValue: 0, materialStatusValue: [0], // 物料状态
allocateState: [ materialStatus: [
{ {
value: 0, value: 0,
label: '全部' label: '全部'
@@ -312,9 +326,23 @@ export default {
}, },
{ {
value: 2, value: 2,
label: '已分配' label: '已分配',
children: [{
value: 3,
label: '未询价'
}, {
value: 4,
label: '已询价',
children: [{
value: 5,
label: '未采购'
}, {
value: 6,
label: '已采购'
}]
}]
} }
], ], // 物料状态
personValue: '', personValue: '',
person: [], person: [],
check1: 0, check1: 0,
@@ -378,14 +406,15 @@ export default {
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0 this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 0 this.projectValue ? this.check3 = 1 : this.check3 = 0
this.materialName ? this.check4 = 1 : this.check4 = 0 this.materialName ? this.check4 = 1 : this.check4 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, this.check4, this.materialName, this.allocateStateValue).then(response => { searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, this.check4, this.materialName, this.materialStatusValue[this.materialStatusValue.length - 1]).then(response => {
this.tableData1 = response.data.rows this.tableData1 = response.data.rows
console.log(response.data.rows)
this.total1 = response.data.total this.total1 = response.data.total
}) })
}, },
searchTable2() { // 查询基本件 searchTable2() { // 查询基本件
this.projectValue ? this.check3 = 1 : this.check3 = 0 this.projectValue ? this.check3 = 1 : this.check3 = 0
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, this.allocateStateValue).then(response => { searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, this.materialStatusValue[this.materialStatusValue.length - 1]).then(response => {
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
this.total2 = response.data.total this.total2 = response.data.total
}) })
@@ -460,7 +489,6 @@ export default {
} }
}, },
filterHandler(value, row) { filterHandler(value, row) {
console.log(row, value)
return parseInt(row['人员编号']) === parseInt(value) return parseInt(row['人员编号']) === parseInt(value)
}, },
handleSizeChange1(val) { handleSizeChange1(val) {
@@ -532,6 +560,9 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-tag{
margin: 0
}
.el-card{ .el-card{
margin-bottom: 15px; margin-bottom: 15px;
} }

View File

@@ -0,0 +1,292 @@
<template>
<div class="app-container">
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading=""
id="expandTable"
:data="tableData1"
:row-key="getRowKeys"
:expand-row-keys="expands"
border
style="width: 100%;max-height: 250px;"
height="250px"
size="mini"
@row-click="searchContract"
@expand-change="searchPlan">
<el-table-column type="expand">
<template slot-scope="props">
<el-table v-loading="" v-show="tableData01.length!==0" :data="tableData01" border size="mini">
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="计划付款日期" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="计划付款金额" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款金额 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="200">
<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="primary" size="mini" icon="el-icon-circle-plus-outline" @click="handleSetPayPlan(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-card>
<div style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="returns"/>
<el-dialog :visible.sync="dialogVisible1" title="增加付款计划" center style="min-height: 300px" width="400px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px">
<el-form-item label="计划付款日期" prop="计划付款日期">
<el-date-picker v-model="form1.计划付款日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="计划付款金额" prop="计划付款金额">
<el-input v-model="form1.计划付款金额" placeholder="填写金额" size="small" clearable/>
</el-form-item>
<el-form-item label="计划付款备注">
<el-input v-model="form1.计划付款备注" placeholder="填写备注" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1=false">取消</el-button>
<el-button type="primary" size="small" @click="submitSetPayPlan">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initContract, searchTable1, searchTable01, addTable01, deleteTable01, searchTable2 } from '@/api/PurchasingCenter/SetPayPlan'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购预算查询
data() {
return {
expands: [],
contractNumValue: '',
contractNum: [],
supplierName: '',
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
returns: '',
tableData01: [],
dialogVisible1: false,
form1: {
采购合同流水号: '',
计划付款日期: '',
计划付款金额: '',
计划付款备注: ''
},
rules1: {
计划付款日期: [{ required: true, message: '请选择计划付款日期' }],
计划付款金额: [{ required: true, message: '请输入计划付款金额' }]
}
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
this.searchTable1()
},
methods: {
getRowKeys(row) {
return row.采购合同流水号
},
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.tableData1 = []
this.returns = ''
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchPlan(row) {
this.form1.采购合同流水号 = row.采购合同流水号
searchTable01(row.采购合同流水号).then(response => {
this.tableData01 = response.data
this.expands.indexOf(row.采购合同流水号) === -1 ? this.expands.push(row.采购合同流水号) : this.expands = []
})
},
handleSetPayPlan(row) { // 设置付款计划
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
searchTable01(row.采购合同流水号).then(response => {
this.tableData01 = response.data
}).then(() => {
this.expands.indexOf(row.采购合同流水号) === -1 ? this.expands.push(row.采购合同流水号) : true
})
this.form1.采购合同流水号 = row.采购合同流水号
this.form1.计划付款日期 = ''
this.form1.计划付款金额 = ''
this.form1.计划付款备注 = ''
this.dialogVisible1 = true
},
submitSetPayPlan() { // 提交设置
this.$refs['form1'].validate((valid) => {
if (valid) {
addTable01(this.form1.采购合同流水号, this.form1.计划付款日期, this.form1.计划付款金额, this.form1.计划付款备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('设置成功')
searchTable01(this.form1.采购合同流水号).then(response => {
this.tableData01 = response.data
this.expands.indexOf(this.form1.采购合同流水号) === -1 ? this.expands.push(this.form1.采购合同流水号) : true
})
this.dialogVisible1 = false
} else {
this.$message.error('设置失败')
}
})
}
})
},
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteTable01(row.付款计划流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
searchTable01(this.form1.采购合同流水号).then(response => {
this.tableData01 = response.data
this.expands.indexOf(this.form1.采购合同流水号) === -1 ? this.expands.push(this.form1.采购合同流水号) : true
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchContract(row) {
searchTable2(row.采购合同流水号).then(response => {
this.returns = response.data[0].合同内容
})
}
}
}
</script>
<style>
#expandTable .el-table__expanded-cell{
padding: 5px 50px;
}
</style>
<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>