This commit is contained in:
caoxinyu
2018-12-20 18:43:33 +08:00
10 changed files with 458 additions and 199 deletions

View File

@@ -28,7 +28,19 @@ export function searchInbound(data1, data2, data3) {
method: 'post',
data: {
type: '1',
name: '库存管理_入库记录_查询',
name: '库存管理_入库记录_采购部查询',
param: '采购合同流水号=' + data1 + '&到货时间=' + data2 + '&仓库流水号=' + data3
}
})
}
// 入库记录查询
export function searchShopInbound(data1, data2, data3) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_入库记录_车间采购查询',
param: '采购合同流水号=' + data1 + '&到货时间=' + data2 + '&仓库流水号=' + data3
}
})

View File

@@ -109,6 +109,18 @@ export function deleteReplacementCard(Number) {
}
})
}
// 补投删除
export function deleteCardDetail(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({
@@ -121,3 +133,16 @@ export function addCardDetail(Number, project, machine, team, name, mass, locate
}
})
}
// 补投单明细查询
export function searchCardDetail(cardNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_仓库补投_补投单明细_查询',
param: '补投单流水号=' + cardNumber
}
})
}

View File

@@ -0,0 +1,13 @@
import request from '@/utils/request'
// 初始化 项目名称
export function getEntryNameValue() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据',
param: '考核状态=5=int'
}
})
}

View File

@@ -7,7 +7,7 @@ export function initArrivalStateContact() {
method: 'post',
data: {
type: '1',
name: '采购管理_到货情况_查询数据'
name: '采购管理_采购请款表_查询数据'
}
})
}

View File

@@ -1,81 +1,83 @@
<template>
<div class="app-container">
<el-card>
<span>采购合同编号:</span>
<el-select v-model="ContractValue" filterable clearable size="small" placeholder="采购合同" style="width: 200px">
<el-option
v-for="item in Contract"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span class="demonstration">入库日期</span>
<el-date-picker
v-model="InboundDate"
type="date"
size="small"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>仓库:</span>
<el-select v-model="InventoryValue" filterable clearable size="small" placeholder="仓库" style="width: 200px">
<el-option
v-for="item in Inventory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchPartinfo()">查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData"
border
style="width: 100%;"
height="400">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="存货编码" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="存货名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.实际到货数量 }}
</template>
</el-table-column>
<el-table-column label="本币单价" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="本币单价" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.单价 * scope.row.实际到货数量 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选入</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="采购部采购" name="first">
<el-card>
<span>采购合同编号:</span>
<el-select v-model="ContractValue" filterable clearable size="small" placeholder="采购合同" style="width: 200px">
<el-option
v-for="item in Contract"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span class="demonstration">入库日期</span>
<el-date-picker
v-model="InboundDate"
type="date"
size="small"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>仓库:</span>
<el-select v-model="InventoryValue" filterable clearable size="small" placeholder="仓库" style="width: 200px">
<el-option
v-for="item in Inventory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchPartinfo()">查询</el-button>
<el-button size="small" type="primary" icon="el-icon-download" style="margin: 0 0 0 10px" @click="searchPartinfo()">导出</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData"
size="mini"
border
style="width: 100%;"
height="400">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="存货名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.实际到货数量 }}
</template>
</el-table-column>
<el-table-column label="本币单价" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="本币单价" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.单价 * scope.row.实际到货数量 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选入</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<el-tab-pane label="车间采购" name="second">配置管理</el-tab-pane>
</el-tabs>
</div>
</template>
@@ -91,7 +93,8 @@ export default {
InventoryValue: '',
InboundDate: '',
listLoading: '',
tableData: []
tableData: [],
activeName: 'first'
}
},
computed: {

View File

@@ -42,7 +42,7 @@
</el-card>
<el-card v-show="altershow">
<el-table
v-loading="loading1"
v-loading="loading"
:data="tableData1"
border
style="width: 100%;max-height: 300px;"
@@ -103,10 +103,10 @@
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
:page-size="pageSize"
:total="total"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@@ -115,13 +115,13 @@
</el-card>
<el-card v-show="errorshow">
<el-table
v-loading="loading1"
v-loading="loading2"
:data="tableData2"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
@selection-change="handleSelectionChange2">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="项目名称" min-width="100" align="center">
<template slot-scope="scope">
@@ -143,7 +143,7 @@
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="异常数量" min-width="50" align="center">
<el-table-column label="异常数量" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.异常数量 }}
</template>
@@ -183,7 +183,7 @@
</el-card>
<el-card>
<span>补投单号:</span>
<el-input v-model="repleacecard" placeholder="补投单号" size="small" clearable style="width: 150px"/>
<el-input v-model="repleacecard" placeholder="补投单号" size="small" clearable style="width: 200px"/>
<span>仓库:</span>
<el-select v-model="HouseNumber" placeholder="请选择仓库" size="small" @change="searchDemo();payMethodChange()">
<el-option
@@ -209,16 +209,10 @@
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="addMateriel">选入物料</el-button>
@click="submitCardDetail">选入物料</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 v-loading="loading3" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable4">
<el-table-column label="补投单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.补投单编号 }}
@@ -242,7 +236,7 @@
<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>
<el-button type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard()">导出</el-button>
</template>
</el-table-column>
</el-table>
@@ -257,35 +251,50 @@
@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">
<el-table v-loading="loading4" :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.请购单编号 }}
{{ scope.row.补投单编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="150">
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
{{ 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">
{{ scope.row.物料规格 }}
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<el-table-column label="号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型 }}
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.数量" :disabled="disable" size="mini" style="width:70px"/>
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="类型名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.类型名称 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<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="deleteDetail(scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
@@ -294,7 +303,7 @@
</template>
<script>
import { initProject, searchmachine, searchTeam, searchAlterRecord, searchErrorRecord, searchReplacementCard, addReplacementCard, initWarehouse } from '@/api/Inventory/PartsReplacement'
import { initProject, searchmachine, searchTeam, searchAlterRecord, searchErrorRecord, searchReplacementCard, addReplacementCard, initWarehouse, addCardDetail, searchCardDetail, deleteReplacementCard, deleteCardDetail } from '@/api/Inventory/PartsReplacement'
import { mapGetters } from 'vuex'
export default {
data() {
@@ -309,18 +318,18 @@ export default {
tableData2: [],
tableData3: [],
tableData4: [],
listLoading: false,
listLoading2: false,
listLoading3: false,
listLoading4: false,
PageCurrent: 1,
PageSize: 10,
loading: false,
loading2: false,
loading3: false,
loading4: false,
pageCurrent: 1,
pageSize: 10,
total: 0,
PageCurrent2: 1,
PageSize2: 10,
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
PageCurrent3: 1,
PageSize3: 10,
pageCurrent3: 1,
pageSize3: 10,
total3: 0,
ProjectValue_check: '',
MachineValue_check: '',
@@ -332,7 +341,16 @@ export default {
House: [],
radio: '',
altershow: true,
errorshow: false
errorshow: false,
projectGroup: [],
machineGroup: [],
partGroup: [],
nameGroup: [],
numberGroup: [],
locateGroup: [],
partType: [],
reasonGroup: [],
cardNumber: ''
}
},
computed: {
@@ -361,6 +379,46 @@ export default {
}
})
},
handleSelectionChange(val) {
this.projectGroup = []
this.machineGroup = []
this.partGroup = []
this.nameGroup = []
this.numberGroup = []
this.locateGroup = []
this.partType = []
this.reasonGroup = []
for (let i = 0; i < val.length; i++) {
this.projectGroup.push(val[i].项目流水号)
this.machineGroup.push(val[i].机床流水号)
this.partGroup.push(val[i].组件流水号)
this.nameGroup.push(val[i].名称)
this.numberGroup.push(val[i].数量)
this.locateGroup.push(val[i].货位流水号)
this.partType.push(val[i].零件类型)
this.reasonGroup.push(val[i].原因)
}
},
handleSelectionChange2(val) {
this.projectGroup = []
this.machineGroup = []
this.partGroup = []
this.nameGroup = []
this.numberGroup = []
this.locateGroup = []
this.partType = []
this.reasonGroup = []
for (let i = 0; i < val.length; i++) {
this.projectGroup.push(val[i].项目流水号)
this.machineGroup.push(val[i].机床流水号)
this.partGroup.push(val[i].组件流水号)
this.nameGroup.push(val[i].名称)
this.numberGroup.push(val[i].异常数量)
this.locateGroup.push(val[i].货位流水号)
this.partType.push(val[i].零件类型)
this.reasonGroup.push(val[i].异常原因)
}
},
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
@@ -395,7 +453,7 @@ export default {
},
// 查询修改记录
getAlterRecord() {
this.listLoading = true
this.loading = true
this.tableData1 = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
@@ -412,16 +470,18 @@ export default {
} 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 => {
searchAlterRecord(this.pageCurrent, this.pageSize, this.rojectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableData1 = response.data.rows
console.log(response.data)
console.log(this.tableData1)
this.total = response.data.total
this.listLoading = false
this.loading = false
})
this.getErrorRecord()
},
// 查询异常记录
getErrorRecord() {
this.listLoading2 = true
this.loading2 = true
this.tableData2 = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
@@ -438,54 +498,67 @@ export default {
} 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 => {
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
this.loading2 = false
})
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
this.getAlterRecord()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
this.getAlterRecord()
},
handleSizeChange2(val) {
this.PageCurrent2 = 1
this.PageSize2 = val
this.searchPartinfo()
this.getErrorRecord()
},
handleCurrentChange2(val) {
this.PageCurrent2 = val
this.searchPartinfo()
this.getErrorRecord()
},
handleSizeChange3(val) {
this.PageCurrent3 = 1
this.PageSize3 = val
this.getReplacement()
},
handleCurrentChange3(val) {
this.PageCurrent3 = val
this.getReplacement()
},
// 查询补投单
getReplacement() {
this.listLoading3 = true
this.loading3 = 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 => {
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
this.loading3 = false
})
},
addCard() {
addReplacementCard(this.people, this.HouseNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.getReplacement()
} else {
this.$message.error('删除失败')
}
})
if (this.HouseNumber === '') {
this.$message.error('请选择仓库')
} else {
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) {
@@ -495,6 +568,76 @@ export default {
this.altershow = false
this.errorshow = true
}
},
searchTable4(row) {
this.cardNumber = row.补投单流水号
this.getdetail()
},
submitCardDetail() {
if (this.cardNumber === '') {
this.$message.error('请选择领料单')
} else {
addCardDetail(this.cardNumber, this.projectGroup, this.machineGroup, this.partGroup, this.nameGroup, this.numberGroup, this.locateGroup, this.partType, this.reasonGroup, this.CardDetail).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.searchTable4()
} else {
this.$message.error('增加失败')
}
})
}
},
// 查询补投单明细
getdetail() {
this.loading4 = true
searchCardDetail(this.cardNumber).then(response => {
this.tableData4 = response.data
this.loading4 = false
})
},
// 删除补投单
deleteOfflineContract(row) { // 删除请购单
this.$confirm('确定删除该补投单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteReplacementCard(row.补投单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getReplacement()
} else {
this.$message.error('数据占用')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 删除补投单明细
deleteDetail(row) {
this.$confirm('确定删除该补投单明细?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteCardDetail(row.补投单明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getdetail()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}

View File

@@ -14,9 +14,6 @@
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<span>提前</span>
<el-input-number v-model="warningValue" :min="1" controls-position="right" size="small" style="width: 90px"/>
<span>天预警</span>
<el-button
type="success"
size="small"
@@ -45,12 +42,12 @@
{{ 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">
{{ scope.row.规定到货时间.split(' ')[0] }}
{{ scope.row.交货日期 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="250">
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
@@ -60,20 +57,12 @@
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="到货情况" align="center" min-width="70">
<template slot-scope="scope">
<el-tag v-if="judge[scope.$index]===1" type="success" size="small">全部到货</el-tag>
<el-tag v-if="judge[scope.$index]===2" type="warning" size="small">即将拖期</el-tag>
<el-tag v-if="judge[scope.$index]===3" type="danger" size="small">已拖期</el-tag>
<el-tag v-if="judge[scope.$index]===4" type="primary" size="small">进度正常</el-tag>
</template>
</el-table-column>
<el-table-column label="到货进度" align="center" min-width="150">
<template slot-scope="scope">
<el-progress
:text-inside="true"
:stroke-width="18"
:percentage="parseFloat((100*scope.row.合同物料到货总数/scope.row.合同物料采购总数).toFixed(2))"
:percentage="parseFloat((100*scope.row.合同到货总数/scope.row.合同采购总数).toFixed(2))"
status="success"/>
</template>
</el-table-column>
@@ -95,29 +84,29 @@
{{ 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">
{{ scope.row.物料名称 }}
{{ scope.row.物料型号 ? scope.row.物料型号 : 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">
{{ scope.row.物料规格 }}
{{ scope.row.物料名称 ? scope.row.物料名称 : 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">
{{ scope.row.物料型号 }}
{{ scope.row.物料规格 ? scope.row.物料规格 : scope.row.规格 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.数量 }}
{{ scope.row.采购总数量 }}
</template>
</el-table-column>
<el-table-column label="已到货数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.总到货数量 ? scope.row.总到货数量 : 0 }}
{{ scope.row.已到货数量 }}
</template>
</el-table-column>
</el-table>
@@ -133,7 +122,6 @@ export default {
name: '', // 项目总价查询
data() {
return {
warningValue: 3,
check1: 0,
check2: 0,
contractNumValue: '',
@@ -143,10 +131,7 @@ export default {
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
tableData2: [],
now: '',
arrival: [],
judge: []
tableData2: []
}
},
computed: {
@@ -159,6 +144,7 @@ export default {
},
created() {
this.fetchData()
this.searchTable1()
},
methods: {
fetchData() {
@@ -173,24 +159,9 @@ export default {
})
},
searchTable1() {
this.warningValue ? this.warningValue : this.warningValue = 1
this.arrival = [] // 规定到货时间数组
this.now = new Date()
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchArrivalState(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
this.arrival.push(new Date(response.data.rows[i].规定到货时间))
if (parseInt(response.data.rows[i].合同物料到货总数) === parseInt(response.data.rows[i].合同物料采购总数)) {
this.judge[i] = 1 // 全部到货
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) > 0 && (this.arrival[i] - this.now) < (86400000 * this.warningValue)) {
this.judge[i] = 2 // 即将拖期
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) < 0) {
this.judge[i] = 3 // 已拖期
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.arrival[i] - this.now) > (86400000 * this.warningValue)) {
this.judge[i] = 4 // 进度正常
}
}
this.tableData1 = response.data.rows
this.total1 = response.data.total
})

View File

@@ -130,11 +130,20 @@
@click="addMateriel">选入物料</el-button>
</div>
<el-table v-loading="" :data="tableData2" border style="max-height: 460px;" height="460px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="合同状态" align="center" width="80" fixed="left">
<el-table-column type="expand" fixed="left">
<template slot-scope="scope">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="离线合同备注">
{{ scope.row.离线合同备注 }}
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column label="合同状态" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.离线合同状态)===1" type="warning" size="small">编辑中</el-tag>
<el-tag v-if="Number(scope.row.离线合同状态)===2" type="success" size="small">已采购</el-tag>
<el-tag v-if="Number(scope.row.离线合同状态)===5" type="danger" size="small">已作废</el-tag>
<el-tag v-if="Number(scope.row.离线合同状态)===2&&Number(scope.row.总采购数量)!==Number(scope.row.总到货数量)" type="primary" size="small">已采购</el-tag>
<el-tag v-if="Number(scope.row.总采购数量)===Number(scope.row.总到货数量)" type="success" size="small">全部到货</el-tag>
</template>
</el-table-column>
<el-table-column label="离线合同编号" align="center" min-width="170">
@@ -152,7 +161,7 @@
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="100">
<el-table-column label="采购员" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.采购员 }}
</template>
@@ -167,16 +176,11 @@
{{ scope.row.规定到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="离线合同备注" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.离线合同备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200" 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 :disabled="parseInt(scope.row.离线合同状态)!==1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)"/>
<el-button type="warning" size="mini" icon="el-icon-download"/>
<el-button type="warning" size="mini" icon="el-icon-download" @click="exportExcel(scope.row)"/>
</template>
</el-table-column>
</el-table>
@@ -414,12 +418,55 @@
@click="submitEditOfflineContract">确定</el-button>
</div>
</el-dialog>
<div id="offlineContract" style="width: 800px;margin: 0 auto;display: none">
<table class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr>
<th colspan="8" style="font-size: 30px;font-weight: bold">离线合同</th>
</tr>
<tr>
<td colspan="2" rowspan="2" style="text-align:center;font-size: 30px;font-weight: bold">GAOJING</td>
<td>合同名称</td>
<td id="contractName"/>
<td>供应商</td>
<td id="supplier"/>
<td colspan="2" rowspan="2" style="width: 40px;height: 100px;">二维码粘贴处</td>
</tr>
<tr>
<td>合同编号</td>
<td id="contractNum"/>
<td>采购员</td>
<td id="buyer"/>
</tr>
<tr id="tablehead">
<td>序号</td>
<td>名称</td>
<td>规格</td>
<td>型号</td>
<td>数量</td>
<td>单价</td>
<td>合计</td>
<td>备注</td>
</tr>
<tr>
<td>总计</td>
<td/>
<td/>
<td/>
<td/>
<td/>
<td id="total"/>
<td/>
</tr>
</table>
</div>
</div>
</template>
<script>
import { searchInventoryNum, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel,
addMateriel, deleteMateriel, doneOfflineContact, setSafeValue } from '@/api/PurchasingCenter/OfflineContract'
import { exportExcelMethod } from './exportExcel'
import { mapGetters } from 'vuex'
export default {
@@ -645,7 +692,6 @@ export default {
})
},
editOfflineContract(row) {
console.log(row)
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
@@ -688,25 +734,25 @@ export default {
}
})
},
deleteOfflineContract(row) { // 作废离线合同
this.$confirm('确定作废该合同?', '提示', {
deleteOfflineContract(row) { // 删除离线合同
this.$confirm('确定删除该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteOfflineContract(row.离线合同流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('作废成功')
this.$message.success('删除成功')
this.searchTable2()
searchMateriel(this.offlineContractNum).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('作废失败') }
} else { this.$message.error('数据占用,删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
message: '已取消删除'
})
})
},
@@ -867,6 +913,52 @@ export default {
message: '已取消操作'
})
})
},
exportExcel(row) {
this.$confirm('确定导出该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const children = document.getElementsByClassName('tableData')
const parent = document.getElementsByClassName('offlineContract')[0]
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.tableData3.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = `<td/><td/><td/><td/><td/><td/><td/><td/>`
document.getElementById('tablehead').after(tr[i])
}
let total = 0
for (let j = 0; j < this.tableData3.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = this.tableData3[j].物料名称
document.getElementsByClassName('tableData')[j].children[2].innerHTML = this.tableData3[j].物料规格
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料型号
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData3[j].单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = this.tableData3[j].数量 * this.tableData3[j].单价
document.getElementsByClassName('tableData')[j].children[7].innerHTML = ''
total += this.tableData3[j].数量 * this.tableData3[j].单价
}
document.getElementById('contractNum').innerHTML = row.离线合同编号
document.getElementById('contractName').innerHTML = row.离线合同名称
document.getElementById('supplier').innerHTML = row.供应商名称
document.getElementById('buyer').innerHTML = row.采购员
document.getElementById('total').innerHTML = total
exportExcelMethod('offlineContract', '离线合同', '离线合同sheet')
}).catch(res => {
console.log(res)
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}