This commit is contained in:
liushuai
2020-05-07 18:18:11 +08:00
3 changed files with 39 additions and 80 deletions

View File

@@ -99,7 +99,7 @@
<el-table-column label="使用库存数量" align="center" width="110" prop="使用库存数"> <el-table-column label="使用库存数量" align="center" width="110" prop="使用库存数">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="Number(scope.row.零件类型) !== 1 || (Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量)) === 0">-</span> <span v-if="Number(scope.row.零件类型) !== 1 || (Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量)) === 0">-</span>
<el-input-number v-if="Number(scope.row.零件类型) === 1 && (Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量)) !== 0" v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > (Number(scope.row.货位存量) - Number(scope.row.占用数量)) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量) + Number(scope.row.使用库存数)) : Number(scope.row.零件数量)" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/> <el-input v-positive="'int'" v-if="Number(scope.row.零件类型) === 1 && (Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量)) !== 0" v-model="scope.row.使用库存数" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="待采数量" align="center" width="80" prop="待采购数量"> <el-table-column label="待采数量" align="center" width="80" prop="待采购数量">
@@ -340,17 +340,17 @@
{{ scope.row.物料名称 ? scope.row.物料名称 : scope.row.零件名称 }} {{ scope.row.物料名称 ? scope.row.物料名称 : scope.row.零件名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格" align="center" width="100" show-overflow-tooltip> <el-table-column label="规格" align="center" width="80" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料规格 ? scope.row.物料规格 : scope.row.规格 }} {{ scope.row.物料规格 ? scope.row.物料规格 : scope.row.规格 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="图号或型号" align="center" width="140" show-overflow-tooltip> <el-table-column label="图号或型号" align="center" width="100" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }} {{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="采购数" align="center" width="120"> <el-table-column label="采购数" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-direction="{x: 0, y: scope.$index}" v-if="quickChangePrice" v-model="scope.row.数量" :disabled="disable" size="mini" style="width:100px" @change="saveContract()"/> <el-input v-direction="{x: 0, y: scope.$index}" v-if="quickChangePrice" v-model="scope.row.数量" :disabled="disable" size="mini" style="width:100px" @change="saveContract()"/>
<b v-else>{{ scope.row.数量 }}</b> <b v-else>{{ scope.row.数量 }}</b>
@@ -876,13 +876,10 @@ export default {
this.getPerson() this.getPerson()
this.projectChange() this.projectChange()
this.getSupplier1() this.getSupplier1()
// this.searchTable2()
// this.searchTable11()
this.initDirection() this.initDirection()
}, },
methods: { methods: {
changefixed(val, index, date) { changefixed(val, index, date) {
console.log(index, 6666)
let value = '' + val let value = '' + val
value = value value = value
.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符 .replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
@@ -894,12 +891,9 @@ export default {
if (value.indexOf('.') < 0 && value !== '') { if (value.indexOf('.') < 0 && value !== '') {
value = parseFloat(value).toFixed(2) value = parseFloat(value).toFixed(2)
} }
console.log(value, this.tableData3[index][date])
this.tableData3[index][date] = value this.tableData3[index][date] = value
console.log(this.tableData3[index][date], 'this.tableData3[index][date]')
}, },
handleSelection(val, row) { handleSelection(val, row) {
console.log(row, 123)
this.tableData00.forEach((item, i) => { this.tableData00.forEach((item, i) => {
if (item.组件零件流水号 === row.组件零件流水号 && row.组件零件流水号 !== '0') { if (item.组件零件流水号 === row.组件零件流水号 && row.组件零件流水号 !== '0') {
if (this.numbers.indexOf(i) === -1) { if (this.numbers.indexOf(i) === -1) {
@@ -1110,19 +1104,16 @@ export default {
}) })
}, },
tabClick(tab) { tabClick(tab) {
console.log(tab.name, 1111)
if (tab.name === '外购件') { if (tab.name === '外购件') {
this.tabName = '外购件' this.tabName = '外购件'
this.searchTable11() this.searchTable11()
} else if (tab.name === '标准件') { } else if (tab.name === '标准件') {
this.tabName = '标准件' this.tabName = '标准件'
// this.searchTable11()
} else if (tab.name === '基本件') { } else if (tab.name === '基本件') {
this.tabName = '基本件' this.tabName = '基本件'
this.searchTable12() this.searchTable12()
} else { } else {
this.tabName = '仓库' this.tabName = '仓库'
// this.searchTable22()
} }
}, },
searchTable2() { // 查询离线合同列表 searchTable2() { // 查询离线合同列表
@@ -1130,9 +1121,7 @@ export default {
this.supplierName0 ? this.check4 = 1 : this.check4 = 0 this.supplierName0 ? this.check4 = 1 : this.check4 = 0
this.loading3 = true this.loading3 = true
this.tableData3 = [] this.tableData3 = []
console.log(this.id, 'id')
searchOfflineContract(this.pageCurrent2, this.pageSize2, this.check3, this.offlineContract, this.check4, this.supplierName0, this.id).then(response => { searchOfflineContract(this.pageCurrent2, this.pageSize2, this.check3, this.offlineContract, this.check4, this.supplierName0, this.id).then(response => {
console.log(response.data.rows, 99)
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
this.total2 = response.data.total this.total2 = response.data.total
this.loading3 = false this.loading3 = false
@@ -1147,14 +1136,24 @@ export default {
this.searchTable2() this.searchTable2()
}, },
changeNumber(row) { changeNumber(row) {
var max = Number(row.零件数量) > (Number(row.货位存量) - Number(row.占用数量)) ? (Number(row.货位存量) - Number(row.占用数量) + Number(row.使用库存数)) : Number(row.零件数量)
if (row.使用库存数) {
if (row.使用库存数 > max) {
row.使用库存数 = row.使用库存数_原
this.$message.error('数量超出范围,请重新输入')
} else {
changeNum(row.物料流水号, row.使用库存数, row.机床流水号, row.组件零件流水号, row.零件数量).then(response => { changeNum(row.物料流水号, row.使用库存数, row.机床流水号, row.组件零件流水号, row.零件数量).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('使用成功') this.$message.success('使用成功')
this.searchTable11() this.searchTable11()
} else { } else {
this.$message.success('使用失败') this.$message.error('使用失败')
} }
}) })
}
} else {
row.使用库存数 = 0
}
}, },
addOfflineContract() { // 创建离线合同 addOfflineContract() { // 创建离线合同
if (this.$refs['form2'] !== undefined) { if (this.$refs['form2'] !== undefined) {
@@ -1348,7 +1347,6 @@ export default {
this.离线合同状态 = row.离线合同状态 this.离线合同状态 = row.离线合同状态
this.loading4 = true this.loading4 = true
searchMateriel(this.offlineContractNum).then(response => { searchMateriel(this.offlineContractNum).then(response => {
console.log(response, 'response')
this.tableData3 = response.data this.tableData3 = response.data
this.tableData3.map(v => { this.tableData3.map(v => {
this.$set(v, '未税总额', 0) this.$set(v, '未税总额', 0)
@@ -1357,9 +1355,7 @@ export default {
!v.单价 ? v.单价 = parseFloat(v.参考价格).toFixed(2) : parseFloat(v.单价).toFixed(2) !v.单价 ? v.单价 = parseFloat(v.参考价格).toFixed(2) : parseFloat(v.单价).toFixed(2)
this.$set(v, '未税单价', (v.单价 / (1 + this.taxRate)).toFixed(2)) this.$set(v, '未税单价', (v.单价 / (1 + this.taxRate)).toFixed(2))
}) })
console.log(this.tableData3, 'tableData31')
this.loading4 = false this.loading4 = false
console.log(response.data.length, 1231231233)
}) })
this.arrival(row) || this.purchasing(row) ? this.disable = true : this.disable = false // 是否为编辑模式 this.arrival(row) || this.purchasing(row) ? this.disable = true : this.disable = false // 是否为编辑模式
}, },
@@ -1488,30 +1484,8 @@ export default {
saveOfflineContact(this.offlineContractNum, this.totalPrice, this.partGroup, this.numGroup, this.priceGroup, dateGroup, remarkGroup, this.taxRate * 100).then(response => { saveOfflineContact(this.offlineContractNum, this.totalPrice, this.partGroup, this.numGroup, this.priceGroup, dateGroup, remarkGroup, this.taxRate * 100).then(response => {
if (response.data[0].result !== '1') { if (response.data[0].result !== '1') {
this.$message.error('离线合同保存失败') this.$message.error('离线合同保存失败')
// this.$message.success('离线合同保存成功')
// this.searchTable2()
// searchMateriel(this.offlineContractNum).then(response => {
// this.tableData3 = response.data
// this.tableData3.map(v => {
// this.$set(v, '未税总额', 0)
// this.$set(v, '含税总额', 0)
// !v.单价 ? v.单价 = v.参考价格 : v.单价
// this.$set(v, '未税单价', v.单价 / (1 + this.taxRate))
// })
// })
} }
}) })
// this.$confirm('确定保存合同?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// }).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消操作'
// })
// })
}, },
doneOfflineContact() { // 生成离线合同 doneOfflineContact() { // 生成离线合同
this.tongguo = true this.tongguo = true
@@ -1555,16 +1529,6 @@ export default {
this.$message.success('离线合同生成成功') this.$message.success('离线合同生成成功')
this.searchTable2() this.searchTable2()
this.tableData3 = [] this.tableData3 = []
// searchMateriel(this.offlineContractNum).then(response => {
// this.tableData3 = response.data
// this.tableData3.map(v => {
// this.$set(v, '未税总额', 0)
// this.$set(v, '含税总额', 0)
// !v.单价 ? v.单价 = v.参考价格 : v.单价
// this.$set(v, '未税单价', v.单价 / (1 + this.taxRate))
// })
// this.disable = true // 是否为编辑模式
// })
} else { this.$message.error('离线合同生成失败') } } else { this.$message.error('离线合同生成失败') }
}) })
}).catch(() => { }).catch(() => {
@@ -1659,12 +1623,12 @@ export default {
this.idNumGroup.push(val[i].id) this.idNumGroup.push(val[i].id)
this.NumGroup.push(val[i].待采购数量) this.NumGroup.push(val[i].待采购数量)
} }
console.log(this.materielNumGroup, 222)
}, },
selectable(row, index) { // 控制某行是否可选 selectable(row, index) { // 控制某行是否可选
return Number(row.采购状态编号) < 3 && Number(row.是否确认) === 1 // 未采购&&确认物料修改 return Number(row.采购状态编号) < 3 && Number(row.是否确认) === 1 // 未采购&&确认物料修改
}, },
searchTable11() { // 查询外购件列表 // 查询外购件列表
searchTable11() {
let check1, check5, check7 let check1, check5, check7
this.loading1 = true this.loading1 = true
this.materialName ? check1 = 1 : check1 = 0 this.materialName ? check1 = 1 : check1 = 0
@@ -1723,7 +1687,6 @@ export default {
const supplier = [] const supplier = []
this.remarkFilters = [] this.remarkFilters = []
this.supplierFilters = [] this.supplierFilters = []
console.log(response.data.rows, 111)
response.data.rows.map(v => { response.data.rows.map(v => {
if (!remark.includes(v.备注)) { if (!remark.includes(v.备注)) {
remark.push(v.备注) remark.push(v.备注)
@@ -1751,7 +1714,6 @@ export default {
this.materialName ? check1 = 1 : check1 = 0 this.materialName ? check1 = 1 : check1 = 0
this.loading2 = true this.loading2 = true
searchMaterial22(check1, this.materialName, this.pageCurrent22, this.pageSize22).then(response => { searchMaterial22(check1, this.materialName, this.pageCurrent22, this.pageSize22).then(response => {
console.log(response.data, 3333)
this.tableData22 = response.data.result this.tableData22 = response.data.result
this.total22 = parseInt(response.data.output[0].ItemCount) this.total22 = parseInt(response.data.output[0].ItemCount)
const supplier = [] const supplier = []

View File

@@ -16,23 +16,10 @@
range-separator="" range-separator=""
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"/> end-placeholder="结束日期"/>
<!--<el-input v-model="contractNumber" placeholder="合同编号" size="small" clearable style="width:180px;margin: 0px 10px"/>--> <el-button type="primary" size="small" icon="el-icon-search" plain style="margin-left:10px" @click="total1=0;pageCurrent1=1;pageSize1=30;searchTable1()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-search"
plain
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=30;searchTable1()">查询</el-button>
<el-tooltip :open-delay="200" effect="dark" content="打回重新编制" placement="top"> <el-tooltip :open-delay="200" effect="dark" content="打回重新编制" placement="top">
<div style="display: inline-block"> <div style="display: inline-block">
<el-button <el-button type="danger" size="small" icon="el-icon-back" plain style="margin-left:10px" @click="back">打回</el-button>
type="danger"
size="small"
icon="el-icon-back"
plain
style="margin-left:10px"
@click="back">打回</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
<el-button type="success" size="small" icon="el-icon-download" plain style="float: right; margin-right: 130px;" @click="exportExcel">导出</el-button> <el-button type="success" size="small" icon="el-icon-download" plain style="float: right; margin-right: 130px;" @click="exportExcel">导出</el-button>
@@ -40,7 +27,7 @@
</div> </div>
</el-card> </el-card>
<el-row> <el-row>
<el-card style="width: 50%; float: left"> <el-card style="width: 45%; float: left">
<el-table <el-table
v-loading="loading1" v-loading="loading1"
id="expandTable" id="expandTable"
@@ -106,7 +93,7 @@
@current-change="handleCurrentChange1"/> @current-change="handleCurrentChange1"/>
</div> </div>
</el-card> </el-card>
<el-card style="width: 50%"> <el-card style="width: 55%">
<table v-show="contractDetail.length > 0" class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="500px"> <table v-show="contractDetail.length > 0" class="offlineContract" cellspacing="0px" align="center" border="1 solid black" width="500px">
<tr> <tr>
<th colspan="14"><h1>离线合同</h1></th> <th colspan="14"><h1>离线合同</h1></th>
@@ -138,7 +125,7 @@
</tr> </tr>
<tr> <tr>
<td style="text-align: center;">总计</td> <td style="text-align: center;">总计</td>
<td id="remark" colspan="12" style="text-align: center;"/> <td id="remark" colspan="13" style="text-align: center;"/>
<!--<td id="total" colspan="2" style="text-align: center;"/>--> <!--<td id="total" colspan="2" style="text-align: center;"/>-->
<!--<td/>--> <!--<td/>-->
</tr> </tr>
@@ -327,7 +314,7 @@ export default {
document.getElementById('contractName').innerHTML = row.离线合同名称 document.getElementById('contractName').innerHTML = row.离线合同名称
document.getElementById('supplier').innerHTML = row.供应商名称 document.getElementById('supplier').innerHTML = row.供应商名称
document.getElementById('buyer').innerHTML = row.采购员 document.getElementById('buyer').innerHTML = row.采购员
document.getElementById('total').innerHTML = '' // document.getElementById('total').innerHTML = ''
document.getElementById('remark').innerHTML = total + ' 元' document.getElementById('remark').innerHTML = total + ' 元'
$('#qrCode').html(`<img id="img">`) $('#qrCode').html(`<img id="img">`)
this.useqrcode(row.离线合同编号) // 显示二维码 this.useqrcode(row.离线合同编号) // 显示二维码

View File

@@ -11,6 +11,11 @@
</el-card> </el-card>
<el-card> <el-card>
<el-table v-loading="loading" :data="tableData" border stripe size="mini" height="650" style="width: 1350px"> <el-table v-loading="loading" :data="tableData" border stripe size="mini" height="650" style="width: 1350px">
<el-table-column label="进程" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" width="120px"> <el-table-column label="名称" align="center" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.名称 }} {{ scope.row.名称 }}
@@ -36,6 +41,11 @@
{{ scope.row.数量 }} {{ scope.row.数量 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用库存数" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.使用库存数 }}
</template>
</el-table-column>
<el-table-column label="到货数量" align="center" width="80"> <el-table-column label="到货数量" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.到货数量 }} {{ scope.row.到货数量 }}
@@ -63,7 +73,7 @@
</el-table-column> </el-table-column>
<el-table-column label="采购日期" align="center" width="90"> <el-table-column label="采购日期" align="center" width="90">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.创建日期 }} {{ scope.row.提交日期 }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>