This commit is contained in:
liushuai
2019-06-13 15:15:43 +08:00
11 changed files with 180 additions and 86 deletions

View File

@@ -103,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]}&请购单明细流水号=${params[6]}` param: `物料流水号=${params[0]}&货位流水号=${params[1]}&出库数量=${params[2]}&出库人流水号=${params[3]}&基本件流水号=${params[4]}&标准件和外购件流水号=${params[5]}&请购单明细流水号=${params[6]}&领料单流水号=${params[7]}&领料人流水号=${params[8]}&仓库流水号=${params[9]}&出库类别=${params[10]}`
} }
}) })
} }
@@ -119,3 +119,14 @@ export function errorRecord(...params) {
} }
}) })
} }
// 初始化出库类别
export function initOutType() {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: 'select * from 库存管理_出库类别'
}
})
}

View File

@@ -57,7 +57,7 @@ export function JurisdictionControl(num1, num2) {
} }
}) })
} }
// 所有工序 // 所有工序(原)
export function getTable2(stepNumber) { export function getTable2(stepNumber) {
return request({ return request({
url: '', url: '',
@@ -69,6 +69,18 @@ export function getTable2(stepNumber) {
} }
}) })
} }
// 所有工序(新)
export function getTable3(stepNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_加工进度修改2_查询',
param: '工艺计划流水号=' + stepNumber
}
})
}
// 正在加工零件 // 正在加工零件
export function searchParts(stepNumber) { export function searchParts(stepNumber) {
return request({ return request({

View File

@@ -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}`
}
})
}

View File

@@ -22,7 +22,7 @@ export const ServerIP = `http://192.168.1.231:8411/webpage/file/`
export const uploadFileMachine = `http://192.168.1.231:8411/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231 export const uploadFileMachine = `http://192.168.1.231:8411/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231
export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFileMachine.ashx` // 机床总图 发布时改成0.231 export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFileMachine.ashx` // 机床总图 发布时改成0.231
const service = axios.create({ const service = axios.create({
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`, baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间 timeout: 1500000 // 请求超时时间
}) })

View File

@@ -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)

View File

@@ -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, searchStockNumber3 } 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: '请输入' }],
@@ -259,6 +273,7 @@ export default {
basePartNum: '', // 中间变量基本件流水号 basePartNum: '', // 中间变量基本件流水号
purchaseBillNum: '', // 中间变量请购单明细流水号 purchaseBillNum: '', // 中间变量请购单明细流水号
parchasePartNum: '', // 中间变量标准件和外购件流水号 parchasePartNum: '', // 中间变量标准件和外购件流水号
inventoryNum: '', // 中间变量仓库流水号
locationNum: '', // 中间变量货位流水号 locationNum: '', // 中间变量货位流水号
outNumber: 0 // 中间变量出库数量 outNumber: 0 // 中间变量出库数量
} }
@@ -294,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() {
@@ -329,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
@@ -336,7 +360,6 @@ export default {
}, },
// 查看领料单明细相关的物料货位数量 // 查看领料单明细相关的物料货位数量
clickListDetail(row) { clickListDetail(row) {
console.log(row, 111)
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null, this.purchaseBillNum = 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.purchaseBillNum = 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.purchaseBillNum = null) : this.parchasePartNum row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.parchasePartNum
@@ -364,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)
@@ -387,7 +411,7 @@ export default {
if (valid) { if (valid) {
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表 // 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
// 物料流水号,货位流水号,出库数量 => 减掉货位物料数 // 物料流水号,货位流水号,出库数量 => 减掉货位物料数
submitOutStore(this.materialNum, this.locationNum, this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum, this.purchaseBillNum).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

View File

@@ -320,7 +320,7 @@
</template> </template>
<script> <script>
import { searchParts, getMachine, getMachine2, searchtable, getTable2, Order, JurisdictionControl, JurisdictionContro2, outParts } from '@/api/ManufacturingCenter/MachiningSequenceAdjustment' import { searchParts, getMachine, getMachine2, searchtable, getTable3, Order, JurisdictionControl, JurisdictionContro2, outParts } from '@/api/ManufacturingCenter/MachiningSequenceAdjustment'
import { wsuri, name } from '@/utils/request' import { wsuri, name } from '@/utils/request'
export default { export default {
data() { data() {
@@ -379,7 +379,7 @@ export default {
}) })
}, },
getRowKeys(row) { getRowKeys(row) {
return row.零件图 return row.工艺计划流水
}, },
selectMachine(row) { selectMachine(row) {
this.process = [] this.process = []
@@ -388,7 +388,7 @@ export default {
this.colorCode = [] this.colorCode = []
this.realDate = [] this.realDate = []
this.tableData2 = [] this.tableData2 = []
getTable2(row.零件图).then(response => { getTable3(row.工艺计划流水).then(response => {
for (let k = 0; k < response.data.length; k++) { for (let k = 0; k < response.data.length; k++) {
this.process[k] = response.data[k].工艺名称简称 this.process[k] = response.data[k].工艺名称简称
this.planDate[k] = response.data[k].计划日期_短 this.planDate[k] = response.data[k].计划日期_短
@@ -469,18 +469,18 @@ export default {
}, },
searchTable2(row) { searchTable2(row) {
if (this.a === 1) { if (this.a === 1) {
this.expands.push(row.零件图) this.expands.push(row.工艺计划流水)
this.b = row.零件图 this.b = row.工艺计划流水
this.a = 0 this.a = 0
} else { } else {
if (this.b === row.零件图) { if (this.b === row.工艺计划流水) {
this.expands = [] this.expands = []
this.a = 1 this.a = 1
} else { } else {
this.expands = [] this.expands = []
this.expands.push(row.零件图) this.expands.push(row.工艺计划流水)
this.a = 0 this.a = 0
this.b = row.零件图 this.b = row.工艺计划流水
} }
} }
this.process = [] this.process = []
@@ -489,7 +489,7 @@ export default {
this.colorCode = [] this.colorCode = []
this.realDate = [] this.realDate = []
this.tableData2 = [] this.tableData2 = []
getTable2(row.零件图).then(response => { getTable3(row.工艺计划流水).then(response => {
for (let k = 0; k < response.data.length; k++) { for (let k = 0; k < response.data.length; k++) {
this.process[k] = response.data[k].工艺名称简称 this.process[k] = response.data[k].工艺名称简称
this.planDate[k] = response.data[k].计划日期_短 this.planDate[k] = response.data[k].计划日期_短

View File

@@ -15,7 +15,7 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.value2 }}</div> <div style="float: right; color: #8492a6; font-size: 13px">{{ item.value2 }}</div>
</el-option> </el-option>
</el-select> </el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="asd()">查询</el-button>
<span>分组:</span> <span>分组:</span>
<el-select v-model="NumValue" size="small" style="margin-top:10px;width: 220px" filterable clearable placeholder="机床组号"> <el-select v-model="NumValue" size="small" style="margin-top:10px;width: 220px" filterable clearable placeholder="机床组号">
<el-option <el-option
@@ -727,6 +727,7 @@ export default {
this.getTable() this.getTable()
}, },
methods: { methods: {
asd() {},
// TABLE每行颜色 // TABLE每行颜色
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
if (rowIndex === 1) { if (rowIndex === 1) {
@@ -1442,7 +1443,6 @@ export default {
this.bianliang1.push(this.tableData1[i].工艺计划流水号) this.bianliang1.push(this.tableData1[i].工艺计划流水号)
} }
discharge(this.bianliang1).then(response => { discharge(this.bianliang1).then(response => {
console.log(response.data)
this.Selection1() this.Selection1()
}) })
}, },

View File

@@ -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">
@@ -993,25 +993,25 @@ export default {
v.供货商 = v.供货商 ? v.供货商 : '' v.供货商 = v.供货商 ? v.供货商 : ''
v.备注 = v.备注 ? v.备注 : '' v.备注 = v.备注 ? v.备注 : ''
}) })
import('./Export2Excel').then(excel => { import('./Export2Excel').then(excel => {
const dataGroup = [] const dataGroup = []
const filterVal1 = ['任务分配时间', '项目名称', '机床图号', '组号', '物料名称', '物料型号', '物料规格', '待询价数量', '备注', '供货商'] // tableData1里的属性名 const filterVal1 = ['任务分配时间', '项目名称', '机床图号', '组号', '物料名称', '物料型号', '物料规格', '待询价数量', '备注', '供货商'] // tableData1里的属性名
const filterVal2 = ['任务分配时间', '项目名称', '机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '待询价数量', '备注', '供货商'] // tableData2里的属性名 const filterVal2 = ['任务分配时间', '项目名称', '机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '待询价数量', '备注', '供货商'] // tableData2里的属性名
const data1 = res1.data.map(v => filterVal1.map(j => v[j])) const data1 = res1.data.map(v => filterVal1.map(j => v[j]))
dataGroup.push(data1) dataGroup.push(data1)
const data2 = res2.data.map(v => filterVal2.map(j => v[j])) const data2 = res2.data.map(v => filterVal2.map(j => v[j]))
dataGroup.push(data2) dataGroup.push(data2)
const headerGroup = [['任务分配时间', '项目名称', '机床图号', '组号', '名称', '图号或型号', '规格', '待询价数量', '备注', '供货商'], ['任务分配时间', '项目名称', '机床图号', '组号', '名称', '图号或型号', '规格', '材料', '待询价数量', '备注', '供货商']] const headerGroup = [['任务分配时间', '项目名称', '机床图号', '组号', '名称', '图号或型号', '规格', '待询价数量', '备注', '供货商'], ['任务分配时间', '项目名称', '机床图号', '组号', '名称', '图号或型号', '规格', '材料', '待询价数量', '备注', '供货商']]
const sheetGroup = ['外购件(未询价)', '基本件(未询价)'] const sheetGroup = ['外购件(未询价)', '基本件(未询价)']
excel.export_json_to_excel({ excel.export_json_to_excel({
headerGroup: headerGroup, headerGroup: headerGroup,
dataGroup: dataGroup, dataGroup: dataGroup,
sheetGroup: sheetGroup, sheetGroup: sheetGroup,
filename: '未询价采购件明细', filename: '未询价采购件明细',
autoWidth: true, autoWidth: true,
bookType: 'xlsx' bookType: 'xlsx'
})
}) })
})
}) })
}) })
}, },
@@ -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.供货商 })
} }
}) })

View File

@@ -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].备注
}) })
@@ -384,9 +407,9 @@ export default {
case '模板2': case '模板2':
this.demo2() this.demo2()
break break
// case '自定义': // case '自定义':
// this.customization() // this.customization()
// break // break
} }
}, },
demo1() { // 选择合同模板1 demo1() { // 选择合同模板1
@@ -570,22 +593,24 @@ export default {
} }
const merge = [] const merge = []
this.tableData1.map(v => { this.tableData1.map(v => {
merge.push({ if ((this.hasTax === '含税' && Number(v.含税单价)) || (this.hasTax === '未税' && Number(v.未税单价))) { // 筛掉未询到价格的物料
机床图号: v.机床图号, merge.push({
: v., 机床图: v.机床图,
: v., : v.,
名称: v.名称, 图号: v.图号,
规格: v.规格, 名称: v.名称,
数量: Number(v.数量), 规格: v.规格,
计量单位: v.计量单位, 数量: Number(v.数量),
单价: this.hasTax === '含税' ? v.含税单价 : v.未税单价, 计量单位: v.计量单位,
合计: (Number(v.数量) * (this.hasTax === '含税' ? Number(v.含税单价) : Number(v.未税单价))).toFixed(2), 单价: this.hasTax === '含税' ? v.含税单价 : v.未税单价,
交货期: v.交货期 ? v.交货期.split(' ')[0] : '', 合计: (Number(v.数量) * (this.hasTax === '含税' ? Number(v.含税单价) : Number(v.未税单价))).toFixed(2),
备注: v.备注 交货期: v.交货期 ? v.交货期.split(' ')[0] : '',
}) 备注: 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()

View File

@@ -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] }}