Merge branch 'master' of http://192.168.0.149:10010/r/高精2.0
This commit is contained in:
@@ -44,9 +44,9 @@
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" align="center" width="100px">
|
||||
<el-table-column label="重量" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.原材料规格 }}
|
||||
{{ scope.row.重量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备料" align="center">
|
||||
@@ -155,6 +155,9 @@ export default {
|
||||
if (response.data.total === 0) {
|
||||
this.loading = false
|
||||
} else {
|
||||
// this.tableData.push({
|
||||
// 重量: response.data.rows[0].重量
|
||||
// })
|
||||
this.Data = response.data.rows
|
||||
this.total = response.data.total
|
||||
}
|
||||
@@ -168,7 +171,7 @@ export default {
|
||||
备料打印: this.Data[i].备料打印,
|
||||
工艺要求: response.data[0].工艺要求,
|
||||
材料: this.Data[i].材料,
|
||||
原材料规格: this.Data[i].原材料规格,
|
||||
重量: this.Data[i].重量,
|
||||
批次数量: this.Data[i].批次数量
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,24 +6,13 @@
|
||||
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
|
||||
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
|
||||
<!--<el-checkbox v-model="all" size="mini" @change="searchTable">查询全部</el-checkbox>-->
|
||||
<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">自家备料出库</el-button>
|
||||
<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit2()">外购备料出库</el-button>
|
||||
<!--<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">自家备料出库</el-button>-->
|
||||
<!--<el-button size="small" icon="el-icon-refresh" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">刷新</el-button>-->
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column label="到货状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
|
||||
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
|
||||
<el-table-column label="零件名称" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
@@ -39,6 +28,25 @@
|
||||
{{ scope.row.工艺要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="request" label="重量(kg)" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.重量" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="request" label="单价(元)" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.单价" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleChange1(scope.row)">出库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
@@ -53,17 +61,17 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partName2" placeholder="零件图号" size="small" clearable style="width:200px"/>
|
||||
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="total2=0;pageSize2=10; pageCurrent2=1;searchTable2()">查询</el-button>
|
||||
<el-button size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">外购备料出库</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="loading2" :data="tableData2" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column label="到货状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
|
||||
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
@@ -74,22 +82,32 @@
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备料" align="center">
|
||||
<el-table-column label="重量" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺要求 }}
|
||||
{{ scope.row.重量1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
v-if="!loading2"
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -97,7 +115,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchtable, searchtable2, change, change2 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
|
||||
import { searchtable, searchtable2, change, handlechange, searchtable3, change2 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -111,11 +130,26 @@ export default {
|
||||
tableData: [], // 表格数据
|
||||
total: null, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
pageCurrent: 1, // 后台获取页
|
||||
loading2: false,
|
||||
partName2: '',
|
||||
tableData2: [], // 表格数据
|
||||
total2: null, // 总条数
|
||||
pageSize2: 10, // 每页显示条数
|
||||
pageCurrent2: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
this.searchTable2()
|
||||
},
|
||||
methods: {
|
||||
// 查询表格数据
|
||||
@@ -144,16 +178,58 @@ export default {
|
||||
零件图号: this.Data[i].零件图号,
|
||||
备料到货: this.Data[i].备料到货,
|
||||
工艺要求: response.data[0].工艺要求,
|
||||
工序流水号: response.data[0].工序流水号
|
||||
工序流水号: response.data[0].工序流水号,
|
||||
重量: response.data[0].重量
|
||||
})
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 自家备料出库
|
||||
handleChange1(row) {
|
||||
change(row.工艺计划流水号, row.重量, row.单价).then(() => {
|
||||
handlechange(row.工序流水号, this.id)
|
||||
}).then(response => {
|
||||
this.searchTable()
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.arrest = val
|
||||
},
|
||||
searchTable2() {
|
||||
this.loading2 = true
|
||||
this.tableData2 = []
|
||||
this.Data = []
|
||||
if (this.partName2 !== '' && this.partName2 !== null) {
|
||||
this.partNamecheck2 = 1
|
||||
} else {
|
||||
this.partNamecheck2 = 0
|
||||
}
|
||||
searchtable3(this.partNamecheck2, this.partName2, this.pageCurrent2, this.pageSize2).then(response => {
|
||||
if (response.data.total === 0) {
|
||||
this.loading2 = false
|
||||
} else {
|
||||
this.Data = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
}
|
||||
}).then(() => {
|
||||
for (let i = 0; i < this.Data.length; i++) {
|
||||
searchtable2(this.Data[i].工艺计划流水号).then(response => {
|
||||
this.tableData2.push({
|
||||
工艺计划流水号: this.Data[i].工艺计划流水号,
|
||||
零件名称: this.Data[i].零件名称,
|
||||
零件图号: this.Data[i].零件图号,
|
||||
重量1: this.Data[i].重量1,
|
||||
单价: this.Data[i].单价,
|
||||
备注1: this.Data[i].备注1,
|
||||
工序流水号: response.data[0].工序流水号
|
||||
})
|
||||
})
|
||||
this.loading2 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
edit() {
|
||||
this.bianliang1 = []
|
||||
this.bianliang2 = []
|
||||
@@ -164,23 +240,8 @@ export default {
|
||||
this.bianliang1.push(this.arrest[i].工艺计划流水号)
|
||||
this.bianliang2.push(this.arrest[i].工序流水号)
|
||||
}
|
||||
change(this.bianliang2, '0000', this.bianliang1).then(() => {
|
||||
this.searchTable()
|
||||
})
|
||||
}
|
||||
},
|
||||
edit2() {
|
||||
this.bianliang1 = []
|
||||
this.bianliang2 = []
|
||||
if (this.arrest.length === 0) {
|
||||
this.$message.warning('请选择零件')
|
||||
} else {
|
||||
for (let i = 0; i < this.arrest.length; i++) {
|
||||
this.bianliang1.push(this.arrest[i].工艺计划流水号)
|
||||
this.bianliang2.push(this.arrest[i].工序流水号)
|
||||
}
|
||||
change2(this.bianliang2, '0000', this.bianliang1).then(() => {
|
||||
this.searchTable()
|
||||
change2(this.bianliang2, this.id, this.bianliang1).then(response => {
|
||||
this.searchTable2()
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -193,6 +254,15 @@ export default {
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageCurrent2 = 1
|
||||
this.pageSize2 = val
|
||||
this.searchTable2()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.searchTable2()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<el-radio-group v-model="radio" size="small" style="margin: 10px;" @change="CraftmenValue = '';checked = false;partNumValue = '';typeValue = '';partName = '';material = '';materialName = '';spec = '';batchNum = '';searchParts()">
|
||||
<el-radio-group v-model="radio" size="small" style="margin: 10px;" @change="CraftmenValue = '';checked = false;partNumValue = '';typeValue = '';partName = '';material = '';materialName = '';prepareMateriel = '';spec = '';batchNum = '';searchParts()">
|
||||
<el-radio v-model="radio" :label="1">未编制</el-radio>
|
||||
<el-radio v-model="radio" :label="2">已编制</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -31,15 +31,15 @@
|
||||
<el-input v-model="typeValue" placeholder="种类" size="small" readonly style="width:100px"/>
|
||||
<span>零件名称:</span>
|
||||
<el-input v-model="partName" placeholder="零件名称" size="small" readonly style="width:115px"/>
|
||||
<span>材质:</span>
|
||||
<el-input v-model="materialName" placeholder="材质" size="small" style="width:215px" readonly>
|
||||
<span>投产总数量:</span>
|
||||
<el-input v-model="batchNum" readonly size="small" style="width:80px;margin-top:10px;"/>
|
||||
<span>物料:</span>
|
||||
<el-input v-model="materialName" placeholder="物料" size="small" style="width:215px" readonly>
|
||||
<el-button slot="prepend" icon="el-icon-search" @click="dialogMaterial=true"/>
|
||||
<el-button slot="append" icon="el-icon-cjn-09" @click="saveMaterial"/>
|
||||
</el-input>
|
||||
<span>规格:</span>
|
||||
<el-input v-model="spec" :readonly="isShow2" style="width:100px" size="small" placeholder="规格"/>
|
||||
<span>投产总数量:</span>
|
||||
<el-input v-model="batchNum" readonly size="small" style="width:80px;margin-top:10px;"/>
|
||||
<!--<span>规格:</span>-->
|
||||
<!--<el-input v-model="spec" :readonly="isShow2" style="width:100px" size="small" placeholder="规格"/>-->
|
||||
</div>
|
||||
<div>
|
||||
<el-row>
|
||||
@@ -60,6 +60,10 @@
|
||||
<span>长度:</span>
|
||||
<el-input-number v-model="height2" size="small" controls-position="right" style="width:100px;margin-top:20px;"/>
|
||||
<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="Calculation1()">计算重量</el-button>
|
||||
<span>重量:</span>
|
||||
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
|
||||
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
|
||||
</el-input>
|
||||
<!--∮ ° # □ ∥ ± × Ⅰ Ⅱ Ⅲ ⊥ % ■ ∠ mm ◎ ○ δ μm / ◇ ()-->
|
||||
<!--<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="insertThestring()">计算重量</el-button>-->
|
||||
</el-col>
|
||||
@@ -72,6 +76,10 @@
|
||||
<span>厚:</span>
|
||||
<el-input-number v-model="height1" size="small" controls-position="right" style="width:100px;margin-top:20px;"/>
|
||||
<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="Calculation2()">计算重量</el-button>
|
||||
<span>重量:</span>
|
||||
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
|
||||
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
|
||||
</el-input>
|
||||
</el-col>
|
||||
|
||||
<el-col v-show="materielValue==='3'" :span="20">
|
||||
@@ -80,6 +88,10 @@
|
||||
<span>长度:</span>
|
||||
<el-input-number v-model="length2" size="small" controls-position="right" style="width:100px;margin-top:20px;"/>
|
||||
<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="Calculation3()">计算重量</el-button>
|
||||
<span>重量:</span>
|
||||
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
|
||||
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
|
||||
</el-input>
|
||||
</el-col>
|
||||
|
||||
<el-col v-show="materielValue==='4'" :span="20">
|
||||
@@ -90,6 +102,10 @@
|
||||
<span>长度:</span>
|
||||
<el-input-number v-model="changdu" size="small" controls-position="right" style="width:100px;margin-top:20px;"/>
|
||||
<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="Calculation4()">计算重量</el-button>
|
||||
<span>重量:</span>
|
||||
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
|
||||
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
|
||||
</el-input>
|
||||
</el-col>
|
||||
|
||||
<el-col v-show="materielValue==='5'" :span="20">
|
||||
@@ -100,7 +116,12 @@
|
||||
<span>长度:</span>
|
||||
<el-input-number v-model="changdu2" size="small" controls-position="right" style="width:100px;margin-top:20px;"/>
|
||||
<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="Calculation5()">计算重量</el-button>
|
||||
<span>重量:</span>
|
||||
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
|
||||
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
|
||||
</el-input>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -206,7 +227,7 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogMaterial" title="材质选择" center width="400px">
|
||||
<el-dialog :visible.sync="dialogMaterial" title="物料选择" center width="400px">
|
||||
<el-input v-model="input" placeholder="材质" size="small" style="width:200px"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin: 0 0 10px 10px" @click="total=0;pageCurrent=1;pageSize=10;searchMaterial()">查询</el-button>
|
||||
<el-table :data="tableMaterial" size="mini" highlight-current-row border @row-click="selectMaterial">
|
||||
@@ -232,7 +253,6 @@
|
||||
<el-button type="primary" size="small" @click="selectMaterial2()">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="工艺名称、工艺要求选择" center width="400px">
|
||||
<el-form ref="form2" :model="form2" label-position="left" label-width="125px" class="demo-ruleForm">
|
||||
<el-form-item label="工艺名称分类">
|
||||
@@ -456,6 +476,7 @@
|
||||
<script>
|
||||
import '@/icon/iconfont.css'
|
||||
import {
|
||||
saveWeight,
|
||||
numChange,
|
||||
searchProcess11,
|
||||
WeightCopy,
|
||||
@@ -487,8 +508,7 @@ import {
|
||||
selectRequest,
|
||||
pasteTable,
|
||||
deleteTable,
|
||||
returnEdit,
|
||||
searchRecord
|
||||
returnEdit
|
||||
} from '@/api/ManufacturingCenter/ProcessPlanning'
|
||||
import elInput from 'element-ui/packages/input'
|
||||
import { mapGetters } from 'vuex'
|
||||
@@ -499,6 +519,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
weight: '',
|
||||
dialogMateria2: false,
|
||||
prepareMateriel: '',
|
||||
lastFocusText: '',
|
||||
Result1: '',
|
||||
Result2: '',
|
||||
@@ -637,7 +660,7 @@ export default {
|
||||
result: 0,
|
||||
oldNum: '',
|
||||
newNum: '',
|
||||
tableRecord: [],
|
||||
// tableRecord: [],
|
||||
materialName2: '',
|
||||
material2: ''
|
||||
}
|
||||
@@ -656,7 +679,21 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
saveWeight() {
|
||||
if (this.partNumValue === '' || this.material === '') {
|
||||
this.$message.error('请选择一个零件')
|
||||
} else {
|
||||
saveWeight(this.partNumValue, this.weight).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
} else {
|
||||
this.$message.error('保存失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
clear() {
|
||||
this.weight = ''
|
||||
this.Length = ''
|
||||
this.Width = ''
|
||||
this.height1 = ''
|
||||
@@ -676,27 +713,35 @@ export default {
|
||||
this.$message.error('请先选择一个零件')
|
||||
} else {
|
||||
if (this.materielValue === '1') {
|
||||
this.Result2 = '物料:' + this.materiel[1].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2 + 'mm 重量:' + 0.00617 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.Result2 = '物料:' + this.materiel[1].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2
|
||||
// + 'mm 重量:' + 0.00617 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.weight = 0.00617 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
|
||||
WeightCopy(this.partNumValue, this.Result2).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
if (this.materielValue === '6') {
|
||||
this.Result2 = '物料:' + this.materiel[6].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2 + 'mm 重量:' + 0.00698 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.Result2 = '物料:' + this.materiel[6].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2
|
||||
// + 'mm 重量:' + 0.00698 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.weight = 0.00698 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
|
||||
WeightCopy(this.partNumValue, this.Result2).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
if (this.materielValue === '7') {
|
||||
this.Result2 = '物料:' + this.materiel[7].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2 + 'mm 重量:' + 0.00668 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.Result2 = '物料:' + this.materiel[7].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2
|
||||
// + 'mm 重量:' + 0.00668 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.weight = 0.00668 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
|
||||
WeightCopy(this.partNumValue, this.Result2).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
if (this.materielValue === '8') {
|
||||
this.Result2 = '物料:' + this.materiel[8].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2 + 'mm 重量:' + 0.0022 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.Result2 = '物料:' + this.materiel[8].label + ' 直径:' + this.diameter + 'mm 长度:' + this.height2
|
||||
// + 'mm 重量:' + 0.0022 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2) + 'kg'
|
||||
this.weight = 0.0022 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
|
||||
WeightCopy(this.partNumValue, this.Result2).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -707,27 +752,35 @@ export default {
|
||||
this.$message.error('请先选择一个零件')
|
||||
} else {
|
||||
if (this.materielValue === '2') {
|
||||
this.Result1 = '物料:' + this.materiel[2].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1 + 'mm 重量:' + 0.001 * 0.00785 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.Result1 = '物料:' + this.materiel[2].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1
|
||||
// + 'mm 重量:' + 0.001 * 0.00785 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.weight = 0.001 * 0.00785 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
|
||||
WeightCopy(this.partNumValue, this.Result1).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
if (this.materielValue === '9') {
|
||||
this.Result1 = '物料:' + this.materiel[9].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1 + 'mm 重量:' + 0.001 * 0.0089 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.Result1 = '物料:' + this.materiel[9].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1
|
||||
// + 'mm 重量:' + 0.001 * 0.0089 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.weight = 0.001 * 0.0089 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
|
||||
WeightCopy(this.partNumValue, this.Result1).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
if (this.materielValue === '10') {
|
||||
this.Result1 = '物料:' + this.materiel[10].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1 + 'mm 重量:' + 0.001 * 0.0085 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.Result1 = '物料:' + this.materiel[10].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1
|
||||
// + 'mm 重量:' + 0.001 * 0.0085 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.weight = 0.001 * 0.0085 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
|
||||
WeightCopy(this.partNumValue, this.Result1).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
if (this.materielValue === '11') {
|
||||
this.Result1 = '物料:' + this.materiel[11].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1 + 'mm 重量:' + 0.001 * 0.0028 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.Result1 = '物料:' + this.materiel[11].label + ' 长:' + this.Length + 'mm 宽:' + this.Width + 'mm 厚:' + this.height1
|
||||
// + 'mm 重量:' + 0.001 * 0.0028 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1) + 'kg'
|
||||
this.weight = 0.001 * 0.0028 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
|
||||
WeightCopy(this.partNumValue, this.Result1).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -738,9 +791,11 @@ export default {
|
||||
this.$message.error('请先选择一个零件')
|
||||
} else {
|
||||
if (this.materielValue === '3') {
|
||||
this.Result3 = '物料:' + this.materiel[3].label + ' 对边宽:' + this.OppositeSideWidth + 'mm 长度:' + this.length2 + 'mm 重量:' + 0.001 * 0.0068 * parseInt(this.OppositeSideWidth) * parseInt(this.OppositeSideWidth) * parseInt(this.length2) + 'kg'
|
||||
this.Result3 = '物料:' + this.materiel[3].label + ' 对边宽:' + this.OppositeSideWidth + 'mm 长度:' + this.length2
|
||||
// + 'mm 重量:' + 0.001 * 0.0068 * parseInt(this.OppositeSideWidth) * parseInt(this.OppositeSideWidth) * parseInt(this.length2) + 'kg'
|
||||
this.weight = 0.001 * 0.0068 * parseInt(this.OppositeSideWidth) * parseInt(this.OppositeSideWidth) * parseInt(this.length2)
|
||||
WeightCopy(this.partNumValue, this.Result3).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -751,9 +806,11 @@ export default {
|
||||
this.$message.error('请先选择一个零件')
|
||||
} else {
|
||||
if (this.materielValue === '4') {
|
||||
this.Result4 = '物料:' + this.materiel[4].label + ' 边宽:' + this.biankuan + 'mm 边厚:' + this.bianhou + 'mm 长度:' + this.changdu + 'mm 重量:' + 0.001 * 0.00785 * (parseInt(this.biankuan) + parseInt(this.biankuan) - parseInt(this.bianhou)) * parseInt(this.bianhou) * parseInt(this.changdu) + 'kg'
|
||||
this.Result4 = '物料:' + this.materiel[4].label + ' 边宽:' + this.biankuan + 'mm 边厚:' + this.bianhou + 'mm 长度:' + this.changdu
|
||||
// + 'mm 重量:' + 0.001 * 0.00785 * (parseInt(this.biankuan) + parseInt(this.biankuan) - parseInt(this.bianhou)) * parseInt(this.bianhou) * parseInt(this.changdu) + 'kg'
|
||||
this.weight = 0.001 * 0.00785 * (parseInt(this.biankuan) + parseInt(this.biankuan) - parseInt(this.bianhou)) * parseInt(this.bianhou) * parseInt(this.changdu)
|
||||
WeightCopy(this.partNumValue, this.Result4).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -763,9 +820,11 @@ export default {
|
||||
this.$message.error('请先选择一个零件')
|
||||
} else {
|
||||
if (this.materielValue === '5') {
|
||||
this.Result5 = '物料:' + this.materiel[5].label + ' 壁厚:' + this.bihou + 'mm 外径:' + this.waijing + 'mm 长度:' + this.changdu2 + 'mm 重量:' + 0.001 * 0.02466 * parseInt(this.bihou) * (parseInt(this.waijing) - parseInt(this.bihou)) * parseInt(this.changdu2) + 'kg'
|
||||
this.Result5 = '物料:' + this.materiel[5].label + ' 壁厚:' + this.bihou + 'mm 外径:' + this.waijing + 'mm 长度:' + this.changdu2
|
||||
// + 'mm 重量:' + 0.001 * 0.02466 * parseInt(this.bihou) * (parseInt(this.waijing) - parseInt(this.bihou)) * parseInt(this.changdu2) + 'kg'
|
||||
this.weight = 0.001 * 0.02466 * parseInt(this.bihou) * (parseInt(this.waijing) - parseInt(this.bihou)) * parseInt(this.changdu2)
|
||||
WeightCopy(this.partNumValue, this.Result5).then(response => {
|
||||
this.searchDetail()
|
||||
this.searchDetai2()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -779,6 +838,7 @@ export default {
|
||||
},
|
||||
clearDetail() {
|
||||
this.checked = false
|
||||
this.weight = ''
|
||||
this.partNumValue = ''
|
||||
this.typeValue = ''
|
||||
this.partName = ''
|
||||
@@ -948,12 +1008,37 @@ export default {
|
||||
this.material = response.data[0].材料流水号
|
||||
this.materialName = response.data[0].材料
|
||||
this.spec = response.data[0].原材料规格
|
||||
if (response.data[0].重量 === null) {
|
||||
this.weight = ''
|
||||
} else {
|
||||
this.weight = response.data[0].重量
|
||||
}
|
||||
}
|
||||
})
|
||||
this.tableRecord = []
|
||||
searchRecord(this.partNumValue).then(response => {
|
||||
this.tableRecord = response.data
|
||||
// this.tableRecord = []
|
||||
// searchRecord(this.partNumValue).then(response => {
|
||||
// this.tableRecord = response.data
|
||||
// })
|
||||
mainTable(this.partNumValue).then(response => {
|
||||
this.tableData = []
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (response.data[i].工艺编号 === null) {
|
||||
response.data[i].工艺编号 = 0
|
||||
}
|
||||
if (response.data[i].工艺要求 === null) {
|
||||
response.data[i].工艺要求 = ''
|
||||
}
|
||||
}
|
||||
this.tableData = response.data
|
||||
this.newNum = this.partNumValue
|
||||
}).then(() => {
|
||||
this.loading0 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
searchDetai2() {
|
||||
if (this.partNumValue !== '' && this.partNumValue !== null) {
|
||||
this.loading0 = true
|
||||
mainTable(this.partNumValue).then(response => {
|
||||
this.tableData = []
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
@@ -1101,9 +1186,9 @@ export default {
|
||||
hardEdit(row.工序流水号, row.工艺难度等级).then(response => {
|
||||
})
|
||||
},
|
||||
requestEdit(row) { // 修改工艺要求
|
||||
requestEdit(row.工序流水号, row.工艺要求).then(response => {
|
||||
})
|
||||
// 修改工艺要求
|
||||
requestEdit(row) {
|
||||
requestEdit(row.工序流水号, row.工艺要求)
|
||||
},
|
||||
tableSearch(index) { // 主界面工艺名称分类、工艺名称及工艺要求后续查询
|
||||
if (this.checked1 === false) {
|
||||
|
||||
@@ -23,6 +23,14 @@
|
||||
</el-select>
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 180px;"/>
|
||||
<span>进度颜色:</span>
|
||||
<span style="background-color: red">拖期</span>
|
||||
<span style="background-color: yellow">即将拖期</span>
|
||||
<span style="background-color: lawngreen">如期</span>
|
||||
<span style="background-color: deepskyblue">工序外协</span>
|
||||
<span style="background-color: grey">报废</span>
|
||||
</el-row>
|
||||
<el-row style="margin-top:10px;">
|
||||
<span class="demonstration">计划下达时间:</span>
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
@@ -31,7 +39,7 @@
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<span class="demonstration">-</span>
|
||||
<span class="demonstration">~</span>
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
@@ -41,14 +49,6 @@
|
||||
placeholder="选择日期"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
|
||||
</el-row>
|
||||
<el-row style="margin-top:10px;">
|
||||
<span>进度颜色:</span>
|
||||
<span style="background-color: red">拖期</span>
|
||||
<span style="background-color: yellow">即将拖期</span>
|
||||
<span style="background-color: lawngreen">如期</span>
|
||||
<span style="background-color: deepskyblue">工序外协</span>
|
||||
<span style="background-color: grey">报废</span>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<span class="demonstration">-</span>
|
||||
<span class="demonstration">~</span>
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partNumber" clearable size="small" placeholder="零件图号" style="width: 200px;"/>
|
||||
|
||||
<el-button v-if="是否扫描 === false" size="small" type="success" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="total = 0;pageSize = 10;pageList = 1;getTable()">查询</el-button>
|
||||
<el-button v-if="是否扫描 === true" size="small" type="success" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="total5 = 0;pageSize5 = 10;pageList5 = 1;getTable5()">查询</el-button>
|
||||
<el-button v-if="是否扫描 === false" size="small" type="success" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="total = 0;pageList = 1;getTable()">查询</el-button>
|
||||
<el-button v-if="是否扫描 === true" size="small" type="success" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="total5 = 0;pageList5 = 1;getTable5()">查询</el-button>
|
||||
<el-checkbox v-if="false" v-model="是否扫描">是否扫描查询</el-checkbox>
|
||||
|
||||
</el-row>
|
||||
@@ -431,11 +431,10 @@
|
||||
@current-change="handleCurrentChange1"/>
|
||||
<div style="float:right">
|
||||
<el-button type="primary" size="small" style="margin:5px 10px 10px 10px" @click="Discharge">虚拟排产</el-button>
|
||||
<el-button type="primary" size="small" style="margin:5px 10px 10px 10px" @click="Plan" >确定零件计划</el-button>
|
||||
<el-button :disabled="listLoading1" type="primary" size="small" style="margin:5px 10px 10px 10px" @click="Plan" >确定零件计划</el-button>
|
||||
<el-button type="danger" size="small" icon="el-icon-upload2" style="float:right;margin:5px 50px 10px 10px" @click="allOut">全部选出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -1103,11 +1102,9 @@ export default {
|
||||
if (this.result1 === this.multipleSelection.length) {
|
||||
this.result1 = 0
|
||||
this.total1 = 0
|
||||
this.pageSize1 = 10
|
||||
this.pageList1 = 1
|
||||
this.Selection1()
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
}
|
||||
@@ -1128,11 +1125,9 @@ export default {
|
||||
}
|
||||
}).then(() => {
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
this.total1 = 0
|
||||
this.pageSize1 = 10
|
||||
this.pageList1 = 1
|
||||
this.Selection1()
|
||||
})
|
||||
@@ -1148,7 +1143,6 @@ export default {
|
||||
xuanchu(this.工艺计划流水号[index]).then(response => {
|
||||
}).then(() => {
|
||||
this.pageList = 1
|
||||
this.pageSize = 10
|
||||
this.total = 0
|
||||
this.getTable()
|
||||
}).then(() => {
|
||||
@@ -1232,7 +1226,6 @@ export default {
|
||||
this.计划日期.push(response.data[i].计划日期)
|
||||
}
|
||||
})
|
||||
this.listLoading1 = false
|
||||
})
|
||||
}
|
||||
} else {
|
||||
@@ -1240,6 +1233,8 @@ export default {
|
||||
this.listLoading1 = false
|
||||
this.total1 = 0
|
||||
}
|
||||
}).then(() => {
|
||||
this.listLoading1 = false
|
||||
})
|
||||
},
|
||||
// 调整
|
||||
@@ -1285,11 +1280,9 @@ export default {
|
||||
}
|
||||
}).then(() => {
|
||||
this.total = 0
|
||||
this.pageSize = 10
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
this.total1 = 0
|
||||
this.pageSize1 = 10
|
||||
this.pageList1 = 1
|
||||
this.Selection1()
|
||||
})
|
||||
@@ -1408,7 +1401,6 @@ export default {
|
||||
message: '板焊结束时间修改成功!'
|
||||
})
|
||||
this.pageList = 1
|
||||
this.pageSize = 10
|
||||
this.total = 0
|
||||
this.getTable()
|
||||
} else {
|
||||
@@ -1453,12 +1445,7 @@ export default {
|
||||
this.result1 = 0
|
||||
for (let i = 0; i < this.tableData1.length; i++) {
|
||||
this.length = this.tableData1.length
|
||||
if (this.预计外协[i] === '否') {
|
||||
this.预计外协[i] = 1
|
||||
} else {
|
||||
this.预计外协[i] = 2
|
||||
}
|
||||
out(this.tableData1[i].工艺计划流水号, this.预计外协[i]).then(response => {
|
||||
out(this.tableData1[i].工艺计划流水号, 1).then(response => {
|
||||
}).then(() => {
|
||||
plan(this.tableData1[i].工艺计划流水号).then(response => {
|
||||
if (this.tableData1[i].平衡次数 !== 0 || this.tableData1[i].是否焊接 !== 1) {
|
||||
@@ -1466,7 +1453,6 @@ export default {
|
||||
if (this.result1 === this.length) {
|
||||
this.$message.success('零件计划制定成功')
|
||||
this.total1 = 0
|
||||
this.pageSize1 = 10
|
||||
this.pageList1 = 1
|
||||
this.Selection1()
|
||||
} else if (response.data[0].result === '0') {
|
||||
@@ -1501,7 +1487,6 @@ export default {
|
||||
if (i === this.multipleSelection.length - 1) {
|
||||
this.$message.success('零件计划制定成功')
|
||||
this.pageList = 1
|
||||
this.pageSize = 10
|
||||
this.total = 0
|
||||
this.getTable()
|
||||
}
|
||||
@@ -1571,7 +1556,6 @@ export default {
|
||||
}).then(() => {
|
||||
this.total = 0
|
||||
this.pageList = 1
|
||||
this.pageSize = 10
|
||||
this.getTable()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<el-card>
|
||||
<div slot="header">
|
||||
<span>零件图号:</span>
|
||||
<el-select v-model="inventoryStateValue" placeholder="零件图号" size="small" clearable>
|
||||
<el-select v-model="partDrawingNumberValue" placeholder="零件图号" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in inventoryState"
|
||||
v-for="item in partDrawingNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
@@ -29,32 +29,32 @@
|
||||
<el-table-column type="selection" align="center" width="55"/>
|
||||
<el-table-column label="零件图号" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供货商 }}
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.当前库存量 }}
|
||||
{{ scope.row.原材料规格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备料" min-width="90" align="center">
|
||||
<el-table-column label="重量" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.当前库存量 }}
|
||||
{{ scope.row.重量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -75,7 +75,7 @@
|
||||
<el-card>
|
||||
<div slot="header">
|
||||
<span>采购单号:</span>
|
||||
<el-input v-model="offlineContract" placeholder="离线合同号" size="small" clearable/>
|
||||
<el-input v-model="purchasingOrder" placeholder="采购单号" size="small" clearable/>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
|
||||
<el-button
|
||||
@@ -89,7 +89,7 @@
|
||||
size="small"
|
||||
icon="el-icon-plus"
|
||||
style="margin-left: 10px"
|
||||
@click="addOfflineContract">创建采购单</el-button>
|
||||
@click="addPurchaseOrder">创建采购单</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@@ -101,24 +101,24 @@
|
||||
size="small"
|
||||
icon="el-icon-download"
|
||||
style="margin-left: 10px"
|
||||
@click="addMateriel">保存</el-button>
|
||||
@click="saveMateriel">保存</el-button>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData2" border style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
|
||||
<el-table-column label="单号状态" align="center" width="100" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.离线合同状态)===1" type="warning" size="small">编辑中</el-tag>
|
||||
<el-tag v-if="Number(scope.row.离线合同状态)===2&&Number(scope.row.总采购数量)!==Number(scope.row.总到货数量)" type="primary" size="small">已采购</el-tag>
|
||||
<el-tag v-if="Number(scope.row.总采购数量)===Number(scope.row.总到货数量)&&Number(scope.row.总采购数量)!==0" type="success" size="small">全部到货</el-tag>
|
||||
<el-tag v-if="Number(scope.row.采购计划状态)===0" type="warning" size="small">编辑中</el-tag>
|
||||
<el-tag v-if="Number(scope.row.采购计划状态)===1" type="primary" size="small">已保存</el-tag>
|
||||
<el-tag v-if="Number(scope.row.采购计划状态)===2" type="success" size="small">已导出</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单号" align="center" min-width="170">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离线合同编号 }}
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单名称" align="center" min-width="170">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离线合同名称 }}
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
@@ -128,23 +128,23 @@
|
||||
</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" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.创建日期.split(' ')[0] }}
|
||||
{{ scope.row.下单日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划完成时间" align="center" width="100">
|
||||
<el-table-column label="计划完成日期" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
{{ scope.row.计划完成日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button :disabled="parseInt(scope.row.离线合同状态)!==1" type="primary" size="mini" icon="el-icon-edit" @click="editOfflineContract(scope.row)"/>
|
||||
<el-button :disabled="parseInt(scope.row.离线合同状态)!==1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)"/>
|
||||
<el-button :disabled="parseInt(scope.row.采购计划状态)===2" type="primary" size="mini" icon="el-icon-edit" @click="editPurchaseOrder(scope.row)"/>
|
||||
<el-button :disabled="parseInt(scope.row.采购计划状态)===2" type="danger" size="mini" icon="el-icon-delete" @click="deletePurchaseOrder(scope.row)"/>
|
||||
<el-button type="warning" size="mini" icon="el-icon-download" @click="exportExcel(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -160,40 +160,40 @@
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData3" :summary-method="getSummaries" border style="max-height: 300px;" height="300px" size="mini" show-summary>
|
||||
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
|
||||
<el-table-column label="零件图号" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离线合同编号 }}
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
{{ scope.row.材料 }}
|
||||
</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.物料型号 }}
|
||||
<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-input v-model="scope.row.数量" :disabled="disable" size="mini" style="width:70px"/>
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成品尺寸" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.参考价格 }}
|
||||
{{ scope.row.重量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" min-width="100" prop="单价">
|
||||
<el-table-column label="备注" align="center" min-width="100" prop="备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.单价" :disabled="disable" size="mini" style="width:70px"/>
|
||||
<el-input v-model="scope.row.备注1" :disabled="disable" size="mini" style="width:150px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" min-width="100">
|
||||
@@ -319,13 +319,13 @@
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离线合同编号" prop="离线合同编号">
|
||||
<el-input v-model="form2.离线合同编号" size="small"/>
|
||||
<el-form-item label="采购单名称" prop="采购单名称">
|
||||
<el-input v-model="form2.采购单名称" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离线合同名称" prop="离线合同名称">
|
||||
<el-input v-model="form2.离线合同名称" size="small"/>
|
||||
<el-form-item label="采购员" prop="采购员">
|
||||
<el-input v-model="name" readonly size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -338,9 +338,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规定到货时间" prop="规定到货时间">
|
||||
<el-form-item label="计划完成日期" prop="计划完成日期">
|
||||
<el-date-picker
|
||||
v-model="form2.规定到货时间"
|
||||
v-model="form2.计划完成日期"
|
||||
size="small"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
@@ -349,117 +349,98 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离线合同备注" prop="离线合同备注">
|
||||
<el-input v-model="form2.离线合同备注" size="small" type="textarea" style="width: 550px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
v-show="title2==='创建离线合同'"
|
||||
v-show="title2==='创建采购单'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitAddOfflineContract">确定</el-button>
|
||||
@click="submitAddPurchaseOrder">确定</el-button>
|
||||
<el-button
|
||||
v-show="title2==='编辑离线合同'"
|
||||
v-show="title2==='编辑采购单'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitEditOfflineContract">确定</el-button>
|
||||
@click="submitEditPurchaseOrder">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<div id="offlineContract" style="width: 800px;margin: 0 auto;display: none">
|
||||
<table class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="100%">
|
||||
<tr>
|
||||
<th colspan="14"><h1>离线合同</h1></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" rowspan="2" style="text-align:center;font-size: 30px;font-weight: bold">GAOJING</td>
|
||||
<td width="80px">合同名称</td>
|
||||
<td id="contractName" colspan="3" style="text-align: left;"/>
|
||||
<td width="80px">供应商</td>
|
||||
<td id="supplier" colspan="4" style="text-align: left;"/>
|
||||
<td id="qrCode" colspan="2" rowspan="2">二维码粘贴处</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="80px">合同编号</td>
|
||||
<td id="contractNum" colspan="3" style="text-align: left;"/>
|
||||
<td width="80px">采购员</td>
|
||||
<td id="buyer" colspan="4" style="text-align: left;"/>
|
||||
</tr>
|
||||
<tr id="tablehead">
|
||||
<td>序号</td>
|
||||
<td colspan="2">名称</td>
|
||||
<td colspan="2">规格</td>
|
||||
<td colspan="2">型号</td>
|
||||
<td colspan="2">数量</td>
|
||||
<td colspan="2">单价</td>
|
||||
<td colspan="2">合计</td>
|
||||
<td>备注</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总计</td>
|
||||
<td colspan="10"/>
|
||||
<td id="total" colspan="2" style="text-align: left;"/>
|
||||
<td/>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<el-card style="width: 1100px;margin: 20px auto">
|
||||
<div id="cjn" style="width: 1000px;margin: 0 auto">
|
||||
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
|
||||
<tr>
|
||||
<th colspan="14"><h3>江苏高精机电装备有限公司</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="14"><h4>锻件采购计划表</h4></th>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">下单单位</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ 下单单位 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">单号</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ 单号 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">下单日期</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ 下单日期 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">计划完成日期</td>
|
||||
<td colspan="5" style="text-align: center;width: 35%">{{ 计划完成日期 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 20px">
|
||||
<tr id="tablehead" style="height: 35px">
|
||||
<td style="text-align: center;width: 7%">序号</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">图号</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">名称</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">材料</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">单位</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">数量</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">成品尺寸</td>
|
||||
<td style="text-align: center;width: 17%">备注</td>
|
||||
</tr>
|
||||
<tr v-for="(list, index) in tableData3" :key="index" style="height: 35px">
|
||||
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">{{ list.零件图号 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">{{ list.零件名称 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">{{ list.材料 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">{{ list.单位 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">{{ list.批次数量 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">{{ list.成品尺寸 }}</td>
|
||||
<td style="text-align: center;width: 17%">{{ list.备注1 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { searchInventoryNum, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel,
|
||||
addMateriel, deleteMateriel, doneOfflineContact, setSafeValue } from '@/api/WorkshopProcurement/OfflineContract1'
|
||||
<script>import { initPartDrawing, searchPurchasedMaterials, searchPurchaseOrder, searchSupplier, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, searchMateriel,
|
||||
addMateriel, deleteMateriel, saveMateriel } from '@/api/WorkshopProcurement/CreatingPurchasingMaterials'
|
||||
import QRCode from 'qrcode'
|
||||
import $ from 'jquery'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: '', // 离线合同
|
||||
name: '', // 采购计划
|
||||
data() {
|
||||
return {
|
||||
partDrawingNumberValue: '',
|
||||
partDrawingNumber: [],
|
||||
Buyer: '',
|
||||
showMaterialTable: true,
|
||||
loading1: false,
|
||||
title2: '',
|
||||
purchaseStateValue: 2, // 采购状态 全部
|
||||
purchaseState: [
|
||||
{
|
||||
label: '未采购',
|
||||
value: 1
|
||||
}, {
|
||||
label: '全部',
|
||||
value: 2
|
||||
}
|
||||
],
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
materialName: '',
|
||||
inventoryStateValue: '', // 库存状态
|
||||
inventoryState: [
|
||||
{
|
||||
label: '充足',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '不足',
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
tableData1: [],
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
offlineContractNum: '', // 离线合同流水号
|
||||
offlineContract: '', // 离线合同号
|
||||
purchasingOrder: '', // 采购单号
|
||||
purchasingOrderNumber: '', // 采购计划流水号
|
||||
supplierName0: '', // 供应商名称(外面的)
|
||||
supplierName: '', // 供应商名称
|
||||
payTime: [], // 付款时间节点
|
||||
tableData2: [],
|
||||
total2: 0,
|
||||
pageCurrent2: 1,
|
||||
@@ -492,34 +473,31 @@ export default {
|
||||
fax: '', // 传真
|
||||
tableData01: [],
|
||||
dialogVisible2: false,
|
||||
下单单位: '',
|
||||
下单日期: '',
|
||||
单号: '',
|
||||
计划完成日期: '',
|
||||
form2: {
|
||||
离线合同流水号: '',
|
||||
离线合同编号: '',
|
||||
离线合同名称: '',
|
||||
采购计划流水号: '',
|
||||
采购单名称: '',
|
||||
供应商流水号: '',
|
||||
供应商名称: '',
|
||||
规定到货时间: '',
|
||||
离线合同备注: '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
|
||||
计划完成日期: ''
|
||||
},
|
||||
rules2: { // 离线合同表单验证规则
|
||||
离线合同编号: [{ required: true, message: '请填写离线合同编号' }],
|
||||
离线合同名称: [{ required: true, message: '请填写离线合同名称' }],
|
||||
rules2: { // 采购表单验证规则
|
||||
采购单名称: [{ required: true, message: '请填写采购单名称' }],
|
||||
供应商名称: [{ required: true, message: '请选择供应商' }],
|
||||
规定到货时间: [{ required: true, message: '请选择规定到货时间' }],
|
||||
运费: [{ required: true, message: '请填写运费' }],
|
||||
付款方式: [{ required: true, message: '请选择付款方式' }]
|
||||
计划完成日期: [{ required: true, message: '请选择计划完成日期' }]
|
||||
},
|
||||
tableData3: [],
|
||||
materielGroup: [], // 物料流水号组
|
||||
partGroup: [], // 离线合同明细流水号组
|
||||
numGroup: [], // 数量组
|
||||
priceGroup: [], // 单价组
|
||||
totalPrice: 0, // 合同总额
|
||||
materielGroup: [], // 工艺计划流水号组
|
||||
partGroup: [], // 采购计划明细流水号组
|
||||
unit: [], // 单位组
|
||||
Remarks: [], // 备注组
|
||||
tableData4: [], // 合同模板
|
||||
stipulateArrivalTime: '', // 规定到货时间
|
||||
离线合同状态: '',
|
||||
采购计划状态: '',
|
||||
paramRow: '', // 参数row
|
||||
disable: true // 其他的禁用
|
||||
disable: false // 其他的禁用
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -550,18 +528,21 @@ export default {
|
||||
img.src = url
|
||||
})
|
||||
},
|
||||
fetchData() {},
|
||||
searchTable1() { // 查询物料库物料
|
||||
fetchData() {
|
||||
initPartDrawing(0, this.partDrawingNumberValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partDrawingNumber.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].零件图号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() { // 查询外购备料
|
||||
this.loading1 = true
|
||||
this.materialName ? this.check1 = 1 : this.check1 = 0
|
||||
this.inventoryStateValue ? this.check2 = 1 : this.check2 = 0
|
||||
searchInventoryNum(this.pageCurrent1, this.pageSize1, this.check1, this.materialName, this.check2, this.inventoryStateValue, this.purchaseStateValue).then(response => {
|
||||
this.partDrawingNumberValue ? this.check1 = 1 : this.check1 = 0
|
||||
searchPurchasedMaterials(this.pageCurrent1, this.pageSize1, this.check1, this.partDrawingNumberValue).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
|
||||
this.loading1 = false
|
||||
})
|
||||
@@ -578,75 +559,45 @@ export default {
|
||||
handleSelectionChange(val) {
|
||||
this.materielGroup = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.materielGroup.push(val[i].物料流水号)
|
||||
this.materielGroup.push(val[i].工艺计划流水号)
|
||||
}
|
||||
},
|
||||
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('设置失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable2() { // 查询离线合同列表
|
||||
this.offlineContract ? this.check3 = 1 : this.check3 = 0
|
||||
searchTable2() { // 查询采购单列表
|
||||
this.purchasingOrder ? this.check3 = 1 : this.check3 = 0
|
||||
this.supplierName0 ? this.check4 = 1 : this.check4 = 0
|
||||
searchOfflineContract(this.pageCurrent2, this.pageSize2, this.check3, this.offlineContract, this.check4, this.supplierName0).then(response => {
|
||||
searchPurchaseOrder(this.pageCurrent2, this.pageSize2, this.check3, this.purchasingOrder, this.check4, this.supplierName0).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange2(val) { // 离线合同列表分页
|
||||
handleSizeChange2(val) { // 采购单列表分页
|
||||
this.pageSize2 = val
|
||||
this.searchTable2()
|
||||
},
|
||||
handleCurrentChange2(val) { // 离线合同列表分页
|
||||
handleCurrentChange2(val) { // 采购单列表分页
|
||||
this.pageCurrent2 = val
|
||||
this.searchTable2()
|
||||
},
|
||||
addOfflineContract() { // 创建离线合同
|
||||
addPurchaseOrder() { // 创建采购单
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.title2 = '创建离线合同'
|
||||
this.form2.离线合同编号 = ''
|
||||
this.title2 = '创建采购单'
|
||||
this.form2.离线合同名称 = ''
|
||||
this.form2.供应商流水号 = ''
|
||||
this.form2.供应商名称 = ''
|
||||
this.form2.规定到货时间 = ''
|
||||
this.form2.离线合同备注 = '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
|
||||
this.form2.计划完成日期 = ''
|
||||
this.dialogVisible2 = true
|
||||
},
|
||||
submitAddOfflineContract() { // 新建离线合同
|
||||
submitAddPurchaseOrder() { // 新建采购单
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
const numGroup1 = [] // 空数组,放现有的询价单号
|
||||
searchOfflineContract2().then(response => { // 先查询判断是否存在
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
numGroup1.push(response.data[i].离线合同编号)
|
||||
}
|
||||
}).then(() => {
|
||||
if (numGroup1.indexOf(this.form2.离线合同编号) !== -1) {
|
||||
this.$message.error('该离线合同编号已存在')
|
||||
} else {
|
||||
addOfflineContract(this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.离线合同备注).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('新建离线合同成功')
|
||||
this.searchTable2()
|
||||
this.dialogVisible2 = false
|
||||
} else { this.$message.error('新建离线合同失败') }
|
||||
})
|
||||
}
|
||||
addPurchaseOrder(this.form2.采购单名称, this.form2.供应商流水号, this.id, this.form2.计划完成日期).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('新建采购单成功')
|
||||
this.searchTable2()
|
||||
this.dialogVisible2 = false
|
||||
} else { this.$message.error('新建采购单失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
@@ -654,42 +605,28 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
editOfflineContract(row) {
|
||||
editPurchaseOrder(row) {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.title2 = '编辑离线合同'
|
||||
this.form2.离线合同流水号 = row.离线合同流水号
|
||||
this.form2.离线合同编号 = row.离线合同编号
|
||||
this.form2.离线合同名称 = row.离线合同名称
|
||||
this.form2.供应商流水号 = row.供应商流水号
|
||||
this.title2 = '编辑采购单'
|
||||
this.form2.采购计划流水号 = row.采购计划流水号
|
||||
this.form2.采购单名称 = row.采购单名称
|
||||
this.form2.供应商流水号 = row.供应商
|
||||
this.form2.供应商名称 = row.供应商名称
|
||||
this.form2.规定到货时间 = row.规定到货时间
|
||||
this.form2.离线合同备注 = row.离线合同备注
|
||||
this.form2.计划完成日期 = row.计划完成日期
|
||||
this.dialogVisible2 = true
|
||||
},
|
||||
submitEditOfflineContract() {
|
||||
submitEditPurchaseOrder() {
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
const numGroup1 = [] // 空数组,放现有的离线合同号
|
||||
const numGroup2 = [] // 空数组,放现有的离线合同流水号
|
||||
searchOfflineContract2().then(response => { // 先查询判断是否存在
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
numGroup1.push(response.data[i].离线合同编号)
|
||||
numGroup2.push(response.data[i].离线合同流水号)
|
||||
}
|
||||
}).then(() => {
|
||||
if (numGroup1.indexOf(this.form2.离线合同编号) !== -1 && numGroup1.indexOf(this.form2.离线合同编号) !== numGroup2.indexOf(parseInt(this.form2.离线合同流水号))) {
|
||||
this.$message.error('该离线合同编号已存在')
|
||||
} else {
|
||||
editOfflineContract(this.form2.离线合同流水号, this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.离线合同备注).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改离线合同成功')
|
||||
this.searchTable2()
|
||||
this.dialogVisible2 = false
|
||||
} else { this.$message.error('修改离线合同失败') }
|
||||
})
|
||||
}
|
||||
console.log(this.form2.采购计划流水号, this.form2.采购单名称, this.form2.供应商流水号, this.form2.计划完成日期)
|
||||
editPurchaseOrder(this.form2.采购计划流水号, this.form2.采购单名称, this.form2.供应商流水号, this.form2.计划完成日期).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改采购单成功')
|
||||
this.searchTable2()
|
||||
this.dialogVisible2 = false
|
||||
} else { this.$message.error('修改采购单失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
@@ -697,18 +634,18 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteOfflineContract(row) { // 删除离线合同
|
||||
deletePurchaseOrder(row) { // 删除采购单
|
||||
this.$confirm('确定删除该合同?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteOfflineContract(row.离线合同流水号).then(response => {
|
||||
deletePurchaseOrder(row.采购计划流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchTable2()
|
||||
this.disable = true
|
||||
searchMateriel(this.offlineContractNum).then(response => {
|
||||
searchMateriel(this.purchasingOrderNumber).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
} else { this.$message.error('数据占用,删除失败') }
|
||||
@@ -772,68 +709,76 @@ export default {
|
||||
submitSelectSupplier() { // 确定选择供应商
|
||||
this.dialogVisible1 = false
|
||||
},
|
||||
searchTable3(row) { // 查询离线合同明细
|
||||
this.stipulateArrivalTime = row.规定到货时间.split(' ')[0]
|
||||
this.offlineContractNum = row.离线合同流水号
|
||||
this.离线合同状态 = row.离线合同状态
|
||||
searchMateriel(this.offlineContractNum).then(response => {
|
||||
searchTable3(row) { // 查询采购计划明细
|
||||
this.purchasingOrderNumber = row.采购计划流水号
|
||||
this.采购计划状态 = row.采购计划状态
|
||||
this.下单单位 = row.供应商名称
|
||||
this.单号 = row.采购单号
|
||||
this.计划完成日期 = row.计划完成日期.split(' ')[0]
|
||||
this.下单日期 = row.下单日期.split(' ')[0]
|
||||
searchMateriel(this.purchasingOrderNumber).then(response => {
|
||||
console.log(response.data)
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
Number(row.离线合同状态) !== 1 ? this.disable = true : this.disable = false // 是否为编辑模式
|
||||
},
|
||||
getSummaries(param) { // 合计
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总价'
|
||||
} else if (index === 7) {
|
||||
const values = data.map(item => Number(parseFloat(item['单价']) * parseInt(item['数量'])))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' 元'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
addMateriel() { // 将物料选入离线合同
|
||||
if (!this.offlineContractNum) {
|
||||
this.$message.warning('请选择离线合同')
|
||||
} else if (Number(this.离线合同状态) !== 1) {
|
||||
this.$message.warning('请选择可编辑的离线合同')
|
||||
addMateriel() { // 将材料选入请购单
|
||||
if (!this.purchasingOrderNumber) {
|
||||
this.$message.warning('请选择采购单')
|
||||
} else if (this.materielGroup.length === 0) {
|
||||
this.$message.warning('请勾选物料')
|
||||
} else {
|
||||
addMateriel(this.offlineContractNum, this.materielGroup).then(response => {
|
||||
addMateriel(this.purchasingOrderNumber, this.materielGroup).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('选入成功')
|
||||
searchMateriel(this.offlineContractNum).then(response => {
|
||||
this.searchTable1()
|
||||
searchMateriel(this.purchasingOrderNumber).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
} else { this.$message.error('选入失败') }
|
||||
})
|
||||
}
|
||||
},
|
||||
saveMateriel() { // 保存数据
|
||||
this.partGroup = []
|
||||
this.unit = []
|
||||
this.Remarks = []
|
||||
if (!this.purchasingOrderNumber) {
|
||||
this.$message.warning('请选择采购单')
|
||||
} else {
|
||||
for (let i = 0; i < this.tableData3.length; i++) {
|
||||
this.partGroup.push(this.tableData3[i].采购计划明细流水号)
|
||||
if (this.tableData3[i].单位 === '' || this.tableData3[i].单位 === null) {
|
||||
this.tableData3[i].单位 = '无'
|
||||
}
|
||||
this.unit.push(this.tableData3[i].单位)
|
||||
if (this.tableData3[i].备注1 === '' || this.tableData3[i].备注1 === null) {
|
||||
this.tableData3[i].备注1 = '无'
|
||||
}
|
||||
this.Remarks.push(this.tableData3[i].备注1)
|
||||
}
|
||||
saveMateriel(this.purchasingOrderNumber, this.partGroup, this.unit, this.Remarks).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
this.searchTable2()
|
||||
searchMateriel(this.purchasingOrderNumber).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
} else { this.$message.error('保存失败') }
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteMateriel(row) { // 移除物料
|
||||
this.$confirm('确定移除该物料?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteMateriel(row.离线合同明细流水号).then(response => {
|
||||
console.log(row)
|
||||
deleteMateriel(row.采购计划明细流水号, row.工艺计划流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('移除成功')
|
||||
searchMateriel(this.offlineContractNum).then(response => {
|
||||
this.searchTable1()
|
||||
searchMateriel(this.purchasingOrderNumber).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
} else { this.$message.error('移除失败') }
|
||||
@@ -845,83 +790,14 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
doneOfflineContact() { // 生成离线合同
|
||||
this.$confirm('确定生成合同?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.totalPrice = 0
|
||||
this.partGroup = []
|
||||
this.numGroup = []
|
||||
this.priceGroup = []
|
||||
for (let i = 0; i < this.tableData3.length; i++) {
|
||||
this.totalPrice += this.tableData3[i].数量 * this.tableData3[i].单价
|
||||
this.partGroup.push(this.tableData3[i].离线合同明细流水号)
|
||||
this.numGroup.push(this.tableData3[i].数量)
|
||||
this.priceGroup.push(this.tableData3[i].单价)
|
||||
}
|
||||
doneOfflineContact(this.offlineContractNum, this.totalPrice, this.partGroup, this.numGroup, this.priceGroup).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('离线合同生成成功')
|
||||
this.searchTable2()
|
||||
searchMateriel(this.offlineContractNum).then(response => {
|
||||
this.tableData3 = response.data
|
||||
this.disable = true // 是否为编辑模式
|
||||
})
|
||||
} else { this.$message.error('离线合同生成失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
exportExcel(row) {
|
||||
exportExcel() {
|
||||
this.$confirm('确定导出该合同?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementsByClassName('offlineContract')[0]
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
}
|
||||
}
|
||||
const tr = []
|
||||
let length = 0
|
||||
this.tableData3.length < 15 ? length = 15 : length = this.tableData3.length
|
||||
for (let i = 0; i < length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData')
|
||||
tr[i].innerHTML = `<td style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td colspan="2" style="height: 40px"/><td style="height: 40px"/>`
|
||||
document.getElementById('tablehead').after(tr[i])
|
||||
}
|
||||
let total = 0
|
||||
for (let j = 0; j < this.tableData3.length; j++) {
|
||||
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
|
||||
document.getElementsByClassName('tableData')[j].children[1].innerHTML = this.tableData3[j].物料名称
|
||||
document.getElementsByClassName('tableData')[j].children[2].innerHTML = this.tableData3[j].物料规格
|
||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料型号
|
||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
|
||||
document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData3[j].单价
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = this.tableData3[j].数量 * this.tableData3[j].单价
|
||||
document.getElementsByClassName('tableData')[j].children[7].innerHTML = ''
|
||||
total += this.tableData3[j].数量 * this.tableData3[j].单价
|
||||
}
|
||||
document.getElementById('contractNum').innerHTML = row.离线合同编号
|
||||
document.getElementById('contractName').innerHTML = row.离线合同名称
|
||||
document.getElementById('supplier').innerHTML = row.供应商名称
|
||||
document.getElementById('buyer').innerHTML = row.采购员
|
||||
document.getElementById('total').innerHTML = total
|
||||
$('#qrCode').html(`<img id="img" style="display: block;margin: 0 auto">`)
|
||||
this.useqrcode(row.离线合同流水号) // 显示二维码
|
||||
}).then(() => {
|
||||
const htmlNode = $('#offlineContract').html()
|
||||
const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 800px;background: #fff;')
|
||||
const htmlNode = $('#cjn').html()
|
||||
const body = $('body')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
|
||||
@@ -129,11 +129,73 @@
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData3" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
|
||||
<el-table-column label="供应商" align="center" min-width="170">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款时间" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款人" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核" align="center" width="320">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData1" stripe size="mini" show-summary>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="采购单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="150" align="center" label="采购单名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="计划总额" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable03(scope.row)">查看详情</el-button>
|
||||
</el-popover>
|
||||
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesMaterials(scope.row)">通过</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-close" @click="noMaterials(scope.row)">不通过</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent3"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize3"
|
||||
:total="total3"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { execApproval, initApproval1, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/WorkshopProcurement/FundApproval'
|
||||
import { execApproval, initApproval1, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline, searchRequsetFundDetail1, initApprovalMaterials, execMaterials } from '@/api/WorkshopProcurement/FundApproval'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -148,7 +210,12 @@ export default {
|
||||
pageSize2: 10,
|
||||
pageCurrent2: 1,
|
||||
total2: 0,
|
||||
gridData: []
|
||||
tableData3: [],
|
||||
pageSize3: 10,
|
||||
pageCurrent3: 1,
|
||||
total3: 0,
|
||||
gridData: [],
|
||||
gridData1: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -166,6 +233,7 @@ export default {
|
||||
fetchData() {
|
||||
this.searchTable()
|
||||
this.searchTable2()
|
||||
this.searchTable3()
|
||||
},
|
||||
searchTable() {
|
||||
initApproval1(this.pageCurrent, this.pageSize, 2).then(response => {
|
||||
@@ -207,6 +275,27 @@ export default {
|
||||
this.gridData = response.data
|
||||
})
|
||||
},
|
||||
searchTable3() {
|
||||
initApprovalMaterials(this.pageCurrent3, this.pageSize3, 1).then(response => {
|
||||
console.log(response.data.rows)
|
||||
this.tableData3 = response.data.rows
|
||||
this.total3 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageSize3 = val
|
||||
this.pageCurrent3 = 1
|
||||
this.searchTable3()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageCurrent3 = val
|
||||
this.searchTable3()
|
||||
},
|
||||
searchTable03(row) { // 查看详情(请款信息包含的合同)
|
||||
searchRequsetFundDetail1(row.采购计划请款流水号).then(response => {
|
||||
this.gridData1 = response.data
|
||||
})
|
||||
},
|
||||
yesApproval(row) { // 通过审核
|
||||
this.$confirm('确定审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -280,6 +369,43 @@ export default {
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
yesMaterials(row) { // 通过审核
|
||||
this.$confirm('确定审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
execMaterials(row.采购计划请款流水号, 1, '通过', this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable3()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
noMaterials(row) { // 不通过审核
|
||||
this.$prompt('请输入不通过原因', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(({ value }) => {
|
||||
execMaterials(row.采购计划请款流水号, 2, value, this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable3()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,11 +129,73 @@
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData3" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
|
||||
<el-table-column label="供应商" align="center" min-width="170">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款时间" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款人" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核" align="center" width="320">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData1" stripe size="mini" show-summary>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="采购单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="150" align="center" label="采购单名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="计划总额" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable03(scope.row)">查看详情</el-button>
|
||||
</el-popover>
|
||||
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesMaterials(scope.row)">通过</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-close" @click="noMaterials(scope.row)">不通过</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent3"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize3"
|
||||
:total="total3"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { execApproval, initApproval1, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/WorkshopProcurement/FundApproval'
|
||||
import { execApproval, initApproval1, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline, searchRequsetFundDetail1, initApprovalMaterials, execMaterials } from '@/api/WorkshopProcurement/FundApproval'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -148,7 +210,12 @@ export default {
|
||||
pageSize2: 10,
|
||||
pageCurrent2: 1,
|
||||
total2: 0,
|
||||
gridData: []
|
||||
gridData: [],
|
||||
tableData3: [],
|
||||
pageSize3: 10,
|
||||
pageCurrent3: 1,
|
||||
total3: 0,
|
||||
gridData1: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -166,6 +233,7 @@ export default {
|
||||
fetchData() {
|
||||
this.searchTable()
|
||||
this.searchTable2()
|
||||
this.searchTable3()
|
||||
},
|
||||
searchTable() {
|
||||
initApproval1(this.pageCurrent, this.pageSize, 3).then(response => {
|
||||
@@ -207,6 +275,27 @@ export default {
|
||||
this.gridData = response.data
|
||||
})
|
||||
},
|
||||
searchTable3() {
|
||||
initApprovalMaterials(this.pageCurrent3, this.pageSize3, 2).then(response => {
|
||||
console.log(response.data.rows)
|
||||
this.tableData3 = response.data.rows
|
||||
this.total3 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageSize3 = val
|
||||
this.pageCurrent3 = 1
|
||||
this.searchTable3()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageCurrent3 = val
|
||||
this.searchTable3()
|
||||
},
|
||||
searchTable03(row) { // 查看详情(请款信息包含的合同)
|
||||
searchRequsetFundDetail1(row.采购计划请款流水号).then(response => {
|
||||
this.gridData1 = response.data
|
||||
})
|
||||
},
|
||||
yesApproval(row) { // 通过审核
|
||||
this.$confirm('确定审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -280,6 +369,43 @@ export default {
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
yesMaterials(row) { // 通过审核
|
||||
this.$confirm('确定审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
execMaterials(row.采购计划请款流水号, 1, '通过', this.id, 2).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable3()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
noMaterials(row) { // 不通过审核
|
||||
this.$prompt('请输入不通过原因', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(({ value }) => {
|
||||
execMaterials(row.采购计划请款流水号, 2, value, this.id, 2).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable3()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,613 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>发票号:</span>
|
||||
<el-input v-model="invoiceNum" placeholder="发票号" size="small" clearable/>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
|
||||
<span>传送人:</span>
|
||||
<el-select v-model="transmitValue" placeholder="传送人" size="small" filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in selectPerson1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>接收人:</span>
|
||||
<el-select v-model="recipientValue" placeholder="接收人" size="small" filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in selectPerson"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-left: 10px"
|
||||
@click="addTable1()">增加</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 400px" height="400px" stripe border>
|
||||
<el-table-column align="center" label="发票号" min-width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发票号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="开票时间" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.开票时间 }}
|
||||
</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="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="传送人" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传送人姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="接收人" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.接收人姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" min-width="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" fixed="right" width="350px">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="450" trigger="click">
|
||||
<el-table :data="gridData" stripe size="mini" show-summary>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="采购单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="采购单名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="总价" prop="总价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" @click="searchTable02(scope.row)">查看详情</el-button>
|
||||
</el-popover>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
style="margin-left: 10px"
|
||||
@click="editTable1(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteTable1(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="25%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px">
|
||||
<el-form-item label="供应商名称" prop="供应商名称">
|
||||
<el-input v-model="form1.供应商名称" size="small" readonly>
|
||||
<el-button slot="append" icon="el-icon-search" @click="dialogVisible=true"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购单号" prop="contractNum">
|
||||
<el-select :disabled="title1==='编辑'" v-model="form1.contractNum" placeholder="采购单号" size="small" multiple filterable clearable>
|
||||
<el-option
|
||||
v-for="item in contractNums"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票时间" prop="invoiceTime">
|
||||
<el-date-picker v-model="form1.invoiceTime" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票金额" prop="money">
|
||||
<el-input v-model="form1.money" size="small" placeholder="开票金额"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="传送人" prop="sendPerson">
|
||||
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in selectPerson1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="接收人" prop="receivePerson">
|
||||
<el-select v-model="form1.receivePersonValue" placeholder="接收人" size="small" filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in selectPerson"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form1.remark" size="small"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogVisible1 = false">取消</el-button>
|
||||
<el-button v-show="title1==='增加'" size="small" type="primary" @click="submitAdd1('form1')">确定</el-button>
|
||||
<el-button v-show="title1==='编辑'" size="small" type="primary" @click="submitEdit1('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogVisible" title="供应商选择" center style="min-height: 300px">
|
||||
<el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="supplierName" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业性质">
|
||||
<el-input v-model="enterpriseNature" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="货期">
|
||||
<el-input v-model="goodTime" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册资本">
|
||||
<el-input v-model="registeredCapital" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="税号">
|
||||
<el-input v-model="taxNum" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电子邮箱">
|
||||
<el-input v-model="EMail" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地址">
|
||||
<el-input v-model="address" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="account" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行">
|
||||
<el-input v-model="openingBank" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话号码">
|
||||
<el-input v-model="phone" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="传真">
|
||||
<el-input v-model="fax" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
@click="searchSupplier">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitSelectSupplier">确定</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
@click="emptySupplierDetail">清空</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="tableData01" size="mini" style="width: 97%;max-height: 300px;margin-top:15px" height="200px" border @row-click="showSupplierDetail">
|
||||
<el-table-column align="center" label="供应商名称" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="企业性质" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.企业性质 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="创立日期" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.创立日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="注册资本" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.注册资本 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { searchInvoice, addInvoice, editInvoice, deleteInvoice, initPerson, initPerson1, searchSupplier, initPurchase, searchInvoiceDetail } from '@/api/WorkshopProcurement/OutsourcingMaterialsInvoice'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: '', // 发票交接单
|
||||
data() {
|
||||
return {
|
||||
contractNumValue: '',
|
||||
contractNums: [],
|
||||
invoiceNum: '',
|
||||
invoiceTime: '',
|
||||
transmitValue: this.id,
|
||||
selectPerson: [], // 接收人
|
||||
selectPerson1: [], // 传送人
|
||||
recipientValue: '',
|
||||
contractNum: '',
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
tableData1: [],
|
||||
tableData01: [],
|
||||
gridData: [],
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
check5: 0,
|
||||
supplierCheck1: 0,
|
||||
supplierCheck2: 0,
|
||||
supplierCheck3: 0,
|
||||
supplierCheck4: 0,
|
||||
supplierCheck5: 0,
|
||||
supplierCheck6: 0,
|
||||
supplierCheck7: 0,
|
||||
supplierCheck8: 0,
|
||||
supplierCheck9: 0,
|
||||
supplierCheck10: 0,
|
||||
supplierCheck11: 0,
|
||||
supplierCheck12: 0,
|
||||
supplierName0: '', // 供应商名称(外面的)
|
||||
supplierName: '', // 供应商名称
|
||||
supplierValue: '', // 供应商流水号
|
||||
goodTime: '', // 货期
|
||||
enterpriseNature: '', // 企业性质
|
||||
createDate: '', // 创立日期
|
||||
registeredCapital: '', // 注册资本
|
||||
taxNum: '', // 税号
|
||||
EMail: '', // 电子邮箱
|
||||
address: '', // 地址
|
||||
account: '', // 账号
|
||||
openingBank: '', // 开户行
|
||||
phone: '', // 电话号码
|
||||
fax: '', // 传真
|
||||
dialogVisible: false,
|
||||
dialogVisible1: false,
|
||||
title1: '',
|
||||
form1: {
|
||||
供应商名称: '',
|
||||
供应商流水号: '',
|
||||
contractNum: [],
|
||||
invoiceNumValue: '',
|
||||
invoiceTime: '',
|
||||
money: '',
|
||||
sendPersonValue: '',
|
||||
receivePersonValue: '',
|
||||
remark: ''
|
||||
},
|
||||
rules1: {
|
||||
contractNum: [
|
||||
{ required: true, message: '请选择采购单号', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
initPerson().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.selectPerson.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
initPerson1().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.selectPerson1.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
initPurchase().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNums.push({
|
||||
label: response.data[i].采购单号,
|
||||
value: response.data[i].采购计划流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.invoiceNum ? this.check1 = 1 : this.check1 = 0
|
||||
this.supplierName0 ? this.check2 = 1 : this.check2 = 0
|
||||
this.transmitValue ? this.check3 = 1 : this.check3 = 0
|
||||
this.recipientValue ? this.check4 = 1 : this.check4 = 0
|
||||
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.supplierName0, this.check3, this.transmitValue, this.check4, this.recipientValue).then(response => {
|
||||
console.log(response.data)
|
||||
for (let j = 0; j < response.data.rows.length; j++) {
|
||||
response.data.rows[j].开票金额 = parseInt(response.data.rows[j].开票金额 * 100) / 100
|
||||
if (response.data.rows[j].开票时间 !== null) {
|
||||
response.data.rows[j].开票时间 = response.data.rows[j].开票时间.substring(0, response.data.rows[j].开票时间.indexOf(' '))
|
||||
}
|
||||
if (response.data.rows[j].开票时间 === '1900/1/1') {
|
||||
response.data.rows[j].开票时间 = ''
|
||||
}
|
||||
}
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
searchTable02(row) { // 查看详情(发票包含的合同)
|
||||
searchInvoiceDetail(row.发票流水号).then(response => {
|
||||
this.gridData = response.data
|
||||
})
|
||||
},
|
||||
searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据
|
||||
this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '')
|
||||
this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '')
|
||||
this.createDate ? this.supplierCheck3 = 1 : (this.supplierCheck3 = 0, this.createDate = '')
|
||||
this.registeredCapital ? this.supplierCheck4 = 1 : (this.supplierCheck4 = 0, this.registeredCapital = '')
|
||||
this.taxNum ? this.supplierCheck5 = 1 : (this.supplierCheck5 = 0, this.taxNum = '')
|
||||
this.EMail ? this.supplierCheck6 = 1 : (this.supplierCheck6 = 0, this.EMail = '')
|
||||
this.address ? this.supplierCheck7 = 1 : (this.supplierCheck7 = 0, this.address = '')
|
||||
this.account ? this.supplierCheck8 = 1 : (this.supplierCheck8 = 0, this.account = '')
|
||||
this.openingBank ? this.supplierCheck9 = 1 : (this.supplierCheck9 = 0, this.openingBank = '')
|
||||
this.phone ? this.supplierCheck10 = 1 : (this.supplierCheck10 = 0, this.phone = '')
|
||||
this.fax ? this.supplierCheck11 = 1 : (this.supplierCheck11 = 0, this.fax = '')
|
||||
this.goodTime ? this.supplierCheck12 = 1 : (this.supplierCheck12 = 0, this.goodTime = '')
|
||||
searchSupplier(this.supplierCheck1, this.supplierName, this.supplierCheck2, this.enterpriseNature, this.supplierCheck3, this.createDate, this.supplierCheck4, this.registeredCapital, this.supplierCheck5, this.taxNum, this.supplierCheck6, this.EMail, this.supplierCheck7, this.address, this.supplierCheck8, this.account, this.supplierCheck9, this.openingBank, this.supplierCheck10, this.phone, this.supplierCheck11, this.fax, this.supplierCheck12, this.goodTime).then(response => {
|
||||
this.tableData01 = response.data
|
||||
})
|
||||
},
|
||||
showSupplierDetail(row) {
|
||||
this.form1.供应商流水号 = row.供应商流水号
|
||||
this.form1.供应商名称 = row.供应商名称
|
||||
this.supplierValue = row.供应商流水号
|
||||
this.supplierName = row.供应商名称
|
||||
this.enterpriseNature = row.企业性质
|
||||
this.createDate = row.创立日期
|
||||
this.registeredCapital = row.注册资本
|
||||
this.taxNum = row.税号
|
||||
this.EMail = row.电子信箱
|
||||
this.address = row.地址
|
||||
this.account = row.帐号
|
||||
this.openingBank = row.开户行
|
||||
this.phone = row.电话号码
|
||||
this.fax = row.传真
|
||||
this.goodTime = row.货期
|
||||
},
|
||||
emptySupplierDetail() {
|
||||
this.supplierValue = ''
|
||||
this.supplierName = ''
|
||||
this.enterpriseNature = ''
|
||||
this.createDate = ''
|
||||
this.registeredCapital = ''
|
||||
this.taxNum = ''
|
||||
this.EMail = ''
|
||||
this.address = ''
|
||||
this.account = ''
|
||||
this.openingBank = ''
|
||||
this.phone = ''
|
||||
this.fax = ''
|
||||
this.goodTime = ''
|
||||
},
|
||||
submitSelectSupplier() { // 确定选择供应商
|
||||
this.dialogVisible = false
|
||||
},
|
||||
addTable1() {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '增加'
|
||||
this.dialogVisible1 = true
|
||||
this.form1.供应商名称 = ''
|
||||
this.form1.供应商流水号 = ''
|
||||
this.form1.contractNum = []
|
||||
this.contractNumValue = ''
|
||||
this.form1.invoiceTime = ''
|
||||
this.form1.money = ''
|
||||
this.form1.sendPersonValue = parseInt(this.id)
|
||||
this.form1.receivePersonValue = ''
|
||||
this.form1.remark = ''
|
||||
},
|
||||
submitAdd1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.contractNumValue = this.form1.contractNum[0]
|
||||
for (let h = 1; h < this.form1.contractNum.length; h++) {
|
||||
this.contractNumValue += ',' + this.form1.contractNum[h]
|
||||
}
|
||||
addInvoice(this.form1.contractNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark, this.form1.供应商流水号, this.contractNumValue).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('增加失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
editTable1(row) {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '编辑'
|
||||
console.log(row)
|
||||
this.dialogVisible1 = true
|
||||
this.form1.contractNum = (row.采购计划流水号.split(',')).map(Number)
|
||||
this.form1.invoiceNumValue = row.发票流水号
|
||||
this.form1.invoiceTime = row.开票时间
|
||||
this.form1.money = row.开票金额
|
||||
this.form1.sendPersonValue = parseInt(row.传送人)
|
||||
this.form1.receivePersonValue = parseInt(row.接收人)
|
||||
this.form1.remark = row.备注
|
||||
this.form1.供应商流水号 = row.供应商
|
||||
this.form1.供应商名称 = row.供应商名称
|
||||
console.log(row.开票时间)
|
||||
if (row.开票时间 === '1900/1/1') {
|
||||
this.form1.invoiceTime = null
|
||||
}
|
||||
if (parseInt(row.传送人) === 0) {
|
||||
this.form1.sendPersonValue = ''
|
||||
}
|
||||
if (parseInt(row.接收人) === 0) {
|
||||
this.form1.receivePersonValue = ''
|
||||
}
|
||||
},
|
||||
submitEdit1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.form1.remark)
|
||||
editInvoice(this.form1.invoiceNumValue, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark, this.form1.供应商流水号).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteTable1(row) {
|
||||
console.log(row)
|
||||
this.$confirm('确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteInvoice(row.发票流水号).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
</style>
|
||||
317
src/views/WorkshopProcurement/OutsourcingStockArrival/index.vue
Normal file
317
src/views/WorkshopProcurement/OutsourcingStockArrival/index.vue
Normal file
@@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div slot="header">
|
||||
<span>采购单号:</span>
|
||||
<el-select v-model="purchaseOrderValue" placeholder="采购单号" size="small" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in purchaseOrder"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" style="width: 200px" size="small" clearable/>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="pageCurrent=1;pageSize=10;total=0;searchTable()">查询</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%;max-height: 460px;"
|
||||
height="270"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
@row-click="searchTable1">
|
||||
<el-table-column label="单号" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单名称" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总价" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.总价" size="mini" style="width:100px" @change="totalChange(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="下单日期" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.下单日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划完成日期" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计划完成日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" :summary-method="getSummaries" border style="max-height: 300px;" height="400px" size="mini" show-summary>
|
||||
<el-table-column label="状态" align="center" width="100" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.是否到货)===0" type="warning" size="small">未到货</el-tag>
|
||||
<el-tag v-if="Number(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="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.备注1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.重量1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合计" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 * scope.row.单价 * scope.row.重量1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" icon="el-icon-goods" @click="OpenArrival(scope.row)">到货</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogVisible" title="到货" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="100px">
|
||||
<el-row>
|
||||
<el-form-item label="重量" prop="重量">
|
||||
<el-input v-model="form.重量" size="small" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="单价" prop="单价">
|
||||
<el-input v-model="form.单价" size="small" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitArrival">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { initPurchaseOrder, searchPurchaseOrder, searchMateriel, Arrival, totalChange } from '@/api/WorkshopProcurement/OutsourcingStockArrival'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
purchaseOrderValue: '',
|
||||
purchaseOrder: [],
|
||||
supplierName0: '',
|
||||
totalMoney: 0,
|
||||
check: 0,
|
||||
chekc1: 0,
|
||||
num: '',
|
||||
tableData: [],
|
||||
tableData1: [],
|
||||
loading: false,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
disable: true,
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
采购计划明细流水号: '',
|
||||
重量: '',
|
||||
单价: ''
|
||||
},
|
||||
rules: {
|
||||
重量: [{ required: true, message: '请填写重量' }],
|
||||
单价: [{ required: true, message: '请填写单价' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
initPurchaseOrder(0, this.purchaseOrderValue, 0, this.supplierName0).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.purchaseOrder.push({
|
||||
label: response.data[i].采购单号,
|
||||
value: response.data[i].采购单号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() { // 查询外购备料
|
||||
this.loading = true
|
||||
this.purchaseOrderValue ? this.check = 1 : this.check = 0
|
||||
this.supplierName0 ? this.check1 = 1 : this.check1 = 0
|
||||
searchPurchaseOrder(this.pageCurrent, this.pageSize, this.check, this.purchaseOrderValue, this.check1, this.supplierName0).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageCurrent = 1
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
searchTable1(row) {
|
||||
this.num = row.采购计划流水号
|
||||
this.totalMoney = 0
|
||||
searchMateriel(this.num).then(response => {
|
||||
this.tableData1 = response.data
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.totalMoney += (response.data[i].批次数量 * response.data[i].重量1 * response.data[i].单价)
|
||||
}
|
||||
})
|
||||
},
|
||||
totalChange(row) {
|
||||
totalChange(row.采购计划流水号, row.总价).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
},
|
||||
OpenArrival(row) {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.dialogVisible = true
|
||||
this.form.采购计划明细流水号 = row.采购计划明细流水号
|
||||
this.form.重量 = row.重量1
|
||||
this.form.单价 = row.单价
|
||||
},
|
||||
submitArrival() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
Arrival(this.form.采购计划明细流水号, this.form.重量, this.form.单价).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('到货成功')
|
||||
searchMateriel(this.num).then(response => {
|
||||
this.tableData1 = response.data
|
||||
this.totalMoney = 0
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.totalMoney += (response.data[i].批次数量 * response.data[i].重量1 * response.data[i].单价)
|
||||
}
|
||||
})
|
||||
this.dialogVisible = false
|
||||
} else { this.$message.error('到货失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 7) {
|
||||
sums[index] = '总重量'
|
||||
return
|
||||
} else if (index === 8) {
|
||||
const values = data.map(item => Number(item['重量1'] * item['批次数量']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' kg'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 9) {
|
||||
sums[index] = '总价'
|
||||
} else if (index === 10) {
|
||||
sums[index] = this.totalMoney
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,366 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>请款时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
:picker-options="pickerOptions"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 300px"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName0" 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-button type="primary" size="small" icon="el-icon-goods" style="" @click="requestFund">请款</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" border style="max-height: 500px;" height="500px" size="mini" show-summary>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款时间" align="center" min-width="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 label="请款金额" align="center" min-width="90" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款付款情况" align="center">
|
||||
<el-table-column label="审批情况内容" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.审批情况流水号)===3" type="primary" size="small">未审批</el-tag>
|
||||
<el-tag v-if="Number(scope.row.审批情况流水号)===1" type="success" size="small">已通过</el-tag>
|
||||
<el-tag v-if="Number(scope.row.审批情况流水号)===2" type="danger" size="small">不通过</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未通过审批原因" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.未通过审批原因 === '通过' ? '—' : scope.row.未通过审批原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款情况" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.付款情况流水号)===3" type="primary" size="small">未操作</el-tag>
|
||||
<el-tag v-if="Number(scope.row.付款情况流水号)===1" type="success" size="small">已同意</el-tag>
|
||||
<el-tag v-if="Number(scope.row.付款情况流水号)===2" type="danger" size="small">不同意</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未付款原因" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.未付款原因 === '通过' ? '—' : scope.row.未付款原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData" stripe size="mini" show-summary>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="采购单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="150" align="center" label="采购单名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="计划总额" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" @click="searchTable02(scope.row)">查看详情</el-button>
|
||||
</el-popover>
|
||||
<el-button :disabled="Number(scope.row.审批情况流水号)!==3" type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px" @click="cancelRequestFund(scope.row)">取消请款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible2" title="采购计划请款" center style="min-height: 300px" width="1200px">
|
||||
<span>供应商:</span>
|
||||
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in supplier"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin: 0 10px 10px 10px"
|
||||
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable01()">查询</el-button>
|
||||
<el-table v-loading="" :data="tableData01" border style="max-height: 300px;" height="300px" size="mini" @selection-change="handleSelectionChange">
|
||||
<el-table-column :selectable="selectable" type="selection" align="center" width="50"/>
|
||||
<el-table-column label="采购单号" align="center" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单名称" align="center" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.已付金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :max="scope.row.总价 - scope.row.已付金额" :disabled="(scope.row.总价 - scope.row.已付金额) === 0" v-model="scope.row.请款金额" controls-position="right" size="mini" style="width:100%"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span>合计:<el-input v-model="SUM" size="mini" style="width: 80px; margin: 10px 10px 0 10px"/>元</span>
|
||||
<el-button type="primary" size="small" style="float:right;margin: 10px 10px 0 10px" icon="el-icon-check" @click="submitRequestFund">确定请款</el-button>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { searchRequestFund, searchOfflineContract, submitRequestFund, searchRequsetFundDetail, cancelRequestFund } from '@/api/WorkshopProcurement/RequestOutsourcingMaterials'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 离线合同
|
||||
data() {
|
||||
return {
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
dateRange: '',
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '上季度',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(end.getTime() - 3600 * 1000 * 24 * 30 * 3)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '过去半年',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(end.getTime() - 3600 * 1000 * 24 * 366 / 2)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '过去一年',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(end.getTime() - 3600 * 1000 * 24 * 365)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
offlineContract: '',
|
||||
supplierName0: '',
|
||||
supplierValue: '',
|
||||
supplier: [],
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
tableData1: [],
|
||||
pageCurrent2: 1,
|
||||
pageSize2: 10,
|
||||
total2: 0,
|
||||
tableData01: [],
|
||||
dialogVisible2: false,
|
||||
SUM: 0,
|
||||
contractGroup: [],
|
||||
sumGroup: [],
|
||||
gridData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.searchTable1()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.supplier = []
|
||||
searchOfflineContract().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.supplier.push({
|
||||
label: response.data[i].供应商名称,
|
||||
value: response.data[i].供应商流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(this.supplier)
|
||||
},
|
||||
searchTable1() { // 查询请款表
|
||||
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
|
||||
this.supplierName0 ? this.check2 = 1 : (this.check2 = 0, this.supplierName0 = '')
|
||||
searchRequestFund(this.pageCurrent1, this.pageSize1, this.check1, this.dateRange[0], this.dateRange[1], this.check2, this.supplierName0).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageSize1 = val
|
||||
this.pageCurrent1 = 1
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
requestFund() { // 请款
|
||||
this.dialogVisible2 = true
|
||||
this.supplierValue = ''
|
||||
this.fetchData() // 重新获取供应商
|
||||
this.tableData01 = []
|
||||
},
|
||||
searchTable01() { // 查询待请款
|
||||
if (this.supplierValue) {
|
||||
this.contractGroup = []
|
||||
searchOfflineContract(this.supplierValue).then(response => {
|
||||
this.tableData01 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请选择供应商')
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.SUM = 0
|
||||
this.contractGroup = []
|
||||
this.sumGroup = []
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.SUM += parseFloat(val[i].请款金额)
|
||||
this.contractGroup.push(val[i].采购计划流水号)
|
||||
this.sumGroup.push(val[i].请款金额)
|
||||
}
|
||||
},
|
||||
selectable(row, index) { // 控制某行是否可选
|
||||
return parseInt(row.已请款) !== 1 // 已经请款
|
||||
},
|
||||
submitRequestFund() { // 确认请款
|
||||
if (this.supplierValue && this.contractGroup.length !== 0) {
|
||||
submitRequestFund(this.contractGroup, this.sumGroup, this.supplierValue, this.SUM, this.id).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('请款成功')
|
||||
this.searchTable1()
|
||||
this.dialogVisible2 = false
|
||||
} else { this.$message.error('请款失败') }
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请选择需要请款的合同')
|
||||
}
|
||||
},
|
||||
searchTable02(row) { // 查看详情(请款信息包含的合同)
|
||||
searchRequsetFundDetail(row.采购计划请款流水号).then(response => {
|
||||
this.gridData = response.data
|
||||
})
|
||||
},
|
||||
cancelRequestFund(row) { // 取消请款
|
||||
this.$confirm('确定取消请款?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
cancelRequestFund(row.采购计划请款流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('取消成功')
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('取消失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.el-tag{
|
||||
margin: 0
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
428
src/views/WorkshopProcurement/StockPreparation/index.vue
Normal file
428
src/views/WorkshopProcurement/StockPreparation/index.vue
Normal file
@@ -0,0 +1,428 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div slot="header">
|
||||
<span>入库单号:</span>
|
||||
<el-select v-model="warehouseReceiptValue" placeholder="入库单号" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in warehouseReceipt"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" style="width: 200px" size="small" clearable/>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="pageCurrent=1;pageSize=10;total=0;searchTable()">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-left: 10px"
|
||||
@click="OpenAdd">创建入库单</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
icon="el-icon-download"
|
||||
style="margin-left: 10px"
|
||||
@click="exportTable">导出入库单</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%;max-height: 460px;"
|
||||
height="270"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
@row-click="searchTable1">
|
||||
<el-table-column label="入库单号" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入库单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库人员" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库时间" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入库时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单号" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单名称" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="deleteWarehouseReceipt(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" :summary-method="getSummaries" show-summary border style="max-height: 300px;" height="400px" 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">
|
||||
{{ 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.重量1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合计" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.批次数量 * scope.row.单价 * scope.row.重量1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogVisible" title="创建入库单" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="120px">
|
||||
<el-row>
|
||||
<el-form-item label="采购单号" prop="purchaseOrderValue">
|
||||
<el-select v-model="form.purchaseOrderValue" placeholder="采购单号" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in purchaseOrder"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="入库人员" prop="money">
|
||||
<el-input v-model="form.warehousingStaff" size="small" placeholder="入库人员" readonly style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitAdd">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-card style="width: 1100px;margin: 20px auto">
|
||||
<div id="cjn" style="width: 1000px;margin: 0 auto">
|
||||
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
|
||||
<tr>
|
||||
<th colspan="16"><h3>备料入库单</h3></th>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">入库单号</td>
|
||||
<td colspan="6" style="text-align: center;width: 35%">{{ 入库单号 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">入库人员</td>
|
||||
<td colspan="6" style="text-align: center;width: 35%">{{ 入库人员 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">采购单号</td>
|
||||
<td colspan="6" style="text-align: center;width: 35%">{{ 采购单号 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">采购单名称</td>
|
||||
<td colspan="6" style="text-align: center;width: 35%">{{ 采购单名称 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="2" style="text-align: center;width: 15%">入库时间</td>
|
||||
<td colspan="6" style="text-align: center;width: 35%">{{ 入库时间 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">供应商</td>
|
||||
<td colspan="6" style="text-align: center;width: 35%">{{ 供应商 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="margin-top: 20px" cellspacing="0px" align="center" border="1 solid black" width="100%">
|
||||
<tr id="tablehead" style="height: 35px">
|
||||
<td style="text-align: center;width: 5%">序号</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">零件图号</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">零件名称</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">材料</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">单位</td>
|
||||
<td colspan="1" style="text-align: center;width: 8%">数量</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">成品尺寸</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">重量</td>
|
||||
<td colspan="2" style="text-align: center;width: 11%">总重量</td>
|
||||
</tr>
|
||||
<tr v-for="(list, index) in tableData1" :key="index" style="height: 35px">
|
||||
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">{{ list.零件图号 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 15%">{{ list.零件名称 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 10%">{{ list.材料 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">{{ list.单位 }}</td>
|
||||
<td colspan="1" style="text-align: center;width: 8%">{{ list.批次数量 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 20%">{{ list.成品尺寸 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 8%">{{ list.重量1 }}</td>
|
||||
<td colspan="2" style="text-align: center;width: 9%">{{ list.批次数量 * list.重量1 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { initWarehouseReceipt, searchWarehouseReceipt, searchMateriel, AddWarehousing, deleteWarehousing, initPurchaseOrder } from '@/api/WorkshopProcurement/StockPreparation'
|
||||
import { mapGetters } from 'vuex'
|
||||
import $ from 'jquery'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
warehouseReceiptValue: '',
|
||||
warehouseReceipt: [],
|
||||
supplierName0: '',
|
||||
check: 0,
|
||||
chekc1: 0,
|
||||
tableData: [],
|
||||
tableData1: [],
|
||||
loading: false,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
num: '',
|
||||
disable: true,
|
||||
dialogVisible: false,
|
||||
purchaseOrder: [],
|
||||
入库单号: '',
|
||||
入库人员: '',
|
||||
入库时间: '',
|
||||
采购单号: '',
|
||||
采购单名称: '',
|
||||
供应商: '',
|
||||
totalMoney: 0,
|
||||
form: {
|
||||
入库单流水号: '',
|
||||
purchaseOrderValue: '',
|
||||
warehousingStaff: ''
|
||||
},
|
||||
rules: {
|
||||
purchaseOrderValue: [{ required: true, message: '请选择采购单号' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
initWarehouseReceipt(0, this.warehouseReceiptValue, 0, this.supplierName0).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.warehouseReceipt.push({
|
||||
label: response.data[i].入库单号,
|
||||
value: response.data[i].入库单号
|
||||
})
|
||||
}
|
||||
})
|
||||
initPurchaseOrder().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.purchaseOrder.push({
|
||||
label: response.data[i].采购单号,
|
||||
value: response.data[i].采购计划流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() { // 查询入库单
|
||||
this.loading = true
|
||||
this.warehouseReceiptValue ? this.check = 1 : this.check = 0
|
||||
this.supplierName0 ? this.check1 = 1 : this.check1 = 0
|
||||
searchWarehouseReceipt(this.pageCurrent, this.pageSize, this.check, this.warehouseReceiptValue, this.check1, this.supplierName0).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageCurrent = 1
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
searchTable1(row) {
|
||||
this.totalMoney = 0
|
||||
this.num = row.采购计划流水号
|
||||
this.入库单号 = row.入库单号
|
||||
this.入库人员 = row.姓名
|
||||
this.采购单号 = row.采购单号
|
||||
this.采购单名称 = row.采购单名称
|
||||
this.入库时间 = row.入库时间
|
||||
this.供应商 = row.供应商名称
|
||||
searchMateriel(this.num).then(response => {
|
||||
this.tableData1 = response.data
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.totalMoney += (response.data[i].批次数量 * response.data[i].重量1 * response.data[i].单价)
|
||||
}
|
||||
})
|
||||
},
|
||||
OpenAdd() {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.form.warehousingStaff = this.name
|
||||
this.dialogVisible = true
|
||||
this.form.purchaseOrderValue = ''
|
||||
},
|
||||
submitAdd() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
AddWarehousing(this.form.purchaseOrderValue, this.id).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('创建成功')
|
||||
this.searchTable()
|
||||
this.dialogVisible = false
|
||||
} else { this.$message.error('创建失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteWarehouseReceipt(row) {
|
||||
this.$confirm('确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteWarehousing(row.入库单流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.dialogVisible = false
|
||||
this.searchTable()
|
||||
this.tableData1 = []
|
||||
} else { this.$message.error('删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 6) {
|
||||
sums[index] = '总重量'
|
||||
return
|
||||
} else if (index === 7) {
|
||||
const values = data.map(item => Number(item['重量1']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' kg'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 8) {
|
||||
sums[index] = '总价'
|
||||
} else if (index === 9) {
|
||||
if (this.totalMoney !== 0) {
|
||||
sums[index] = this.totalMoney + ' 元'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
exportTable() {
|
||||
const htmlNode = $('#cjn').html()
|
||||
const body = $('body')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
window.print()
|
||||
body.removeAttr('style')
|
||||
body.children().not('script').show()
|
||||
body.children().not('#app').hide()
|
||||
printNode.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user