采购库存
This commit is contained in:
@@ -83,6 +83,18 @@ export function searchStockNumber2(...params) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查看领料单明细相关的物料货位数量
|
||||||
|
export function searchStockNumber3(...params) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '库存管理_物料出库_车间采购件_查询数据',
|
||||||
|
param: `请购单明细流水号=${params[0]}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 出库
|
// 出库
|
||||||
export function submitOutStore(...params) {
|
export function submitOutStore(...params) {
|
||||||
return request({
|
return request({
|
||||||
@@ -91,7 +103,7 @@ export function submitOutStore(...params) {
|
|||||||
data: {
|
data: {
|
||||||
type: '2',
|
type: '2',
|
||||||
name: '库存管理_物料出库_出库记录_增加数据',
|
name: '库存管理_物料出库_出库记录_增加数据',
|
||||||
param: `物料流水号=${params[0]}&货位流水号=${params[1]}&出库数量=${params[2]}&出库人流水号=${params[3]}&基本件流水号=${params[4]}&标准件和外购件流水号=${params[5]}`
|
param: `物料流水号=${params[0]}&货位流水号=${params[1]}&出库数量=${params[2]}&出库人流水号=${params[3]}&基本件流水号=${params[4]}&标准件和外购件流水号=${params[5]}&请购单明细流水号=${params[6]}&领料单流水号=${params[7]}&领料人流水号=${params[8]}&仓库流水号=${params[9]}&出库类别=${params[10]}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -107,3 +119,14 @@ export function errorRecord(...params) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 初始化出库类别
|
||||||
|
export function initOutType() {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '3',
|
||||||
|
name: 'select * from 库存管理_出库类别'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export function doneContract(...params) {
|
|||||||
data: {
|
data: {
|
||||||
type: '2',
|
type: '2',
|
||||||
name: '采购管理_采购合同_增加数据',
|
name: '采购管理_采购合同_增加数据',
|
||||||
param: `采购合同编号=${params[0]}\\&采购合同名称=${params[1]}\\&交货日期=${params[2]}\\&支付日期=${params[3]}\\&支付方式=${params[4]}\\&开票信息=${params[5]}\\&其他说明=${params[6]}\\&合同总额=${params[7]}\\&采购员流水号=${params[8]}\\&供应商流水号=${params[9]}\\&单价是否含税=${params[10]}\\&组件零件流水号组=${params[11]}\\&组件零件基本件流水号组=${params[12]}\\&数量组=${params[13]}\\&单价组=${params[14]}\\&交货期组=${params[15]}\\&合同内容\\=${params[16]}\\&税率=${params[17]}`
|
param: `采购合同编号=${params[0]}\\&采购合同名称=${params[1]}\\&交货日期=${params[2]}\\&支付日期=${params[3]}\\&支付方式=${params[4]}\\&开票信息=${params[5]}\\&其他说明=${params[6]}\\&合同总额=${params[7]}\\&采购员流水号=${params[8]}\\&供应商流水号=${params[9]}\\&单价是否含税=${params[10]}\\&组件零件流水号组=${params[11]}\\&组件零件基本件流水号组=${params[12]}\\&数量组=${params[13]}\\&单价组=${params[14]}\\&交货期组=${params[15]}\\&合同内容\\=${params[16]}\\&税率=${params[17]}\\&询价单明细流水号组=${params[18]}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -61,3 +61,14 @@ export function searchBaseInfo(id) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 实时保存单价
|
||||||
|
export function savePrice(price, num1, num2) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '4',
|
||||||
|
name: `update 采购管理_询价单明细_视图 set 单价 = ${price} where 物料流水号 = ${num1} and 询价单流水号 = ${num2}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -129,6 +129,8 @@ export function groupBy(datas, keys) {
|
|||||||
group.key.数量 = group.data1 += v.数量
|
group.key.数量 = group.data1 += v.数量
|
||||||
group.data2 = group.data2 || ''
|
group.data2 = group.data2 || ''
|
||||||
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + ';'
|
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + ';'
|
||||||
|
group.data3 = group.data3 || 0
|
||||||
|
group.key.合计 = group.data3 += v.合计
|
||||||
})
|
})
|
||||||
groups.map(v => {
|
groups.map(v => {
|
||||||
result.push(v.key)
|
result.push(v.key)
|
||||||
|
|||||||
@@ -185,6 +185,15 @@
|
|||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="出库类别" prop="outTypeValue" label-width="100px">
|
||||||
|
<el-select v-model="form1.outTypeValue" size="small" placeholder="出库类别" style="width: 200px;margin-right:10px">
|
||||||
|
<el-option
|
||||||
|
v-for="item in outType"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogFormVisible1=false">取消</el-button>
|
<el-button @click="dialogFormVisible1=false">取消</el-button>
|
||||||
@@ -210,12 +219,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, errorRecord } from '@/api/Inventory/MaterialOut'
|
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, errorRecord, searchStockNumber3, initOutType } from '@/api/Inventory/MaterialOut'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'MaterialOut',
|
name: 'MaterialOut',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pickingListNum: '', // 领料单流水号
|
||||||
|
pickingPersonNum: '', // 领料人流水号
|
||||||
pickingListNumber: '',
|
pickingListNumber: '',
|
||||||
pickingListNumberShow: '',
|
pickingListNumberShow: '',
|
||||||
pickListTable1: [],
|
pickListTable1: [],
|
||||||
@@ -226,12 +237,14 @@ export default {
|
|||||||
StockNumberTable: [],
|
StockNumberTable: [],
|
||||||
dialogFormVisible1: false,
|
dialogFormVisible1: false,
|
||||||
dialogFormVisible2: false,
|
dialogFormVisible2: false,
|
||||||
|
outType: [],
|
||||||
form1: {
|
form1: {
|
||||||
machineValue: '',
|
machineValue: '',
|
||||||
groupNumValue: '',
|
groupNumValue: '',
|
||||||
outNumber: '',
|
outNumber: '',
|
||||||
outNumberMax: '', // 出库最大值
|
outNumberMax: '', // 出库最大值
|
||||||
personValue: ''
|
personValue: '',
|
||||||
|
outTypeValue: '' // 出库类别
|
||||||
},
|
},
|
||||||
form2: {
|
form2: {
|
||||||
errorNumber: '',
|
errorNumber: '',
|
||||||
@@ -244,7 +257,8 @@ export default {
|
|||||||
machineValue: [{ required: true, message: '请选择' }],
|
machineValue: [{ required: true, message: '请选择' }],
|
||||||
groupNumValue: [{ required: true, message: '请选择' }],
|
groupNumValue: [{ required: true, message: '请选择' }],
|
||||||
outNumber: [{ required: true, message: '请输入' }],
|
outNumber: [{ required: true, message: '请输入' }],
|
||||||
personValue: [{ required: true, message: '请输入' }]
|
personValue: [{ required: true, message: '请输入' }],
|
||||||
|
outTypeValue: [{ required: true, message: '请选择' }] // 出库类别
|
||||||
},
|
},
|
||||||
rules2: {
|
rules2: {
|
||||||
errorNumber: [{ required: true, message: '请输入' }],
|
errorNumber: [{ required: true, message: '请输入' }],
|
||||||
@@ -256,8 +270,10 @@ export default {
|
|||||||
materialNum: '', // 中间变量物料流水号
|
materialNum: '', // 中间变量物料流水号
|
||||||
machineValue: '', // 中间变量机床流水号
|
machineValue: '', // 中间变量机床流水号
|
||||||
groupNumValue: '', // 中间变量组件流水号
|
groupNumValue: '', // 中间变量组件流水号
|
||||||
basePartNum: '', // 中间变量基本件流水u和
|
basePartNum: '', // 中间变量基本件流水号
|
||||||
|
purchaseBillNum: '', // 中间变量请购单明细流水号
|
||||||
parchasePartNum: '', // 中间变量标准件和外购件流水号
|
parchasePartNum: '', // 中间变量标准件和外购件流水号
|
||||||
|
inventoryNum: '', // 中间变量仓库流水号
|
||||||
locationNum: '', // 中间变量货位流水号
|
locationNum: '', // 中间变量货位流水号
|
||||||
outNumber: 0 // 中间变量出库数量
|
outNumber: 0 // 中间变量出库数量
|
||||||
}
|
}
|
||||||
@@ -293,6 +309,14 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
initOutType().then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.outType.push({
|
||||||
|
label: response.data[i].出库类别名称,
|
||||||
|
value: response.data[i].出库类别流水号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 查询组号
|
// 查询组号
|
||||||
searchGroup() {
|
searchGroup() {
|
||||||
@@ -328,6 +352,7 @@ export default {
|
|||||||
// 查看领料单明细
|
// 查看领料单明细
|
||||||
clickList(row) {
|
clickList(row) {
|
||||||
row && row.领料单流水号 ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
|
row && row.领料单流水号 ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
|
||||||
|
row && row.人员编号 ? this.pickingPersonNum = row.人员编号 : this.pickingListNum
|
||||||
row && row.领料单编号 ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
|
row && row.领料单编号 ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
|
||||||
searchListDetail(this.pickingListNum).then(res => {
|
searchListDetail(this.pickingListNum).then(res => {
|
||||||
this.pickListTable2 = res.data
|
this.pickListTable2 = res.data
|
||||||
@@ -335,9 +360,10 @@ export default {
|
|||||||
},
|
},
|
||||||
// 查看领料单明细相关的物料货位数量
|
// 查看领料单明细相关的物料货位数量
|
||||||
clickListDetail(row) {
|
clickListDetail(row) {
|
||||||
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null) : this.basePartNum
|
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null, this.purchaseBillNum = null) : this.basePartNum
|
||||||
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null) : this.materialNum
|
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.materialNum
|
||||||
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null) : this.parchasePartNum
|
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.parchasePartNum
|
||||||
|
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.parchasePartNum
|
||||||
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
|
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
|
||||||
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
|
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
|
||||||
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
|
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
|
||||||
@@ -349,6 +375,10 @@ export default {
|
|||||||
searchStockNumber2(this.basePartNum).then(res => {
|
searchStockNumber2(this.basePartNum).then(res => {
|
||||||
this.StockNumberTable = res.data
|
this.StockNumberTable = res.data
|
||||||
})
|
})
|
||||||
|
} else if (this.purchaseBillNum) {
|
||||||
|
searchStockNumber3(this.purchaseBillNum).then(res => {
|
||||||
|
this.StockNumberTable = res.data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 出库
|
// 出库
|
||||||
@@ -357,6 +387,7 @@ export default {
|
|||||||
this.$refs['form1'].resetFields()
|
this.$refs['form1'].resetFields()
|
||||||
}
|
}
|
||||||
this.form1.machineValue = this.machineValue
|
this.form1.machineValue = this.machineValue
|
||||||
|
this.inventoryNum = row.仓库流水号
|
||||||
this.locationNum = row.货位流水号
|
this.locationNum = row.货位流水号
|
||||||
this.outNumber > row.货位存量 ? (this.form1.outNumber = row.货位存量, this.form1.outNumberMax = row.货位存量) : (this.form1.outNumber = this.outNumber, this.form1.outNumberMax = this.outNumber) // 货位存量和领料数量对比取小
|
this.outNumber > row.货位存量 ? (this.form1.outNumber = row.货位存量, this.form1.outNumberMax = row.货位存量) : (this.form1.outNumber = this.outNumber, this.form1.outNumberMax = this.outNumber) // 货位存量和领料数量对比取小
|
||||||
this.form1.personValue = Number(this.id)
|
this.form1.personValue = Number(this.id)
|
||||||
@@ -380,7 +411,7 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
|
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
|
||||||
// 物料流水号,货位流水号,出库数量 => 减掉货位物料数
|
// 物料流水号,货位流水号,出库数量 => 减掉货位物料数
|
||||||
submitOutStore(this.materialNum, this.locationNum, this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum).then(response => {
|
submitOutStore(this.materialNum, this.locationNum, this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum, this.purchaseBillNum, this.pickingListNum, this.pickingPersonNum, this.inventoryNum, this.form1.outTypeValue).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
this.$message.success('出库成功')
|
this.$message.success('出库成功')
|
||||||
this.dialogFormVisible1 = false
|
this.dialogFormVisible1 = false
|
||||||
|
|||||||
@@ -162,11 +162,11 @@
|
|||||||
{{ scope.row.供货商 }}
|
{{ scope.row.供货商 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">
|
<!--<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">-->
|
||||||
<template slot-scope="scope">
|
<!--<template slot-scope="scope">-->
|
||||||
{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}
|
<!--{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}-->
|
||||||
</template>
|
<!--</template>-->
|
||||||
</el-table-column>
|
<!--</el-table-column>-->
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
@@ -1150,10 +1150,10 @@ export default {
|
|||||||
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) < 3 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
|
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) < 3 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
|
||||||
},
|
},
|
||||||
filterHandler0(value, row) { // 筛选备注
|
filterHandler0(value, row) { // 筛选备注
|
||||||
return row['备注'] === value
|
return row['备注'].trim() === value
|
||||||
},
|
},
|
||||||
filterHandler(value, row) { // 筛选供货商
|
filterHandler(value, row) { // 筛选供货商
|
||||||
return row['供货商'] === value
|
return row['供货商'].trim() === value
|
||||||
},
|
},
|
||||||
searchTable11() { // 查询外购件列表
|
searchTable11() { // 查询外购件列表
|
||||||
let check1, check2, check3, check4, check5, check6
|
let check1, check2, check3, check4, check5, check6
|
||||||
@@ -1171,10 +1171,14 @@ export default {
|
|||||||
this.remarkFilters = []
|
this.remarkFilters = []
|
||||||
this.supplierFilters = []
|
this.supplierFilters = []
|
||||||
response.data.rows.map(v => {
|
response.data.rows.map(v => {
|
||||||
|
if (v.备注 === null) { v.备注 = '' }
|
||||||
|
if (v.供货商 === null) { v.供货商 = '' }
|
||||||
if (!remark.includes(v.备注)) {
|
if (!remark.includes(v.备注)) {
|
||||||
remark.push(v.备注)
|
remark.push(v.备注)
|
||||||
supplier.push(v.供货商)
|
|
||||||
this.remarkFilters.push({ text: v.备注, value: v.备注 })
|
this.remarkFilters.push({ text: v.备注, value: v.备注 })
|
||||||
|
}
|
||||||
|
if (!supplier.includes(v.供货商)) {
|
||||||
|
supplier.push(v.供货商)
|
||||||
this.supplierFilters.push({ text: v.供货商, value: v.供货商 })
|
this.supplierFilters.push({ text: v.供货商, value: v.供货商 })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -129,13 +129,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-show="hasTax==='未税'" label="单价(未税)" align="center" width="120">
|
<el-table-column v-show="hasTax==='未税'" label="单价(未税)" align="center" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-show="hasTax==='未税'" v-model="scope.row.未税单价" size="mini" style="width:100%"/>
|
<el-input-number v-show="hasTax==='未税'" :min="0" v-model="scope.row.未税单价" controls-position="right" size="mini" style="width:100%" @focus="scope.row.未税单价=''" @change="priceChange(scope.row.未税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row)"/>
|
||||||
<b v-show="hasTax!=='未税'">—</b>
|
<b v-show="hasTax!=='未税'">—</b>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-show="hasTax==='含税'" label="单价(含税)" align="center" width="120">
|
<el-table-column v-show="hasTax==='含税'" label="单价(含税)" align="center" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-show="hasTax==='含税'" v-model="scope.row.含税单价" size="mini" style="width:100%"/>
|
<el-input-number v-show="hasTax==='含税'" :min="0" v-model="scope.row.含税单价" controls-position="right" size="mini" style="width:100%" @focus="scope.row.含税单价=''" @change="priceChange(scope.row.含税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row)"/>
|
||||||
<b v-show="hasTax!=='含税'">—</b>
|
<b v-show="hasTax!=='含税'">—</b>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Tinymce from '@/components/Tinymce'
|
import Tinymce from '@/components/Tinymce'
|
||||||
import { initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo } from '@/api/PurchasingCenter/CreatePurchaseContract'
|
import { initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo, savePrice } from '@/api/PurchasingCenter/CreatePurchaseContract'
|
||||||
import { convertCurrency } from '@/vendor/int2Chinese'
|
import { convertCurrency } from '@/vendor/int2Chinese'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { sleep, groupBy } from '@/utils/tool'
|
import { sleep, groupBy } from '@/utils/tool'
|
||||||
@@ -256,6 +256,26 @@ export default {
|
|||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 价格实时保存
|
||||||
|
priceChange(price, num1, num2, row) {
|
||||||
|
this.tableData1.map(v => {
|
||||||
|
if (Number(v.物料流水号) === Number(row.物料流水号) && Number(v.询价单流水号) === Number(row.询价单流水号)) {
|
||||||
|
v.含税单价 = row.含税单价
|
||||||
|
v.未税单价 = row.未税单价
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const group = this.tableData1
|
||||||
|
this.tableData1 = []
|
||||||
|
this.tableData1 = group
|
||||||
|
price = price || 0
|
||||||
|
savePrice(price, num1, num2).then(res => {
|
||||||
|
if (res.data[0].result === '1') {
|
||||||
|
console.log('单价实时保存成功')
|
||||||
|
} else {
|
||||||
|
console.log('单价实时保存失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
deleteAllDate() {
|
deleteAllDate() {
|
||||||
this.tableData1.map(v => {
|
this.tableData1.map(v => {
|
||||||
v.交货期 = ''
|
v.交货期 = ''
|
||||||
@@ -357,6 +377,9 @@ export default {
|
|||||||
searchSheetContract(this.contractNumValue).then(response => {
|
searchSheetContract(this.contractNumValue).then(response => {
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
this.tableData1.push({
|
this.tableData1.push({
|
||||||
|
询价单流水号: response.data[i].询价单流水号,
|
||||||
|
物料流水号: response.data[i].物料流水号,
|
||||||
|
询价单明细流水号: response.data[i].询价单明细流水号,
|
||||||
机床图号: response.data[i].机床图号,
|
机床图号: response.data[i].机床图号,
|
||||||
组号: response.data[i].组号,
|
组号: response.data[i].组号,
|
||||||
组件零件流水号: response.data[i].组件零件流水号,
|
组件零件流水号: response.data[i].组件零件流水号,
|
||||||
@@ -367,9 +390,9 @@ export default {
|
|||||||
规格: response.data[i].组件零件流水号 ? response.data[i].物料规格 : response.data[i].规格,
|
规格: response.data[i].组件零件流水号 ? response.data[i].物料规格 : response.data[i].规格,
|
||||||
数量: response.data[i].数量,
|
数量: response.data[i].数量,
|
||||||
计量单位: response.data[i].计量单位,
|
计量单位: response.data[i].计量单位,
|
||||||
未税单价: 0,
|
未税单价: response.data[i].单价,
|
||||||
未税总额: 0,
|
未税总额: 0,
|
||||||
含税单价: 0,
|
含税单价: response.data[i].单价,
|
||||||
含税总额: 0,
|
含税总额: 0,
|
||||||
备注: response.data[i].备注
|
备注: response.data[i].备注
|
||||||
})
|
})
|
||||||
@@ -570,6 +593,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const merge = []
|
const merge = []
|
||||||
this.tableData1.map(v => {
|
this.tableData1.map(v => {
|
||||||
|
if ((this.hasTax === '含税' && Number(v.含税单价)) || (this.hasTax === '未税' && Number(v.未税单价))) { // 筛掉未询到价格的物料
|
||||||
merge.push({
|
merge.push({
|
||||||
机床图号: v.机床图号,
|
机床图号: v.机床图号,
|
||||||
组号: v.组号,
|
组号: v.组号,
|
||||||
@@ -583,9 +607,10 @@ export default {
|
|||||||
交货期: v.交货期 ? v.交货期.split(' ')[0] : '',
|
交货期: v.交货期 ? v.交货期.split(' ')[0] : '',
|
||||||
备注: v.备注
|
备注: v.备注
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
let mergeData = []
|
let mergeData = []
|
||||||
mergeData = groupBy(merge, ['图号', '名称', '规格', '计量单位', '单价', '合计', '交货期', '备注'])
|
mergeData = groupBy(merge, ['图号', '名称', '规格', '计量单位', '单价', '交货期', '备注'])
|
||||||
// 放入新数据
|
// 放入新数据
|
||||||
const tr = []
|
const tr = []
|
||||||
for (let i = 0; i < mergeData.length; i++) {
|
for (let i = 0; i < mergeData.length; i++) {
|
||||||
@@ -653,20 +678,25 @@ export default {
|
|||||||
this.单价组 = []
|
this.单价组 = []
|
||||||
this.交货期组 = []
|
this.交货期组 = []
|
||||||
this.hasTax === '含税' ? this.单价是否含税 = 1 : this.单价是否含税 = 0
|
this.hasTax === '含税' ? this.单价是否含税 = 1 : this.单价是否含税 = 0
|
||||||
for (let i = 0; i < this.tableData1.length; i++) {
|
const inquiryDetailNum_old = [] // 需要转移到新询价单的物料的询价单明细流水号
|
||||||
this.组件零件流水号组.push(this.tableData1[i].组件零件流水号)
|
this.tableData1.map(v => {
|
||||||
this.组件零件基本件流水号组.push(this.tableData1[i].组件零件基本件流水号)
|
if ((this.hasTax === '含税' && Number(v.含税单价)) || (this.hasTax === '未税' && Number(v.未税单价))) { // 筛掉未询到价格的物料
|
||||||
this.数量组.push(this.tableData1[i].数量)
|
this.组件零件流水号组.push(v.组件零件流水号)
|
||||||
this.hasTax === '含税' ? this.单价组.push(this.tableData1[i].含税单价) : this.单价组.push(this.tableData1[i].未税单价)
|
this.组件零件基本件流水号组.push(v.组件零件基本件流水号)
|
||||||
this.交货期组.push(this.tableData1[i].交货期)
|
this.数量组.push(v.数量)
|
||||||
|
this.hasTax === '含税' ? this.单价组.push(v.含税单价) : this.单价组.push(v.未税单价)
|
||||||
|
this.交货期组.push(v.交货期)
|
||||||
|
} else { // 获取未询到价格的物料的询价单明细流水号们
|
||||||
|
inquiryDetailNum_old.push(v.询价单明细流水号)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
if (this.contractNumValue) {
|
if (this.contractNumValue) {
|
||||||
this.$confirm('此采购合同将递交审批,递交后该合同不可删除,确认完成编辑?', '提示', {
|
this.$confirm('此采购合同将递交审批,递交后该合同不可删除,确认完成编辑?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
doneContract(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content, this.taxRate * 100).then(response => {
|
doneContract(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content, this.taxRate * 100, inquiryDetailNum_old).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
this.$message.success('合同生成成功')
|
this.$message.success('合同生成成功')
|
||||||
this.reload()
|
this.reload()
|
||||||
|
|||||||
@@ -166,11 +166,11 @@
|
|||||||
{{ scope.row.供货商 }}
|
{{ scope.row.供货商 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">
|
<!--<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">-->
|
||||||
<template slot-scope="scope">
|
<!--<template slot-scope="scope">-->
|
||||||
{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}
|
<!--{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}-->
|
||||||
</template>
|
<!--</template>-->
|
||||||
</el-table-column>
|
<!--</el-table-column>-->
|
||||||
<el-table-column align="center" label="计划到货时间" min-width="100px">
|
<el-table-column align="center" label="计划到货时间" min-width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.物料计划到货时间.split(' ')[0] }}
|
{{ scope.row.物料计划到货时间.split(' ')[0] }}
|
||||||
@@ -380,11 +380,11 @@
|
|||||||
{{ scope.row.供货商 }}
|
{{ scope.row.供货商 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">
|
<!--<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">-->
|
||||||
<template slot-scope="scope">
|
<!--<template slot-scope="scope">-->
|
||||||
{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}
|
<!--{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}-->
|
||||||
</template>
|
<!--</template>-->
|
||||||
</el-table-column>
|
<!--</el-table-column>-->
|
||||||
<el-table-column align="center" label="计划到货时间" min-width="100px">
|
<el-table-column align="center" label="计划到货时间" min-width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.物料计划到货时间.split(' ')[0] }}
|
{{ scope.row.物料计划到货时间.split(' ')[0] }}
|
||||||
|
|||||||
Reference in New Issue
Block a user