This commit is contained in:
liushuai
2018-12-10 19:42:13 +08:00
65 changed files with 3681 additions and 402 deletions

View File

@@ -115,7 +115,8 @@ export default {
},
computed: {
...mapGetters([
'id'
'id',
'token'
])
},
created() {
@@ -145,6 +146,8 @@ export default {
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
const a = this.token
console.log(a, 1111)
},
aaa() {
print('#print')
@@ -174,9 +177,9 @@ export default {
getCraftNumber() {
CraftNumber(this.Partpaint).then(response => {
this.partNumber = response.data[0].工艺计划流水号
}).then(() => {
this.getscantable()
})
console.log(this.partNumber, 1111)
this.getscantable()
},
getPaint() {
searchPartNumber(this.partNumber).then(response => {

View File

@@ -114,7 +114,7 @@
</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="80">
@@ -147,7 +147,7 @@
</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="80">

View File

@@ -246,6 +246,7 @@
<script>
import { initWarehouse, addWarehouse, alterWarehouse, deleteWarehouse, searchLocate, addLocate, alterLocate, deleteLocate, searchPeople } from '@/api/Inventory/InventoryManagement'
import QRCode from 'qrcode'
import { mapGetters } from 'vuex'
export default {
data() {
return {
@@ -297,14 +298,26 @@ export default {
}, {
value: '0',
label: '否'
}]
}],
role: ''
}
},
computed: {
...mapGetters([
'token'
])
},
created() {
this.getTable()
this.searchPeopleData()
this.getpeopleid()
},
methods: {
// 获取人员编号
getpeopleid() {
this.role = this.token
console.log(this.role, 321312)
this.searchPeopleData()
},
// 查询仓库
getTable() {
this.tableData = []
@@ -331,7 +344,7 @@ export default {
},
searchPeopleData() { // 查询人员
this.Contactpeople = []
searchPeople().then(response => {
searchPeople(this.role).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Contactpeople.push({
label: response.data[i].姓名,

View File

@@ -0,0 +1,522 @@
<template>
<div class="app-container">
<el-card>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<span>库存状态:</span>
<el-select v-model="inventoryStateValue" placeholder="库存状态" size="small" clearable>
<el-option
v-for="item in inventoryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>仓库:</span>
<el-select v-model="purchaseStateValue" placeholder="仓库" size="small">
<el-option
v-for="item in purchaseState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-card>
<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="库存状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.库存是否不足)===1" type="danger" size="small">不足</el-tag>
<el-tag v-else type="success" size="small">充足</el-tag>
</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="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">
<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>
</el-card>
<el-card>
<span>请购单号:</span>
<el-input v-model="purchasecard" placeholder="请购单号" size="small" clearable/>
<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="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
style="margin-left: 10px"
@click="addTableData">创建离线请购单</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="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">
<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" width="100">
<template slot-scope="scope">
{{ scope.row.请购时间.split(' ')[0] }}
</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>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
<el-button style="margin-left:500px;" type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard()">传递</el-button>
</div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="离线请购单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请购单编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="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 { searchRequestCard, initWarehouse, addRequestCard, searchInventoryNum, SeeDetail, addRequestCardDetail, deleteRequest, deleteRequestDetail, alterNumber, setSafeValue } from '@/api/Inventory/OfflinePurchase'
import { mapGetters } from 'vuex'
export default {
name: '', // 离线合同
data() {
return {
purchasecard: '',
purchasecard_check: 1,
loading1: false,
title2: '',
purchaseStateValue: 2, // 采购状态 全部
purchaseState: [
{
label: '未采购',
value: 1
}, {
label: '全部',
value: 2
}
],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
materialName: '',
inventoryStateValue: '', // 库存状态
inventoryStateValue_check: 1,
inventoryState: [
{
label: '充足',
value: 2
},
{
label: '不足',
value: 1
}
],
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
offlineContractNum: '', // 离线合同流水号
offlineContract: '', // 离线合同号
supplierName0: '', // 供应商名称(外面的)
supplierName: '', // 供应商名称
payMethod: [], // 付款方式
payTime: [], // 付款时间节点
tableData2: [],
total2: 0,
pageCurrent2: 1,
pageSize2: 10,
dialogVisible1: false,
form1: {},
tableData01: [],
dialogVisible2: false,
tableData3: [],
textArea: '请选择',
materielGroup: [], // 物料流水号组
partGroup: [], // 离线合同明细流水号组
numGroup: [], // 数量组
priceGroup: [], // 单价组
totalPrice: 0, // 合同总额
tableData4: [], // 合同模板
stipulateArrivalTime: '', // 规定到货时间
payMethodName: '', // 付款方式名称
paramRow: '', // 参数row
disable2: true,
disable3: true,
disable4: true,
disable: false, // 其他的禁用
House: [],
HouseNumber: ''
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
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].仓库流水号
})
}
})
},
// 查询离线物料请购单
searchTable2() {
if (this.purchasecard === '') {
this.purchasecard_check = 0
} else {
this.purchasecard_check = 1
}
searchRequestCard(this.pageCurrent2, this.pageSize2, this.purchasecard_check, this.purchasecard).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
// 查询离线物料请购单明细
searchTable3(row) {
this.purchasecardnumber = row.离线请购单流水号
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
},
// 查询离线物料数量
searchTable1() {
if (this.materialName === '') {
this.materialName_check = 0
}
if (this.inventoryStateValue === '') {
this.inventoryStateValue_check = 0
}
searchInventoryNum(this.pageCurrent1, this.pageSize1, this.materialName_check, this.materialName, this.inventoryStateValue_check, this.inventoryStateValue).then(response => {
this.tableData1 = response.data.rows
this.tableData1.map(v => {
this.$set(v, 'changeSafeValue', false)
v.原安全库存量 = v.安全库存量
return v
})
this.total1 = response.data.total
})
},
handleSizeChange2(val) { // 离线请购单列表分页
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) { // 离线请购单列表分页
this.pageCurrent2 = val
this.searchTable2()
},
// 增加请购单
addTableData() {
if (this.HouseNumber === '') {
this.$message.error('请选择仓库')
} else {
console.log(this.id, this.HouseNumber)
addRequestCard(this.id, this.HouseNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.searchTable2()
} else {
this.$message.error('添加失败')
}
})
}
},
handleSelectionChange(val) {
this.materielGroup = []
for (let i = 0; i < val.length; i++) {
this.materielGroup.push(val[i].物料流水号)
}
},
addMateriel() { // 将物料选入离线合同
if (this.purchasecardnumber === '') {
this.$message.error('请选择请购单')
} else {
addRequestCardDetail(this.purchasecardnumber, this.materielGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else {
this.$message.error('选入失败')
}
})
}
},
deleteOfflineContract(row) { // 删除请购单
this.$confirm('确定删除该请购单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRequest(row.离线请购单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable2()
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
deleteMateriel(row) { // 删除请购单明细
this.$confirm('确定移除该物料?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRequestDetail(row.离线请购单明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移除成功')
this.searchTable2()
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('移除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
})
})
},
cancelEdit(row) { // 取消设置
row.安全库存量 = row.原安全库存量
row.changeSafeValue = false
this.$message('取消修改')
},
confirmEdit(row) { // 确认设置
Number(row.安全库存量) ? row.安全库存量 = Number(row.安全库存量) : row.安全库存量 = 0
setSafeValue(row.物料流水号, parseInt(row.安全库存量)).then(response => {
if (response.data[0].result === '1') {
row.changeSafeValue = false
this.$message.success('设置成功')
this.searchTable1()
} else {
this.$message.error('设置失败')
}
})
},
// 传递请购单
doneRequestCard() {
this.$confirm('确定传递请购单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.partGroup = []
this.numGroup = []
for (let i = 0; i < this.tableData3.length; i++) {
this.partGroup.push(this.tableData3[i].离线请购单明细流水号)
this.numGroup.push(this.tableData3[i].数量)
}
alterNumber(this.purchasecardnumber, this.partGroup, this.numGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('请购单生成成功')
this.searchTable2()
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('请购单生成失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.el-tag{
margin: 0
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 5px;
}
</style>

View File

@@ -39,6 +39,7 @@
<el-table
v-loading="listLoading1"
:data="tableDataPicking"
size="mini"
border
style="width: 100%;"
height="400">
@@ -47,12 +48,12 @@
align="center"
type="index"
width="50"/>
<el-table-column label="项目名称" align="center" min-width="130">
<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="130">
<el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
@@ -62,14 +63,19 @@
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="领用数量" align="center" min-width="130">
<el-table-column label="领用数量" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="货位" align="center" min-width="130">
<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.货位名称 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="130">
@@ -82,13 +88,29 @@
{{ scope.row.类型名称 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="80">
<el-table-column label="操作" align="center" min-width="200">
<template slot-scope="scope">
<el-button :disabled="scope.row.是否出库" size="small" type="danger" icon="el-icon-back" style="margin: 0 0 0 0px" @click="ErrorpartOut(scope.row)">异常</el-button>
<el-button :disabled="scope.row.是否出库" size="small" type="primary" icon="el-icon-back" style="margin: 0 0 0 0px" @click="partOut(scope.row)">出库</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--异常出库对话框-->
<el-dialog :visible.sync="dialogFormVisible1" title="编辑直达件" center width="380px">
<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="TotalContractAmount" label-width="100px">
<el-input v-model="form.Reason" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="editDirectPartm()"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -126,7 +148,15 @@ export default {
outNote: '', // 出库备注
getpicikingPeople: '', // 领料人
listLoading: '',
listLoading1: ''
listLoading1: '',
rules: { // 表单验证规则
ErrorNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }],
Reason: [{ required: true, message: '请选择领用人', trigger: 'blur' }]
},
form: {
ErrorNumber: '',
Reason: ''
}
}
},
computed: {
@@ -196,7 +226,7 @@ export default {
} else { this.$message.error('出库失败') }
})
} else {
BasicPart(row.工艺计划流水号, row.出库数量, row.收件信息ID, row.备注).then(response => {
BasicPart(row.工艺计划流水号, row.出库数量, row.收件信息ID, this.getpicikingPeople, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
ListDetailOut(row.领料单明细流水号)
@@ -204,6 +234,9 @@ export default {
} else { this.$message.error('增加失败') }
})
}
},
ErrorpartOut() {
console.log(21231)
}
}
}

View File

@@ -96,6 +96,16 @@
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="仓库" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.备注 }}
@@ -168,21 +178,31 @@
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="80">
<el-table-column label="数量" align="center" min-width="40">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="库存数量" align="center" min-width="80">
<el-table-column label="库存数量" align="center" min-width="40">
<template slot-scope="scope">
{{ scope.row.可出库数量 }}
</template>
</el-table-column>
<el-table-column label="待出库数量" align="center" min-width="80">
<el-table-column label="待出库数量" align="center" min-width="40">
<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" align="center">
{{ scope.row.零件图号 }}
@@ -195,7 +215,7 @@
</el-table-column>
<el-table-column label="操作" align="center" min-width="80">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="addBasicListDetailinfor(scope.row)">领料</el-button>
<el-button :disabled="scope.row.是否禁用" size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="addBasicListDetailinfor(scope.row)">领料</el-button>
</template>
</el-table-column>
</el-table>
@@ -265,6 +285,11 @@
{{ 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.类型名称 }}
@@ -633,6 +658,11 @@ export default {
this.total1 = response.data.total
})
searchBasicPart(this.PageCurrent1, this.PageSize1, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
const data = response.data.rows
console.log(data, 323423)
for (let i = 0; i < data.length; i++) {
data[i].可出库数量 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
}
this.tableDataBasic = response.data.rows
this.listLoading1 = false
this.total = response.data.total

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称</span>
<span>项目名称</span>
<el-select v-model="entryNameValue" filterable placeholder="项目名称" style="margin-right: 10px" size="small" clearable>
<el-option
v-for="item in entryName"
@@ -9,10 +9,10 @@
:label="item.label"
:value="item.value"/>
</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-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="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-badge :value="value" :max="99" class="item">
<el-button size="small" type="text" @click="AccountsReceivable">查看收款信息</el-button>
</el-badge>
@@ -27,19 +27,25 @@
height="280"
highlight-current-row
border
size="mini"
@expand-change="selectMachine"
@row-click="getTableData2">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="tableData3" border style="width: 600px; text-align: center">
<el-table-column label="设备型号" align="center">
<el-table :data="tableData3" border style="width: 600px; text-align: center" size="mini">
<el-table-column label="发货单号" align="center">
<template slot-scope="scope">
{{ scope.row.机床图 }}
{{ scope.row.发货单 }}
</template>
</el-table-column>
<el-table-column label="设备名称" align="center">
<el-table-column label="发货日期" align="center">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
{{ scope.row.发货日期 }}
</template>
</el-table-column>
<el-table-column label="运输状态" align="center">
<template slot-scope="scope">
{{ parseInt(scope.row.运输状态) === 0 ? '运输中' : '已签收' }}
</template>
</el-table-column>
</el-table>
@@ -55,7 +61,7 @@
{{ 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">
{{ scope.row.付款方式 }}
</template>
@@ -65,14 +71,14 @@
{{ scope.row.合同总金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="已支付金额(元)" width="150">
<el-table-column align="center" label="已到账金额(元)" width="150">
<template slot-scope="scope">
{{ scope.row.已支付 }}
</template>
</el-table-column>
<el-table-column align="center" label="未支付金额(元)" width="150">
<el-table-column align="center" label="未到账金额(元)" width="150">
<template slot-scope="scope">
<el-tag type="warning">{{ scope.row.未支付金额 }}</el-tag>
<el-tag size="small" style="width: 100px" type="warning">{{ scope.row.未支付金额 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="付款进度" width="150">
@@ -150,10 +156,11 @@
height="350"
highlight-current-row
border
size="mini"
@expand-change="selectMachine1">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="tableData4" border style="width: 600px; text-align: center">
<el-table :data="tableData4" border style="width: 600px; text-align: center" size="mini">
<el-table-column
align="center"
label="序号"
@@ -190,54 +197,67 @@
align="center"
label="付款批次"
type="index"
width="100"/>
<el-table-column align="center" label="应收金额(元)">
width="150"/>
<el-table-column align="center" label="应收金额(元)" width="180px">
<template slot-scope="scope">
{{ scope.row.应收金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="已收金额">
<el-table-column align="center" label="已收金额(元)" width="180px">
<template slot-scope="scope">
{{ scope.row.已收金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="未收金额">
<el-table-column align="center" label="未收金额(元)" width="180px">
<template slot-scope="scope">
<el-tag type="warning">{{ scope.row.未收金额 }}</el-tag>
<el-tag type="warning" style="width: 100px" size="small">{{ scope.row.未收金额 }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="转下阶段收款金额">
<el-table-column align="center" label="转下阶段收款金额" width="180px">
<template slot-scope="scope">
{{ scope.row.转下阶段金额 }}
</template>
</el-table-column>
<el-table-column align="center" label="提前X天提醒">
<el-table-column align="center" label="收款阶段" width="180px">
<template slot-scope="scope">
<el-input v-model="scope.row.提前x天提醒" size="small" style="width:80px" placeholder="请输入提前X天提醒" @change="editDay(scope.row)"/>
<el-select v-model="scope.row.执行进度id" filterable placeholder="请选择收款阶段" style="width: 130px" size="small" @change="changeTime(scope.row)">
<el-option
v-for="item in plannedTime"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" label="计划收款时间">
<el-table-column align="center" label="时间节点" width="180px">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.计划付款时间"
style="width:135px"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择本次付款时间"
@change="changeTime(scope.row)"/>
<span></span>
<el-input v-model="scope.row.提前x天提醒" size="small" style="width:50px" placeholder="请输入提前X天提醒" @change="editDay(scope.row)"/>
<span></span>
</template>
</el-table-column>
<el-table-column align="center" label="状态">
<el-table-column align="center" label="状态" width="100px">
<template slot-scope="scope">
<el-tag v-if="scope.row.计划付款时间===''||scope.row.计划付款时间===null" size="small">无计划</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&parseInt(scope.row.未收金额)===0" type="success" size="small">已完成</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='未开始'" type="primary" size="small">未开始</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='即将拖期'" type="warning" size="small">即将拖期</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='已拖期'" type="danger" size="small">已拖期</el-tag>
<el-popover
placement="top-start"
title="收款计划"
width="200"
trigger="hover">
<div v-show="!scope.row.计划付款时间" style="text-align: center">
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
</div>
<div v-show="scope.row.计划付款时间">
<h4>{{ scope.row.执行进度名 }}{{ scope.row.节点日期 }}完成计划于{{ scope.row.计划付款时间 }}进行收款距离计划日期还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}</h4>
</div>
<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&&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="warning" size="small" style="width: 66px">即将拖期</el-tag>
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='已拖期'" slot="reference" type="danger" size="small" style="width: 66px">已拖期</el-tag>
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="280">
<el-table-column label="操作" fixed="right" align="center" width="220">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用收款"
@@ -422,49 +442,53 @@
</div>
</el-dialog>
<el-dialog :visible.sync="AccountsReceivableVisible">
<el-table :data="gridData" :row-style="tableRowClassName" height="260">
<el-table-column property="date" label="项目名称" width="200">
<el-dialog :visible.sync="AccountsReceivableVisible" width="60%">
<el-table :data="gridData" :row-style="tableRowClassName" height="260" size="mini" border>
<el-table-column property="date" label="项目名称" width="200" align="center">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column property="name" label="客户名称">
<el-table-column property="name" label="客户名称" align="center">
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column property="address" label="联系人">
<el-table-column property="address" label="联系人" width="80px" align="center">
<template slot-scope="scope">
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column property="date" label="联系电话">
<el-table-column property="date" label="联系电话" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.电话 }}
</template>
</el-table-column>
<el-table-column property="name" label="计划收款时间" width="130px">
<el-table-column property="name" label="计划收款时间" width="130px" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款时间 }}
</template>
</el-table-column>
<el-table-column property="name" label="计划阶段">
<el-table-column property="name" label="阶段" width="60" align="center">
<template slot-scope="scope">
{{ scope.row.付款批次 }}
</template>
</el-table-column>
<el-table-column property="address" label="状态">
<el-table-column property="address" label="状态" width="70px" align="center">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column property="date" label="操作">
<el-table-column property="date" label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="success"
@click="Detail(scope.row)">立即收款</el-button>
<el-button
size="mini"
type="danger"
@click="Never(scope.row)">不再提醒</el-button>
</template>
</el-table-column>
</el-table>
@@ -474,7 +498,7 @@
<script>
import elInput from 'element-ui/packages/input'
import { searchProjectNumber2, SelectContractFunds, AccountsReceivable, editDay, TransPlanning, selectBatch, editList, delMoney, editTime, selectMax, editFukuan, fukuan, selectProvince, SelectMarketingManager, searchTable1, searchTable2, editBatchCapitalChar, deletechar, searchProjectNumber, searchProjectName, addList, PaymentPhase, dellist, selectMachine, selectBatchFundingDetails } from '@/api//MarketingCenter/ContractCapitalManagement'
import { never, executionProgressID, searchProjectNumber2, SelectContractFunds, AccountsReceivable, editDay, TransPlanning, selectBatch, editList, delMoney, editTime, selectMax, editFukuan, fukuan, selectProvince, SelectMarketingManager, searchTable1, searchTable2, editBatchCapitalChar, deletechar, searchProjectNumber, searchProjectName, addList, PaymentPhase, dellist, selectMachine, selectBatchFundingDetails } from '@/api//MarketingCenter/ContractCapitalManagement'
export default {
components: {
@@ -489,6 +513,7 @@ export default {
}
}
return {
plannedTime: [],
entryName2: [],
count1: 0,
type: '',
@@ -611,6 +636,7 @@ export default {
this.getSelect(searchProjectNumber, ['项目名称', '项目流水号'], 'entryName')
this.getSelect(searchProjectNumber2, ['项目名称', '项目流水号'], 'entryName2')
this.getSelect(PaymentPhase, ['付款阶段', '付款阶段ID'], 'PaymentPhase')
this.getSelect(executionProgressID, ['执行进度名', '执行进度ID'], 'plannedTime')
AccountsReceivable().then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
@@ -657,9 +683,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -684,7 +717,7 @@ export default {
},
changeTime(row) {
const timeid = row.批次资金id
const time = row.计划付款时间
const time = row.执行进度id
editTime(timeid, time).then(response => {
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
@@ -707,9 +740,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -759,7 +799,11 @@ export default {
selectMachine(row) {
this.projectCode = row.项目流水号
selectMachine(this.projectCode).then(response => {
this.tableData3 = response.data
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].发货日期 = data[i].发货日期.substring(0, data[i].发货日期.length - 8)
}
this.tableData3 = data
})
if (this.a === 1) {
this.expands.push(row.项目流水号)
@@ -849,6 +893,9 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未支付金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].已支付 === '0' ? data[i].是否禁用编辑 = false : data[i].是否禁用编辑 = true
if (parseFloat(data[i].付款百分比) >= 99.9) {
data[i].付款百分比 = 100
}
}
this.tableData1 = data
this.total = response.data.total
@@ -866,9 +913,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -934,9 +988,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -998,9 +1059,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1105,9 +1173,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1180,9 +1255,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1243,9 +1325,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1317,9 +1406,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1375,9 +1471,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1446,9 +1549,16 @@ export default {
for (let i = 0; i < data.length; i++) {
data[i].未收金额 === '0' ? data[i].是否禁用收款 = true : data[i].是否禁用收款 = false
data[i].未收金额 === '0' ? data[i].是否禁用 = true : data[i].是否禁用 = false
data[i].执行进度id = parseInt(data[i].执行进度id)
if (data[i].节点日期 !== '' && data[i].节点日期 !== null) {
data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8)
}
if (data[i].计划付款时间 === '' || data[i].计划付款时间 === null) {
data[i].是否禁用收款 = true
data[i].状态 = '无计划'
} else {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 8)
data[i].是否禁用收款 = false
if (data[i].未收金额 === '0') {
data[i].状态 = '已完成'
} else {
@@ -1475,6 +1585,29 @@ export default {
} else {
return ''
}
},
Never(row) {
never(row.批次资金ID).then(response => {
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
AccountsReceivable().then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].计划付款时间 = data[i].计划付款时间.substring(0, data[i].计划付款时间.length - 9)
if (data[i].状态 === '1') {
data[i].状态 = '即将拖期'
}
if (data[i].状态 === '2') {
data[i].状态 = '已拖期'
}
}
this.gridData = data
this.value = response.data.length
})
} else {
this.$message.error('信息更新失败')
}
})
}
}
}

View File

@@ -194,20 +194,21 @@
v-for="item in executionProgress"
:key="item.value"
:label="item.label"
:value="item.value"/>
:value="item.value"
:disabled ="item.disabled"/>
</el-select>
</div>
</div>
<div>
<el-steps :active="ExecutionProgress" finish-status="success" process-status="process " style="margin-left: 10px">
<el-step title="签订合同" icon="el-icon-edit-outline"/>
<el-step title="图纸会签" icon="el-icon-picture-outline"/>
<el-step title="加工制造" icon="el-icon-setting"/>
<el-step title="预备验收" icon="el-icon-view"/>
<el-step title="设备发货" icon="el-icon-sold-out"/>
<el-step title="安装调试" icon="el-icon-time"/>
<el-step title="项目验收" icon="el-icon-circle-check-outline"/>
<el-step title="质保" icon="el-icon-service"/>
<el-step :description="time1" title="签订合同" icon="el-icon-edit-outline"/>
<el-step :description="time2" title="图纸会签" icon="el-icon-picture-outline"/>
<el-step :description="time3" title="加工制造" icon="el-icon-setting"/>
<el-step :description="time4" title="预备验收" icon="el-icon-view"/>
<el-step :description="time5" title="设备发货" icon="el-icon-sold-out"/>
<el-step :description="time6" title="安装调试" icon="el-icon-time"/>
<el-step :description="time7" title="项目验收" icon="el-icon-circle-check-outline"/>
<el-step :description="time8" title="质保阶段" icon="el-icon-service"/>
</el-steps>
</div>
</el-card>
@@ -542,12 +543,31 @@
<el-button type="primary" @click="getCustomerCode"> </el-button>
</div>
</el-dialog>
<!--改变节点时间对话框-->
<el-dialog :visible.sync="dialogTimeVisible" :show-close="false" :close-on-click-modal="false" title="进度完成时间" center style="min-height: 300px" width="23%">
<el-form ref="form2" :model="form2" :rules="rules2" :disabled="disabledTime" label-width="140px">
<el-form-item label="进度完成日期" prop="进度完成日期">
<el-date-picker
v-model="form2.进度完成日期"
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('form2')">取消</el-button>
<el-button type="primary" @click="submitTime('form2')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import elInput from 'element-ui/packages/input'
import { selectBidBond, changeExecutionProgressID, initProject, searchTable1, fetchExecutionProgress, delList, addList, executionProgressID, editchar, getTree, tree, getTablePeople, fetchCustomerData, getFileData, deleteFileData, selectMachine, selectProvince, SelectMarketingManager, submitMachine, editMachine, delMachine, money } from '@/api/MarketingCenter/ContractInformationManagement'
import { searchTimeAll, searchTime, selectBidBond, changeExecutionProgressID, initProject, searchTable1, fetchExecutionProgress, delList, addList, executionProgressID, editchar, getTree, tree, getTablePeople, fetchCustomerData, getFileData, deleteFileData, selectMachine, selectProvince, SelectMarketingManager, submitMachine, editMachine, delMachine, money } from '@/api/MarketingCenter/ContractInformationManagement'
import { upload, download } from '@/utils/request'
export default {
components: {
@@ -558,6 +578,17 @@ export default {
a: 1,
b: 1,
c: 1,
time1: '',
time2: '',
time3: '',
time4: '',
time5: '',
time6: '',
time7: '',
time8: '',
disabledTime: false,
dialogTimeVisible: false,
executionProgressIDdisabled: false,
enterpriseInput: '', // 表单承接招标企业的中间变量
biddingNumber: '',
dialogFormVisibleBidding: false,
@@ -635,6 +666,9 @@ export default {
设备型号: '',
设备名称: ''
},
form2: {
进度完成日期: ''
},
title: '',
param: 0,
executionProgress: [], // 执行进度下拉框数据
@@ -651,6 +685,9 @@ export default {
rules1: { // 表单验证规则
设备型号: [{ required: true, message: '请输入设备型号', trigger: 'blur' }],
设备名称: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
},
rules2: { // 表单验证规则
进度完成日期: [{ required: true, message: '请选择进度完成日期', trigger: 'change' }]
}
}
},
@@ -723,6 +760,51 @@ export default {
fetchExecutionProgress(row.项目流水号).then(response => {
this.ExecutionProgress = response.data[0].执行进度流水号
this.executionProgressID = response.data[0].执行进度流水号
this.executionProgressID1 = response.data[0].执行进度流水号
const time = []
for (let i = 0; i < 8; i++) {
if (parseInt(response.data[0].执行进度流水号) === i) {
time.push('进行中')
} else {
time.push('未完成')
}
}
this.time1 = time[0]
this.time2 = time[1]
this.time3 = time[2]
this.time4 = time[3]
this.time5 = time[4]
this.time6 = time[5]
this.time7 = time[6]
this.time8 = time[7]
return this.projectNum
}).then(data => {
searchTimeAll(data).then(response => {
if (response.data[0].合同签订日期 !== '' && response.data[0].合同签订日期 !== null) {
this.time1 = response.data[0].合同签订日期.substring(0, response.data[0].合同签订日期.length - 8)
}
if (response.data[0].图纸会签日期 !== '' && response.data[0].图纸会签日期 !== null) {
this.time2 = response.data[0].图纸会签日期.substring(0, response.data[0].图纸会签日期.length - 8)
}
if (response.data[0].加工制造日期 !== '' && response.data[0].加工制造日期 !== null) {
this.time3 = response.data[0].加工制造日期.substring(0, response.data[0].加工制造日期.length - 8)
}
if (response.data[0].预验收日期 !== '' && response.data[0].预验收日期 !== null) {
this.time4 = response.data[0].预验收日期.substring(0, response.data[0].预验收日期.length - 8)
}
if (response.data[0].设备发货日期 !== '' && response.data[0].设备发货日期 !== null) {
this.time5 = response.data[0].设备发货日期.substring(0, response.data[0].设备发货日期.length - 8)
}
if (response.data[0].安装调试日期 !== '' && response.data[0].安装调试日期 !== null) {
this.time6 = response.data[0].安装调试日期.substring(0, response.data[0].安装调试日期.length - 8)
}
if (response.data[0].项目验收日期 !== '' && response.data[0].项目验收日期 !== null) {
this.time7 = response.data[0].项目验收日期.substring(0, response.data[0].项目验收日期.length - 8)
}
if (response.data[0].质保期日期 !== '' && response.data[0].质保期日期 !== null) {
this.time8 = response.data[0].质保期日期.substring(0, response.data[0].质保期日期.length - 8)
}
})
})
},
selectMachine(row) {
@@ -748,6 +830,52 @@ export default {
this.getFileData(this.projectNum)
fetchExecutionProgress(row.项目流水号).then(response => {
this.ExecutionProgress = response.data[0].执行进度流水号
this.executionProgressID = response.data[0].执行进度流水号
this.executionProgressID1 = response.data[0].执行进度流水号
const time = []
for (let i = 0; i < 8; i++) {
if (parseInt(response.data[0].执行进度流水号) === i) {
time.push('进行中')
} else {
time.push('未完成')
}
}
this.time1 = time[0]
this.time2 = time[1]
this.time3 = time[2]
this.time4 = time[3]
this.time5 = time[4]
this.time6 = time[5]
this.time7 = time[6]
this.time8 = time[7]
return this.projectNum
}).then(data => {
searchTimeAll(data).then(response => {
if (response.data[0].合同签订日期 !== '' && response.data[0].合同签订日期 !== null) {
this.time1 = response.data[0].合同签订日期.substring(0, response.data[0].合同签订日期.length - 8)
}
if (response.data[0].图纸会签日期 !== '' && response.data[0].图纸会签日期 !== null) {
this.time2 = response.data[0].图纸会签日期.substring(0, response.data[0].图纸会签日期.length - 8)
}
if (response.data[0].加工制造日期 !== '' && response.data[0].加工制造日期 !== null) {
this.time3 = response.data[0].加工制造日期.substring(0, response.data[0].加工制造日期.length - 8)
}
if (response.data[0].预验收日期 !== '' && response.data[0].预验收日期 !== null) {
this.time4 = response.data[0].预验收日期.substring(0, response.data[0].预验收日期.length - 8)
}
if (response.data[0].设备发货日期 !== '' && response.data[0].设备发货日期 !== null) {
this.time5 = response.data[0].设备发货日期.substring(0, response.data[0].设备发货日期.length - 8)
}
if (response.data[0].安装调试日期 !== '' && response.data[0].安装调试日期 !== null) {
this.time6 = response.data[0].安装调试日期.substring(0, response.data[0].安装调试日期.length - 8)
}
if (response.data[0].项目验收日期 !== '' && response.data[0].项目验收日期 !== null) {
this.time7 = response.data[0].项目验收日期.substring(0, response.data[0].项目验收日期.length - 8)
}
if (response.data[0].质保期日期 !== '' && response.data[0].质保期日期 !== null) {
this.time8 = response.data[0].质保期日期.substring(0, response.data[0].质保期日期.length - 8)
}
})
})
selectMachine(row.项目流水号).then(response => {
this.tableData2 = response.data
@@ -839,7 +967,6 @@ export default {
this.form.bidding = row.招标企业
this.disabled = true
this.temp = 2
this.infoDisable = false
},
chaEdit() {
editchar(this.form.EntryName, this.form.drawingJointSignNode, this.form.EquipmentPreAcceptanceNode, this.form.ConsignmentNode, this.form.installDebugNode, this.id1, this.form.executionProgressID, this.CustomerCode, this.form.remark, this.hetongID, this.form.付款方式, this.form.contractSigningDate, this.biddingNumber).then(response => {
@@ -858,6 +985,52 @@ export default {
this.action = `${upload}?&ProjectNum=${this.hetongID}`
fetchExecutionProgress(this.hetongID).then(response => {
this.ExecutionProgress = response.data[0].执行进度流水号
this.executionProgressID = response.data[0].执行进度流水号
this.executionProgressID1 = response.data[0].执行进度流水号
const time = []
for (let i = 0; i < 8; i++) {
if (parseInt(response.data[0].执行进度流水号) === i) {
time.push('进行中')
} else {
time.push('未完成')
}
}
this.time1 = time[0]
this.time2 = time[1]
this.time3 = time[2]
this.time4 = time[3]
this.time5 = time[4]
this.time6 = time[5]
this.time7 = time[6]
this.time8 = time[7]
return this.hetongID
}).then(data => {
searchTimeAll(data).then(response => {
if (response.data[0].合同签订日期 !== '' && response.data[0].合同签订日期 !== null) {
this.time1 = response.data[0].合同签订日期.substring(0, response.data[0].合同签订日期.length - 8)
}
if (response.data[0].图纸会签日期 !== '' && response.data[0].图纸会签日期 !== null) {
this.time2 = response.data[0].图纸会签日期.substring(0, response.data[0].图纸会签日期.length - 8)
}
if (response.data[0].加工制造日期 !== '' && response.data[0].加工制造日期 !== null) {
this.time3 = response.data[0].加工制造日期.substring(0, response.data[0].加工制造日期.length - 8)
}
if (response.data[0].预验收日期 !== '' && response.data[0].预验收日期 !== null) {
this.time4 = response.data[0].预验收日期.substring(0, response.data[0].预验收日期.length - 8)
}
if (response.data[0].设备发货日期 !== '' && response.data[0].设备发货日期 !== null) {
this.time5 = response.data[0].设备发货日期.substring(0, response.data[0].设备发货日期.length - 8)
}
if (response.data[0].安装调试日期 !== '' && response.data[0].安装调试日期 !== null) {
this.time6 = response.data[0].安装调试日期.substring(0, response.data[0].安装调试日期.length - 8)
}
if (response.data[0].项目验收日期 !== '' && response.data[0].项目验收日期 !== null) {
this.time7 = response.data[0].项目验收日期.substring(0, response.data[0].项目验收日期.length - 8)
}
if (response.data[0].质保期日期 !== '' && response.data[0].质保期日期 !== null) {
this.time8 = response.data[0].质保期日期.substring(0, response.data[0].质保期日期.length - 8)
}
})
})
},
clear() {
@@ -967,16 +1140,25 @@ export default {
this.deleteRow(delMachine, row.机床流水号, a)
},
changeExecutionProgressID() {
changeExecutionProgressID(this.executionProgressID, this.projectNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
fetchExecutionProgress(this.projectNum).then(response => {
this.ExecutionProgress = response.data[0].执行进度流水号
})
} else {
this.$message.error('信息更新失败')
}
this.dialogTimeVisible = true
if (parseInt(this.executionProgressID) === 1) {
this.disabledTime = true
} else {
this.disabledTime = false
}
searchTime(this.projectNum, this.executionProgressID).then(response => {
this.form2.进度完成日期 = response.data[0].进度完成日期
})
// changeExecutionProgressID(this.executionProgressID, this.projectNum).then(response => {
// if (response.data[0].result === '1') {
// this.$message.success('信息更新成功')
// fetchExecutionProgress(this.projectNum).then(response => {
// this.ExecutionProgress = response.data[0].执行进度流水号
// })
// } else {
// this.$message.error('信息更新失败')
// }
// })
},
openBidding() {
this.dialogFormVisibleBidding = true
@@ -985,7 +1167,9 @@ export default {
selectBidBond(0, '', 0, '', 0, '', 1, this.enterprise, 0, '', 0, '').then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].投标日期 = data[i].投标日期.substring(0, data[i].投标日期.length - 8)
if (data[i].投标日期 !== '' && data[i].投标日期 !== null) {
data[i].投标日期 = data[i].投标日期.substring(0, data[i].投标日期.length - 8)
}
}
this.tableDataBidding = data
})
@@ -1001,6 +1185,78 @@ export default {
getBidding() {
this.form.bidding = this.enterpriseInput
this.dialogFormVisibleBidding = false
},
offBidding() {
this.dialogFormVisibleBidding = false
this.biddingNumber = ''
},
callOffTime() {
this.dialogTimeVisible = false
this.executionProgressID = this.executionProgressID1
},
submitTime(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
changeExecutionProgressID(this.executionProgressID, this.projectNum, this.form2.进度完成日期).then(response => {
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.dialogTimeVisible = false
fetchExecutionProgress(this.projectNum).then(response => {
this.ExecutionProgress = response.data[0].执行进度流水号
this.executionProgressID = response.data[0].执行进度流水号
this.executionProgressID1 = response.data[0].执行进度流水号
const time = []
for (let i = 0; i < 8; i++) {
if (parseInt(response.data[0].执行进度流水号) === i) {
time.push('进行中')
} else {
time.push('未完成')
}
}
this.time1 = time[0]
this.time2 = time[1]
this.time3 = time[2]
this.time4 = time[3]
this.time5 = time[4]
this.time6 = time[5]
this.time7 = time[6]
this.time8 = time[7]
return this.projectNum
}).then(data => {
searchTimeAll(data).then(response => {
if (response.data[0].合同签订日期 !== '' && response.data[0].合同签订日期 !== null) {
this.time1 = response.data[0].合同签订日期.substring(0, response.data[0].合同签订日期.length - 8)
}
if (response.data[0].图纸会签日期 !== '' && response.data[0].图纸会签日期 !== null) {
this.time2 = response.data[0].图纸会签日期.substring(0, response.data[0].图纸会签日期.length - 8)
}
if (response.data[0].加工制造日期 !== '' && response.data[0].加工制造日期 !== null) {
this.time3 = response.data[0].加工制造日期.substring(0, response.data[0].加工制造日期.length - 8)
}
if (response.data[0].预验收日期 !== '' && response.data[0].预验收日期 !== null) {
this.time4 = response.data[0].预验收日期.substring(0, response.data[0].预验收日期.length - 8)
}
if (response.data[0].设备发货日期 !== '' && response.data[0].设备发货日期 !== null) {
this.time5 = response.data[0].设备发货日期.substring(0, response.data[0].设备发货日期.length - 8)
}
if (response.data[0].安装调试日期 !== '' && response.data[0].安装调试日期 !== null) {
this.time6 = response.data[0].安装调试日期.substring(0, response.data[0].安装调试日期.length - 8)
}
if (response.data[0].项目验收日期 !== '' && response.data[0].项目验收日期 !== null) {
this.time7 = response.data[0].项目验收日期.substring(0, response.data[0].项目验收日期.length - 8)
}
if (response.data[0].质保期日期 !== '' && response.data[0].质保期日期 !== null) {
this.time8 = response.data[0].质保期日期.substring(0, response.data[0].质保期日期.length - 8)
}
})
})
} else {
this.$message.error('信息更新失败')
this.executionProgressID = this.executionProgressID1
}
})
}
})
}
}
}

View File

@@ -1,102 +1,214 @@
<template>
<div class="app-container">
<el-card>
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-tabs type="border-card" @tab-click="searchTable11();searchTable12()">
<el-tab-pane label="标准件和外购件">
<el-row style="margin-bottom: 10px">
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent11=1;pageSize11=10;total11=0;searchTable11()">查询</el-button>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData11"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="物料类别" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column label="物料品种" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<el-pagination
:current-page="pageCurrent11"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize11"
:total="total11"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange11"
@current-change="handleCurrentChange11"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件">
<el-row style="margin-bottom: 10px">
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent12=1;pageSize12=10;total12=0;searchTable12()">查询</el-button>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData12"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="partChange(scope.row)">零件变更</el-button>
</template>
</el-table-column>
<el-table-column label="零件状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="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="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<el-pagination
:current-page="pageCurrent12"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize12"
:total="total12"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange12"
@current-change="handleCurrentChange12"/>
</div>
</el-tab-pane>
</el-tabs>
<el-card>
<el-table
v-loading=""
:data="tableData1"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="库存量" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.库存量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<el-card style="margin-top: 15px">
<span>询价单号:</span>
<el-input v-model="inquirySheetNum" placeholder="询价单号" size="small" clearable/>
<span>供应商:</span>
@@ -168,24 +280,24 @@
@current-change="handleCurrentChange2"/>
</div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="物料名称" align="center" min-width="150">
<el-table-column label="图号" align="center" min-width="200">
<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="150">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
{{ scope.row.组件零件流水号 ? 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="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.数量 }}
</template>
</el-table-column>
<el-table-column label="询价单编号" align="center" min-width="70">
@@ -312,7 +424,7 @@
</el-form>
</el-dialog>
<el-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="400px">
<el-dialog :visible.sync="dialogVisible2" :title="title2" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px">
<el-form-item label="询价单号" prop="inquirySheetNum">
<el-input v-model="form2.inquirySheetNum" size="small"/>
@@ -379,8 +491,8 @@
</template>
<script>
import { searchMaterial, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet, outInquirySheet, searchAllMaterial, materialChange } from '@/api/PurchasingCenter/CreateInquirySheet'
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
export default {
@@ -400,10 +512,14 @@ export default {
value: 3
}],
materialName: '',
tableData1: [], // 采购任务单明细
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData11: [], // 标准件和外购件列表
total11: 0,
pageCurrent11: 1,
pageSize11: 10,
tableData12: [], // 基本件列表
total12: 0,
pageCurrent12: 1,
pageSize12: 10,
supplierFilters: [{ text: '', value: '' }],
tableData2: [], // 询价单列表
total2: 0,
@@ -439,7 +555,7 @@ export default {
openingBank: '', // 开户行
phone: '', // 电话号码
fax: '', // 传真
tableData01: [],
tableData01: [], // 供应商
dialogVisible2: false,
form2: {
inquirySheetNumValue: '', // 询价单流水号
@@ -452,6 +568,7 @@ export default {
supplierName: [{ required: true, message: '请选择供应商' }]
},
groupPartNum: [], // 组件零件流水号
groupPartBasicNum: [], // 组件零件基本件流水号
allNum: [], // 总数量
dialogVisible3: false,
materialName0: '',
@@ -476,34 +593,50 @@ export default {
])
},
created() {
this.fetchData()
this.searchTable11() // 查表1
this.searchTable2() // 查表2
},
methods: {
fetchData() {
},
selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
},
filterHandler(value, row) { // 筛选供货商
return row['供货商'] === value
},
searchTable1() { // 查询物料列表
searchTable11() { // 查询标准件和外购件列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
searchMaterial(this.pageCurrent1, this.pageSize1, this.check1, this.inquiryStateValue, this.check2, this.materialName, this.id).then(response => {
this.tableData1 = response.data.rows
searchMaterial(this.pageCurrent11, this.pageSize11, this.check1, this.inquiryStateValue, this.check2, this.materialName, this.id).then(response => {
this.tableData11 = response.data.rows
console.log(response.data.rows)
this.total1 = response.data.total
this.total11 = response.data.total
})
},
handleSizeChange1(val) { // 物料列表分页
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
handleSizeChange11(val) { // 标准件和外购件列表分页
this.pageSize11 = val
this.pageCurrent11 = 1
this.searchTable11()
},
handleCurrentChange1(val) { // 物料列表分页
this.pageCurrent1 = val
this.searchTable1()
handleCurrentChange11(val) { // 标准件和外购件列表分页
this.pageCurrent11 = val
this.searchTable11()
},
searchTable12() { // 查询基本件列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
searchPart(this.pageCurrent12, this.pageSize12, this.check1, this.inquiryStateValue, this.id).then(response => {
this.tableData12 = response.data.rows
console.log(response.data.rows)
this.total12 = response.data.total
})
},
handleSizeChange12(val) { // 基本件列表分页
this.pageSize12 = val
this.pageCurrent12 = 1
this.searchTable12()
},
handleCurrentChange12(val) { // 基本件列表分页
this.pageCurrent12 = val
this.searchTable12()
},
searchTable2() { // 查询询价单列表
this.supplierName ? this.check3 = 1 : this.check3 = 0
@@ -522,14 +655,14 @@ export default {
this.searchTable2()
},
createInquirySheet() { // 创建空单据--询价单
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.title2 = '创建询价单'
this.form2.inquirySheetNum = ''
this.form2.supplierValue = ''
this.form2.supplierName = ''
this.dialogVisible2 = true
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
},
submitCreateInquirySheet() { // 提交创建询价单
this.$refs['form2'].validate((valid) => {
@@ -573,7 +706,6 @@ export default {
this.inquirySheetNum = ''
this.supplierName = ''
this.supplierValue = ''
this.searchTable1()
this.searchTable2()
} else { this.$message.error('删除失败') }
})
@@ -633,19 +765,19 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
import('@/vendor/Export2Excelcjn').then(excel => {
const tHeader = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '数量', '单价', '备注'] // 表头内容
const filterVal = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '零件数量'] // tableData3里的属性名
const list = this.tableData3
const data = list.map(v => filterVal.map(j => v[j]))
excel.export_json_to_excel({
header: tHeader,
data,
filename: row.询价单编号 + '_' + row.供应商名称,
autoWidth: true,
bookType: 'xlsx'
})
})
// import('@/vendor/Export2Excelcjn').then(excel => {
// const tHeader = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '数量', '单价', '备注'] // 表头内容
// const filterVal = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '零件数量'] // tableData3里的属性名
// const list = this.tableData3
// const data = list.map(v => filterVal.map(j => v[j]))
// excel.export_json_to_excel({
// header: tHeader,
// data,
// filename: row.询价单编号 + '_' + row.供应商名称,
// autoWidth: true,
// bookType: 'xlsx'
// })
// })
}).catch(() => {
this.$message({
type: 'info',
@@ -653,8 +785,7 @@ export default {
})
})
},
handleSelectionChange(val) { // 表1多选
console.log(val)
handleSelectionChange1(val) { // 标准件和外购件多选
this.groupPartNum = []
this.allNum = []
for (let i = 0; i < val.length; i++) {
@@ -662,50 +793,90 @@ export default {
this.allNum[i] = val[i].零件数量
}
},
handleSelectionChange2(val) { // 基本件多选
this.groupPartBasicNum = []
this.allNum = []
for (let i = 0; i < val.length; i++) {
this.groupPartBasicNum[i] = val[i].组件零件基本件流水号
this.allNum[i] = val[i].数量
}
},
addInquirySheet() { // 追加物料
const numGroup2 = [] // 空数组,放该询价单中已有的物料
const numGroup1 = [] // 空数组,放该询价单中已有的组件零件流水号
const numGroup2 = [] // 空数组,放该询价单中已有的组件零件基本件流水号
if (this.inquirySheetNum === '' || this.inquirySheetNum === null) {
this.$message.error('请选择一个询价单')
} else if (this.groupPartNum.length === 0 && this.groupPartBasicNum.length === 0) {
this.$message.error('请选择待询价物料或零件')
} else {
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
for (let i = 0; i < response.data.length; i++) {
numGroup2.push(response.data[i].组件零件流水号)
numGroup1.push(response.data[i].组件零件流水号)
numGroup2.push(response.data[i].组件零件基本件流水号)
}
}).then(() => {
let x = true // 为了只执行一次的中间变量
for (let i = 0; i < this.groupPartNum.length; i++) {
if (numGroup2.indexOf(parseInt(this.groupPartNum[i])) !== -1) {
if (x) {
this.$notify({
title: '注意',
message: '无法向该询价单中追加重复物料,已自动跳过',
type: 'warning'
})
x = false
}
} else {
addInquirySheet(this.inquirySheetFlowNum, this.groupPartNum[i], this.allNum[i], 0, '').then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
if (this.groupPartBasicNum.length === 0) { // 标准件和外购件
for (let i = 0; i < this.groupPartNum.length; i++) {
if (numGroup1.indexOf(parseInt(this.groupPartNum[i])) !== -1) {
if (x) {
this.$notify({
title: '注意',
message: '无法向该询价单中追加重复物料,已自动跳过',
type: 'warning'
})
} else { this.$message.error('操作失败') }
})
x = false
}
} else {
addInquirySheet1(this.inquirySheetFlowNum, this.groupPartNum[i], this.allNum[i]).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable11()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('操作失败') }
})
}
}
} else { // 基本件
for (let i = 0; i < this.groupPartBasicNum.length; i++) {
if (numGroup2.indexOf(parseInt(this.groupPartBasicNum[i])) !== -1) {
if (x) {
this.$notify({
title: '注意',
message: '无法向该询价单中追加重复零件,已自动跳过',
type: 'warning'
})
x = false
}
} else {
addInquirySheet2(this.inquirySheetFlowNum, this.groupPartBasicNum[i], this.allNum[i]).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable12()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
} else {
this.$message.error('操作失败')
}
})
}
}
}
})
}
},
outInquirySheet(row) {
outInquirySheet(row.询价单流水号, row.组件零件流水号).then(response => {
outInquirySheet(row.询价单明细流水号, row.组件零件流水号, row.组件零件基本件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
this.searchTable11()
this.searchTable12()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
this.$message.success('操作成功')
} else { this.$message.error('操作失败') }
})
},
@@ -761,23 +932,23 @@ export default {
submitSelectSupplier() { // 确定选择供应商
this.dialogVisible1 = false
},
searchTable3(row) { // 查询该询价单中的物料
searchTable3(row) { // 查询该询价单中的物料和零件
this.tableData3 = []
this.inquirySheetNum = row.询价单编号
this.inquirySheetFlowNum = row.询价单流水号
this.supplierValue = row.供应商流水号
this.supplierName = row.供应商名称
searchSheetDetail(row.询价单流水号).then(response => {
this.tableData3 = response.data
})
},
materialChange(row) { // 物料变更
materialChange(row) { // 物料变更 标准件和外购件
this.dialogVisible3 = true
console.log(row)
this.groupPartNumValue = row.组件零件流水号
this.standardAndPurchaseValue = row.标准件和外购件流水号
this.materialOldValue = row.物料流水号
},
partChange(row) { // 零件变更 基本件
alert('没有基本件库,你想替换啥?')
console.log(row)
},
searchMaterial() {
searchAllMaterial(this.materialName0, this.pageCurrent02, this.pageSize02).then(response => {
this.tableData02 = response.data.result
@@ -802,10 +973,9 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('提交变更申请成功')
this.dialogVisible3 = false
this.searchTable1()
this.searchTable11()
} else { this.$message.error('操作失败') }
})
console.log(this.groupPartNumValue, this.standardAndPurchaseValue, this.materialOldValue, this.materialNewValue)
},
tableRowClassName({ row, rowIndex }) {
if (parseInt(row.是否确认) === 0) {

View File

@@ -0,0 +1,538 @@
<template>
<div class="components-container">
<el-card>
<el-form label-width="90px" label-position="right">
<el-row>
<el-col :span="6">
<el-form-item label="合同编号:">
<el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange">
<el-option
v-for="item in contractNums"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商:">
<el-input v-model="supplierName" size="small" readonly/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同名称:">
<el-input v-model="contractName" size="small"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否含税:">
<el-input v-model="taxRate" size="small"/>
</el-form-item>
</el-col>
<el-col :span="1">
<el-tooltip :content="haTtax" placement="top">
<el-switch
v-model="haTtax"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="含税"
inactive-value="未税"
style="margin: 10px"/>
</el-tooltip>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="支付日期:">
<el-input v-model="payDate" size="small" type="textarea" rows="1"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="支付方式:">
<el-input v-model="payMethod" size="small" type="textarea" rows="1"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="开票信息:">
<el-input v-model="invoiceInfo" size="small" type="textarea" rows="1"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其他说明:">
<el-input v-model="otherInfo" size="small" type="textarea" rows="1"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="tableData1" border style="margin-bottom: 10px;max-height: 300px;" height="300px" size="mini" show-summary>
<el-table-column label="序号" align="center" width="50" type="index"/>
<el-table-column label="交货期" align="center" min-width="130">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.交货期"
size="mini"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 130px"/>
</template>
</el-table-column>
<el-table-column label="图号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="150">
<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 v-show="haTtax==='未税'" label="单价(未税)" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-show="haTtax==='未税'" v-model="scope.row.未税单价" size="mini" style="width:70px"/>
<span v-show="haTtax!=='未税'"></span>
</template>
</el-table-column>
<el-table-column v-show="haTtax==='含税'" label="单价(含税)" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-show="haTtax==='含税'" v-model="scope.row.含税单价" size="mini" style="width:70px"/>
<span v-show="haTtax!=='含税'"></span>
</template>
</el-table-column>
<el-table-column label="总额(未税)" align="center" min-width="100" prop="未税总额">
<template slot-scope="scope">
{{ haTtax==='未税' ? scope.row.未税总额 = (Number(scope.row.数量) * Number(scope.row.未税单价)).toFixed(2) : scope.row.未税总额 = (scope.row.含税总额 / (1+taxRate)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="总额(含税)" align="center" min-width="100" prop="含税总额">
<template slot-scope="scope">
{{ haTtax==='含税' ? scope.row.含税总额 = (Number(scope.row.数量) * Number(scope.row.含税单价)).toFixed(2) : scope.row.含税总额 = (scope.row.未税总额 * (1+taxRate)).toFixed(2) }}
</template>
</el-table-column>
</el-table>
<span>合同模板</span>
<el-radio-group v-model="demoRadio" size="small" @change="demoChange">
<el-radio-button label="模板1"/>
<el-radio-button label="模板2"/>
<el-radio-button label="模板3"/>
<el-radio-button label="自定义"/>
</el-radio-group>
<el-button type="primary" plain size="small" style="margin-left:10px;" @click="editContract()">调整合同</el-button>
<el-button type="success" size="small" @click="generateContract()">生成合同</el-button>
<div style="float: right">
<span>合同总额</span>
<el-input v-model="actualTotal" size="small" style="width: 100px"/>
<el-button type="primary" size="small" @click="submitTotal()">确定总额</el-button>
</div>
<hr>
<!--html代码-->
<div v-show="false">{{ content }}</div>
<!--富文本编辑器-->
<div v-show="!preview" id="tinymce" style="height:650px;">
<tinymce ref="tinymce" :height="500" v-model="contentNew" style="width:800px;margin: 0 auto"/>
</div>
<!--网页预览-->
<div v-show="preview" class="editor-content" style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="content"/>
</el-card>
</div>
</template>
<script>
import Tinymce from '@/components/Tinymce'
import QRCode from 'qrcode'
import { searchInquirySheet, searchSheetContract } from '@/api/PurchasingCenter/CreatePurchaseContract'
import { convertCurrency } from '@/vendor/int2Chinese'
import { mapGetters } from 'vuex'
export default {
components: { Tinymce },
data() {
return {
haTtax: '未税',
taxRate: 0.16,
preview: false, // 预览
demoRadio: '自定义', // 模板radio
content: ``, // 合同格式模板
contentNew: ``, // tinymce的
contractName: '采购合同', // 合同名称
contractNum: '', // 合同编号
contractNums: [], // 合同编号数组
contractNumValue: '', // 合同流水号
supplierName: '', // 供应商名称
supplierAddress: '', // 供应商地址
untaxTotal: '', // 未税合计
tax: '', // 税额
taxTotal: '', // 含税合计
actualTotal: '', // 实际金额
actualTotal_zh: '', // 实际金额大写
payDate: '', // 支付日期
payMethod: '', // 支付方式
invoiceInfo: '', // 开票信息
otherInfo: '', // 其他说明
tableData1: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
searchInquirySheet(0, 0, 0, 0, 1, this.id).then(response => { // 初始化询价单号
for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({
value: response.data[i].询价单流水号,
label: response.data[i].询价单编号,
supplierName: response.data[i].供应商名称
})
}
})
},
submitTotal() { // 确定合同总额
this.$refs.tinymce.destroyTinymce()
document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal
document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal
document.getElementById('actualTotal_zh').innerHTML = convertCurrency(this.actualTotal)
this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
this.$refs.tinymce.initTinymce()
},
contractChange() { // 选择合同select
for (let i = 0; i < this.contractNums.length; i++) {
if (this.contractNums[i].value === this.contractNumValue) {
this.supplierName = this.contractNums[i].supplierName
this.contractNum = this.contractNums[i].label
}
}
this.searchContractDetail()
},
searchContractDetail() { // 查询合同明细
this.tableData1 = []
searchSheetContract(this.contractNumValue).then(response => {
console.log(response.data, 111)
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({ // 组件零件流水号
交货期: response.data[i].组件零件流水号 ? response.data[i].标准件和外购件交货期 : response.data[i].基本件交货期,
图号: response.data[i].组件零件流水号 ? response.data[i].物料型号 : response.data[i].零件图号,
名称: response.data[i].组件零件流水号 ? response.data[i].物料名称 : response.data[i].零件名称,
规格: response.data[i].组件零件流水号 ? response.data[i].物料规格 : response.data[i].规格,
数量: response.data[i].数量,
未税单价: 0,
未税总额: 0,
含税单价: 0,
含税总额: 0
})
}
})
console.log(this.tableData1, 222)
},
demoChange() { // 模板change
switch (this.demoRadio) {
case '模板1':
this.demo1()
break
case '模板2':
this.demo2()
break
case '模板3':
this.demo3()
break
case '自定义':
this.customization()
break
}
},
demo1() { // 选择合同模板1
this.content = `
<h1 style="text-align: center;">
<strong>采购合同</strong>
</h1>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 25%; text-align: center;" rowspan="2">
<h1>
<strong>GAOJING</strong>
</h1>
</td>
<td style="width: 25%;">
<h4 style="text-align: center;">合同名称:</h4>
</td>
<td id="contractName" style="width: 25%;text-align: center;">&nbsp;</td>
<td style="width: 25%;text-align: center;" rowspan="2"><img id="qrCode"></td>
</tr>
<tr>
<td style="width: 25%;">
<h4 style="text-align: center;">合同编号:</h4>
</td>
<td id="contractNum" style="width: 25%;text-align: center;">&nbsp;</td>
</tr>
</tbody>
</table>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 25%;">买方:</td>
<td style="width: 25%;">江苏高精机电装配有限公司</td>
<td style="width: 25%;">卖方:</td>
<td id="supplierName" style="width: 25%;">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">地址:</td>
<td style="width: 25%;">盐城市开放大道666号</td>
<td style="width: 25%;">地址:</td>
<td id="supplierAddress" style="width: 25%;">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">法定代表人:</td>
<td style="width: 25%;">徐秀兵</td>
<td style="width: 25%;">法定代表人:</td>
<td style="width: 25%;">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">电话:</td>
<td style="width: 25%;">&nbsp;</td>
<td style="width: 25%;">电话:</td>
<td style="width: 25%;">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">传真:</td>
<td style="width: 25%;">&nbsp;</td>
<td style="width: 25%;">传真:</td>
<td style="width: 25%;">&nbsp;</td>
</tr>
</tbody>
</table>
<p>根据中华人民共和国合同法及相关法律法规,经买卖双方平等协商,就卖方向买方出售合同项下产品事宜达成一致,签订本合同(明细表及合同通用条款)如下:</p>
<table style="border-collapse: collapse; width: 100%;"
border="1">
<tbody>
<tr>
<td style="width: 25%;">合同总额(人民币含税):</td>
<td class="actualTotal" style="width: 25%;"></td>
<td style="width: 25%;">大写:</td>
<td id="actualTotal_zh" style="width: 25%;"></td>
</tr>
<tr>
<td style="width: 25%;">交货日期:</td>
<td style="width: 25%;" colspan="3">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;" rowspan="3">交货地点:</td>
<td style="width: 25%;">地址:</td>
<td style="width: 25%;" colspan="2">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">联系人:</td>
<td style="width: 25%;" colspan="2">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">联系电话:</td>
<td style="width: 25%;" colspan="2">&nbsp;</td>
</tr>
<tr>
<td style="width: 25%;">开票信息:</td>
<td style="width: 25%;" colspan="3">
<p id="invoiceInfo">&nbsp;</p>
</td>
</tr>
<tr>
<td style="width: 25%;">支付日期:</td>
<td style="width: 25%;" colspan="3">
<p id="payDate">&nbsp;</p>
</td>
</tr>
<tr>
<td style="width: 25%;">支付方式:</td>
<td style="width: 25%;" colspan="3">
<p id="payMethod">&nbsp;</p>
</td>
</tr>
<tr>
<td style="width: 25%;">其他说明:</td>
<td style="width: 25%;" colspan="3">
<p id="otherInfo">&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 50%;">
<p>买方:</p>
<p>(盖章)</p>
<p>授权代表人_______________</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</td>
<td style="width: 50%;">
<p>卖方:</p>
<p>(盖章)</p>
<p>授权代表人_______________&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: right;">日期______年______月______日</p>
<hr />
<p style="text-align: center;">
<strong>明细表</strong>
</p>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody id="tbody">
<tr id="tableHead">
<td style="width: 5%;">序号</td>
<td style="width: 10%;">图号</td>
<td style="width: 10%;">名称</td>
<td style="width: 10%;">规格型号</td>
<td style="width: 5%;">数量</td>
<td style="width: 10%;">单价金额</td>
<td style="width: 10%;">合计金额</td>
<td style="width: 12%;">交货时间</td>
<td style="width: 10%;">备注</td>
</tr>
</tbody>
</table>
<br>
<span>未税合计:</span><span id="untaxTotal"></span><br><br>
<span>税额:</span><span id="tax"></span><br><br>
<span>含税总价税率17%</span><span id="taxTotal"></span><br><br>
<span>优惠后含税总价:</span><span class="actualTotal"></span><br><br>
`
},
editContract() { // 选择一个询价单,整成合同明细
this.$refs.tinymce.destroyTinymce()
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
}
const str = this.contractNumValue.toString()
QRCode.toDataURL(str, opts, function(err, url) {
if (err) throw err
if (document.getElementById('qrCode')) {
const img = document.getElementById('qrCode')
img.src = url
}
})
this.supplierAddress = '无锡市新区新畅南路3号'
document.getElementById('contractName') ? document.getElementById('contractName').innerHTML = this.contractName : ''
document.getElementById('contractNum') ? document.getElementById('contractNum').innerHTML = this.contractNum : ''
document.getElementById('supplierName') ? document.getElementById('supplierName').innerHTML = this.supplierName : ''
document.getElementById('supplierAddress') ? document.getElementById('supplierAddress').innerHTML = this.supplierAddress : ''
document.getElementById('payDate') ? document.getElementById('payDate').innerHTML = this.payDate : ''
document.getElementById('payMethod') ? document.getElementById('payMethod').innerHTML = this.payMethod : ''
document.getElementById('invoiceInfo') ? document.getElementById('invoiceInfo').innerHTML = this.invoiceInfo : ''
document.getElementById('otherInfo') ? document.getElementById('otherInfo').innerHTML = this.otherInfo : ''
// 明细表
// 移出旧数据
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('tbody')
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.tableData1.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td style="width: 5%;"></td><td style="width: 10%;"></td><td style="width: 10%;"></td><td style="width: 10%;"></td><td style="width: 5%;"></td><td style="width: 10%;"></td><td style="width: 10%;"></td><td style="width: 12%;"></td><td style="width: 10%;"></td>'
document.getElementById('tableHead') ? document.getElementById('tableHead').after(tr[i]) : ''
}
this.actualTotal = 0
this.untaxTotal = 0
this.taxTotal = 0
for (let j = 0; j < this.tableData1.length; j++) {
this.actualTotal += Number(this.tableData1[j].含税总额)
this.untaxTotal += Number(this.tableData1[j].未税总额)
this.taxTotal += Number(this.tableData1[j].含税总额)
if (document.getElementsByClassName('tableData')[j]) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = this.tableData1[j].图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = this.tableData1[j].名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData1[j].规格
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData1[j].数量
this.haTtax === '含税' ? document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData1[j].含税单价 : document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData1[j].未税单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = Number(document.getElementsByClassName('tableData')[j].children[5].innerHTML) * Number(this.tableData1[j].数量)
this.tableData1[j].交货期 ? document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.tableData1[j].交货期.split(' ')[0] : document.getElementsByClassName('tableData')[j].children[7].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[8].innerHTML = `备注` + j
}
}
this.actualTotal = this.actualTotal.toFixed(2)
this.actualTotal = this.untaxTotal.toFixed(2)
this.actualTotal = this.taxTotal.toFixed(2)
this.tax = (this.taxTotal - this.untaxTotal).toFixed(2)
document.getElementById('untaxTotal') ? document.getElementById('untaxTotal').innerHTML = this.untaxTotal : ''
document.getElementById('tax') ? document.getElementById('tax').innerHTML = this.tax : ''
document.getElementById('taxTotal') ? document.getElementById('taxTotal').innerHTML = this.taxTotal : ''
document.getElementsByClassName('actualTotal') ? document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal : ''
document.getElementsByClassName('actualTotal') ? document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal : ''
document.getElementById('actualTotal_zh') ? document.getElementById('actualTotal_zh').innerHTML = this.actualTotal_zh : ''
this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
this.$refs.tinymce.initTinymce()
},
demo2() {
this.content = `demo2`
},
demo3() {
this.content = `demo3`
},
customization() { // 自定义
this.content = `自定义`
},
generateContract() { // 生成采购合同
this.content = this.contentNew // 更新tinymce中的东西到html中后续会用到
if (this.contractNumValue) {
this.$confirm('此操作将生成采购合同,确认完成编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
} else {
this.$message.warning('请先选择合同进行编辑')
}
}
}
}
</script>
<style scoped>
.editor-content{
margin-top: 20px;
}
span{
margin: 0 0 0 20px;
}
</style>

View File

@@ -1,18 +1,16 @@
<template>
<div class="app-container">
<el-row :gutter="10">
<el-col :span="16">
<el-card>
<span style="margin:0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-tabs type="border-card" @tab-click="searchTable1();searchTable2()">
<el-tab-pane label="标准件和外购件">
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable style="width: 170px">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" style="width:170px" size="small" clearable/>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
@@ -27,109 +25,278 @@
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
</el-card>
</el-col>
<el-col :span="8">
<el-card>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<div style="float:right">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="primary"
size="small"
icon="el-icon-menu"
style="margin-left: 10px"
@click="allocateTask1">分配</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-back"
style="margin-left: 10px"
@click="executeReturn1">退回</el-button>
</div>
</el-row>
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">物料类别:</span>
<el-select
v-model="MaterialCategoryValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable
@change="searchMaterialVariety">
<el-option
v-for="item in person"
v-for="item in MaterialCategory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料品种:</span>
<el-select
v-model="MaterialVarietyValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable>
<el-option
v-for="item in MaterialVariety"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" style="width:170px" size="small" clearable/>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData1"
size="mini"
style="max-height: 600px"
height="400px"
border
stripe
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料类别" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料品种" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="100px">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件">
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable style="width: 170px">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="primary"
type="success"
size="small"
icon="el-icon-menu"
icon="el-icon-search"
style="margin-left: 10px"
@click="allocateTask">分配</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-back"
style="margin-left: 10px"
@click="executeReturn">退回</el-button>
</el-card>
</el-col>
</el-row>
<el-card>
<el-table
v-loading=""
:data="tableData1"
size="mini"
style="max-height: 600px"
height="600px"
border
stripe
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格" min-width="150px">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="150px">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
@click="pageCurrent2=1;pageSize2=20;total2=0;searchTable2()">查询</el-button>
<div style="float:right">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="primary"
size="small"
icon="el-icon-menu"
style="margin-left: 10px"
@click="allocateTask2">分配</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-back"
style="margin-left: 10px"
@click="executeReturn2">退回</el-button>
</div>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData2"
size="mini"
style="max-height: 600px"
height="400px"
border
stripe
@selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="100px">
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="材料" min-width="100px">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="100px">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<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-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { initProject, initBuyer, searchTable1, allocateTask, executeReturn } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchTable1, searchTable2, allocateTask1, allocateTask2, executeReturn1, executeReturn2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购任务分配
data() {
return {
MaterialCategoryValue: '', // 物料类别
MaterialCategory: [], // 物料类别数组
MaterialVarietyValue: '', // 物料品种
MaterialVariety: [], // 物料品种数组
projectValue: '',
project: [],
materialName: '',
@@ -152,12 +319,20 @@ export default {
person: [],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
tableData1: [],
tableData2: [],
standardAndPurchase: [],
basic: [],
groupAndPart: [],
groupAndPartBasic: [],
pageCurrent1: 1,
pageSize1: 20,
total1: 0
total1: 0,
pageCurrent2: 1,
pageSize2: 20,
total2: 0
}
},
computed: {
@@ -169,7 +344,8 @@ export default {
])
},
created() {
this.fetchData()
this.searchTable1() // 查表1
this.fetchData() // 初始化数据
},
methods: {
fetchData() { // 初始化
@@ -190,17 +366,31 @@ export default {
})
}
})
this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory', [0, this.DepartmentValue])
},
searchTable1() { // 查询
this.projectValue ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.materialName, this.allocateStateValue).then(response => {
console.log(response.data)
searchMaterialVariety() { // 初始化物料品种
this.MaterialVariety = []
this.MaterialVarietyValue = ''
this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety', this.MaterialCategoryValue)
},
searchTable1() { // 查询标准件和外购件
this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 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 => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSelectionChange1(val) { // 多选
searchTable2() { // 查询基本件
this.projectValue ? this.check3 = 1 : this.check3 = 0
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, this.allocateStateValue).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSelectionChange1(val) { // 标准件和外购件多选
this.standardAndPurchase = []
this.groupAndPart = []
for (let i = 0; i < val.length; i++) {
@@ -208,10 +398,18 @@ export default {
this.groupAndPart.push(val[i].组件零件流水号)
}
},
handleSelectionChange2(val) { // 基本件多选
this.basic = []
this.groupAndPartBasic = []
for (let i = 0; i < val.length; i++) {
this.basic.push(val[i].基本件流水号)
this.groupAndPartBasic.push(val[i].组件零件基本件流水号)
}
},
selectable(row) { // 多选禁用
return row.人员编号 === '' || row.人员编号 === null
},
allocateTask() { // 分配任务
allocateTask1() { // 标准件和外购件分配任务
if (!this.personValue) {
this.$message.error('请选择采购员')
} else if (this.standardAndPurchase.length === 0) {
@@ -222,7 +420,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
allocateTask(this.standardAndPurchase, this.personValue).then(response => {
allocateTask1(this.standardAndPurchase, this.personValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
@@ -236,6 +434,31 @@ export default {
})
}
},
allocateTask2() { // 基本件分配任务
if (!this.personValue) {
this.$message.error('请选择采购员')
} else if (this.basic.length === 0) {
this.$message.error('请选择需分配的零件')
} else {
this.$confirm('此操作执行后不可修改,是否确定分配?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
allocateTask2(this.basic, this.personValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable2()
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
},
filterHandler(value, row) {
console.log(row, value)
return parseInt(row['人员编号']) === parseInt(value)
@@ -249,7 +472,16 @@ export default {
this.pageCurrent1 = val
this.searchTable1()
},
executeReturn() { // 退回
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
executeReturn1() { // 退回标准件和外购件
if (this.standardAndPurchase.length === 0) {
this.$message.error('请选择需退回的物料')
} else {
@@ -258,7 +490,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
executeReturn(this.standardAndPurchase, this.groupAndPart).then(response => {
executeReturn1(this.standardAndPurchase, this.groupAndPart).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
@@ -271,6 +503,29 @@ export default {
})
})
}
},
executeReturn2() { // 退回基本件
if (this.basic.length === 0) {
this.$message.error('请选择需退回的零件')
} else {
this.$confirm('此操作执行后不可修改,是否确定退回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
executeReturn2(this.basic, this.groupAndPartBasic).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable2()
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}
}