This commit is contained in:
liushuai
2019-10-05 15:54:56 +08:00
20 changed files with 1612 additions and 129 deletions

View File

@@ -82,7 +82,7 @@ export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, check2
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_分配后',
name: 'xqs_采购管理_采购部采购_查询物料_分配后_带库存',
param: `物料状态编号=${num1}&物料名称_check=${check1}&物料名称=${val1}&物料规格_check=${check2}&物料规格=${val2}&物料型号_check=${check3}&物料型号=${val3}&人员编号=${person}&项目流水号_check=${check4}&项目流水号=${val4}&机床流水号_check=${check5}&机床流水号=${val5}&组件流水号_check=${check6}&组件流水号=${val6}&零件类型=${val7}`,
Pagination: pageCurrent + '&' + pageSize
}
@@ -156,9 +156,9 @@ export function createInquirySheet(num1, id, num2, remark) {
url: '',
method: 'post',
data: {
type: '2',
type: '1',
name: '采购管理_询价单_增加数据',
param: `询价单编号=${num1}&采购员=${id}&供应商流水号=${num2}&备注=${remark}&identity=1=output`
param: `询价单编号=${num1}&采购员=${id}&供应商流水号=${num2}&备注=${remark}`
}
})
}

View File

@@ -1,18 +1,28 @@
import request from '@/utils/request'
// 初始化供应商
export function initSupplier(num) {
export function initSupplier() {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT distinct 供应商流水号,供应商名称
FROM 采购管理_询价单_视图
where not EXISTS (select * from 采购管理_采购合同_采购部 where 是否启用 = 1 and 是否未通过 is null and 询价单编号 = 采购合同编号) and 采购员流水号 = ${num}`
name: `SELECT distinct * from 采购管理_供应商`
}
})
}
// export function initSupplier(num) {
// return request({
// url: '',
// method: 'post',
// data: {
// type: '3',
// name: `SELECT distinct 供应商流水号,供应商名称
// FROM 采购管理_询价单_视图
// where not EXISTS (select * from 采购管理_采购合同_采购部 where 是否启用 = 1 and 是否未通过 is null and 询价单编号 = 采购合同编号) and 采购员流水号 = ${num}`
// }
// })
// }
// 查询询价单列表 表1
export function searchInquirySheet(check1, value1, check2, value2, check3, id, check4, supplier) {
return request({

View File

@@ -1,5 +1,16 @@
import request from '@/utils/request'
export function getSupplier1(check, num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_供货商_查询数据_根据条件',
param: '供货商_check=' + check + '=int&供货商=' + num
}
})
}
export function AddGonghuoshang(num) {
return request({
url: '',

View File

@@ -76,8 +76,8 @@ export function searchTable1(...params) {
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_分配后',
param: `物料类别流水号_check=${params[2]}&物料类别流水号=${params[3]}&物料品种流水号_check=${params[4]}&物料品种流水号=${params[5]}&项目流水号_check=${params[6]}&项目流水号=${params[7]}&机床流水号_check=${params[8]}&机床流水号=${params[9]}&组件流水号_check=${params[10]}&组件流水号=${params[11]}&物料名称_check=${params[12]}&物料名称=${params[13]}&物料状态编号=${params[14]}&物料规格_check=${params[15]}&物料规格=${params[16]}&物料型号_check=${params[17]}&物料型号=${params[18]}&零件类型=${params[19]}`,
name: 'xqs_采购管理_采购部采购_查询物料_分配后',
param: `物料类别流水号_check=${params[2]}&物料类别流水号=${params[3]}&物料品种流水号_check=${params[4]}&物料品种流水号=${params[5]}&项目流水号_check=${params[6]}&项目流水号=${params[7]}&机床流水号_check=${params[8]}&机床流水号=${params[9]}&组件流水号_check=${params[10]}&组件流水号=${params[11]}&物料名称_check=${params[12]}&物料名称=${params[13]}&物料状态编号=${params[14]}&物料规格_check=${params[15]}&物料规格=${params[16]}&物料型号_check=${params[17]}&物料型号=${params[18]}&零件类型=${params[19]}&时间段_check=${params[20]}&开始时间=${params[21]}&结束时间=${params[22]}`,
Pagination: params[0] + '&' + params[1]
}
})

View File

@@ -0,0 +1,99 @@
import request from '@/utils/request'
// 查询采购单
export function searchPurchaseOrder(pageCurrent, pageSize, check1, num, check2, name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_采购计划_查询数据_到货',
param: `采购单号_check=${check1}&采购单号=${num}&供应商名称_check=${check2}&供应商名称=${name}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询采购计划明细
export function searchMateriel(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_采购计划明细_查询数据_未选入',
param: `采购计划流水号=${num}`
}
})
}
// 查询到货单
export function searchArriveOrder(pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_到货单查询',
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 新增到货单
export function addPurchaseOrder(num1, num2, num3, num4, num5) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '备料管理_新增到货单',
param: `材料=${num1}&单位=${num2}&数量=${num3}&金额=${num4}&备注=${num5}`
}
})
}
// 编辑采购单
export function editPurchaseOrder(num1, num2, num3, num4, num5, num6) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '备料管理_编辑到货单',
param: `材料=${num1}&单位=${num2}&数量=${num3}&金额=${num4}&备注=${num5}&到货单流水号=${num6}`
}
})
}
// 删除采购单
export function deletePurchaseOrder(PurchaseOrderNameValue) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '备料管理_删除到货单',
param: `到货单流水号=${PurchaseOrderNameValue}`
}
})
}
// 查询采购计划明细
export function searchTable5(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_到货单明细查询',
param: `到货单流水号=${num}`
}
})
}
// 选入
export function addMateriel(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '备料管理_到货单明细_选入',
param: `到货单流水号=${num1}&工艺计划流水号组=${num2}&采购计划明细流水号组=${num3}`
}
})
}

View File

@@ -0,0 +1 @@
<svg class="icon" viewBox="0 0 1045 1024" xmlns="http://www.w3.org/2000/svg" width="204.102" height="200"><defs><style/></defs><path d="M229.836 177.192h461.986v57.748H229.836v-57.748zm-1.54 116.063h461.986v57.748H228.297v-57.748zm-113.955-232.5h692.977v461.984h57.748V60.754c0-31.893-25.855-57.748-57.748-57.748H114.34c-31.893 0-57.748 25.855-57.748 57.748v808.473c0 31.893 25.855 57.748 57.748 57.748h404.237v-57.748H114.34V60.754zm115.11 463.486v57.748h140.453c0-20.068 2.94-39.447 8.386-57.748H229.451zm236.111-115.496H228.297v57.748H403.84a203.177 203.177 0 0 1 61.722-57.748zm437.246 464.777L770.39 742.678c30.444-35.382 48.852-81.417 48.852-131.754 0-111.627-90.493-202.119-202.117-202.119-111.626 0-202.118 90.492-202.118 202.119 0 111.624 90.492 202.118 202.118 202.118 40.412 0 78.05-11.867 109.63-32.299l135.218 133.614c11.276 11.276 29.558 11.276 40.834 0 11.274-11.277 11.274-29.558 0-40.835zM472.754 610.924c0-79.734 64.639-144.37 144.372-144.37 79.731 0 144.369 64.636 144.369 144.37 0 79.731-64.638 144.37-144.37 144.37s-144.37-64.639-144.37-144.37z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -9,7 +9,7 @@
<el-checkbox v-model="all" size="small">查询全部</el-checkbox>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="打印备料单" placement="top"/>
<el-tooltip effect="dark" content="打印备料单" placement="top" open-delay="1200">
<el-tooltip :open-delay="1200" effect="dark" content="打印备料单" placement="top">
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:0px" @click="exportTable('BL')">导出备料单</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="将选中零件分配为自家备料" placement="top">

View File

@@ -12,7 +12,7 @@
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageCurrent=1;pageSize=10;searchMaterial()">查询</el-button>
</el-row>
</div>
<el-table :data="tableData1" stripe border height="600px" size="mini" show-summary>
<el-table :data="tableData1" stripe border height="700px" size="mini" show-summary>
<el-table-column label="名称" align="center" width="130" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}

View File

@@ -68,7 +68,7 @@
<el-card>
<span>零件图号:</span>
<el-input v-model="partName2" placeholder="零件图号" size="small" clearable style="width:200px;margin: 3px 0"/>
<el-tooltip :open-delay="1200" effect="dark" content="外购备料确认" placement="top">
<el-tooltip :open-delay="1200" effect="dark" content="外购备料查询" placement="top">
<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-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="外购备料完成" placement="top">
@@ -120,7 +120,8 @@
</div>
</template>
<script>import { getMachines, getGroups, searchtable, searchtable2, searchtable3, change2, change3, edit } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
<script>
import { getMachines, getGroups, searchtable, searchtable2, searchtable3, change2, change3, edit } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'
export default {
@@ -172,10 +173,11 @@ export default {
}
}
},
// created() {
// this.searchTable()
// this.searchTable2()
// },
created() {
this.getMachine()
this.searchTable()
this.searchTable2()
},
methods: {
handleSelectionChange2(val) {
this.arrest2 = val

View File

@@ -179,6 +179,11 @@
{{ scope.row.待询价数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }}
</template>
</el-table-column>
<el-table-column label="库存数" align="center" min-width="90">
<template slot-scope="scope">
{{ Number(scope.row.货位存量) }}
</template>
</el-table-column>
<el-table-column label="使用滞货数量" align="center" min-width="100">
<template slot-scope="scope">
{{ Number(scope.row.使用滞货数量) }}
@@ -603,7 +608,7 @@
</table>
</div>
<el-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px" width="700px">
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px" width="700px">
<el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm">
<el-row>
<el-col :span="12">
@@ -709,10 +714,10 @@
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogVisible2" :title="title2" center style="min-height: 300px" width="400px">
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" :title="title2" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px">
<el-form-item label="询价单号" prop="inquirySheetNum">
<el-input v-model="form2.inquirySheetNum" readonly size="small"/>
<el-input v-model="form2.inquirySheetNum" size="small"/>
</el-form-item>
<el-form-item label="供应商" prop="supplierNameValue">
<el-select v-model="form2.supplierNameValue" style="width:200px" placeholder="供应商" size="small" filterable>
@@ -742,7 +747,7 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible3" title="物料变更选择" center style="min-height: 300px;" width="780px">
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible3" title="物料变更选择" center style="min-height: 300px;" width="780px">
<el-row style="margin-bottom: 10px">
<span>物料名称:</span>
<el-input v-model="materialName0" placeholder="物料名称" size="small" clearable/>
@@ -790,7 +795,7 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible4" title="使用滞货" center style="min-height: 300px;" width="400px">
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible4" title="使用滞货" center style="min-height: 300px;" width="400px">
<span>使用滞货数量:</span>
<el-input-number :min="0" :max="maxUseNumber" v-model="useNumber" controls-position="right"/>
<div style="margin: 10px 0 0 10px;color: red">注意:确定后将不可取消使用滞货</div>
@@ -1413,6 +1418,7 @@ export default {
this.groupValue ? check6 = 1 : check6 = 0
searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue, 2).then(response => {
this.tableData11 = response.data.rows
console.log(response.data.rows)
this.total11 = response.data.total
const remark = []
const supplier = []
@@ -1538,8 +1544,7 @@ export default {
this.$refs['form2'].validate((valid) => {
if (valid) {
createInquirySheet(this.form2.inquirySheetNum, this.id, this.form2.supplierNameValue, '').then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
if (!(response.data)) {
this.$message.success('创建成功')
this.form2.supplierNameValue = ''
this.inquirySheetNum = ''
@@ -1547,7 +1552,7 @@ export default {
this.supplierValue = ''
this.dialogVisible2 = false
this.searchTable2()
} else { this.$message.error('操作失败') }
} else { this.$message.error('操作失败!该询价单已存在,请重新输入') }
})
}
})

View File

@@ -4,10 +4,10 @@
<el-form label-width="90px" label-position="right">
<el-row>
<el-col :span="6">
<el-form-item label="供应商:">
<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange">
<el-form-item label="合同编号:">
<el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange">
<el-option
v-for="item in supplier"
v-for="item in contractNums"
:key="item.value"
:label="item.label"
:value="item.value"/>
@@ -15,10 +15,11 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同编号:">
<el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange">
<el-form-item label="供应商:">
<!--<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange">-->
<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange9745">
<el-option
v-for="item in contractNums"
v-for="item in supplier"
:key="item.value"
:label="item.label"
:value="item.value"/>
@@ -370,6 +371,7 @@ export default {
},
fetchData() {
initSupplier(this.id).then(res => {
// this.id
this.supplier = []
for (let i = 0; i < res.data.length; i++) {
this.supplier.push({
@@ -446,6 +448,13 @@ export default {
}
})
},
supplierChange9745() {
for (let i = 0; i < this.supplier.length; i++) {
if (this.supplier[i].value === this.supplierValue) {
this.supplierName = this.supplier[i].label
}
}
},
contractChange() { // 选择合同select
searchContractHeader(this.contractNumValue).then(response => {
this.deliveryDate = response.data[0].交货日期

View File

@@ -36,7 +36,7 @@
<span>物料名称:</span>
<el-input v-model="MaterialName" placeholder="物料名称" size="small" clearable />
</el-col>
<el-col style="width: 280px;margin-top: 10px">
<el-col style="width: 280px;margin-top: 3px">
<span>物料全称:</span>
<el-input
v-model="FullNameOfMaterial"
@@ -44,7 +44,7 @@
size="small"
clearable/>
</el-col>
<el-col style="width: 280px;margin-top: 10px">
<el-col style="width: 280px;margin-top: 3px">
<span>物料规格:</span>
<el-input
v-model="MaterialSpecification"
@@ -52,7 +52,7 @@
size="small"
clearable/>
</el-col>
<el-col style="width: 280px;margin-top: 10px">
<el-col style="width: 280px;margin-top: 3px">
<span>物料型号:</span>
<el-input
v-model="MaterialModel"
@@ -92,13 +92,26 @@
</el-col>
<el-col style="width: 280px">
<span style="margin-left: 25px">供货商:</span>
<el-input
v-model="supplier"
placeholder="供货商"
size="small"
<el-select
v-model="GonghuoshangValue"
placeholder="请选择"
filterable
style="margin-bottom: 3px;margin-top: 10px"
clearable
@dblclick.native="param=0;openSupplier()"/>
size="small"
clearable>
<el-option
v-for="item in Gonghuoshang"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--<el-input-->
<!--v-model="supplier"-->
<!--placeholder="供货商"-->
<!--size="small"-->
<!--style="margin-bottom: 3px;margin-top: 10px"-->
<!--clearable-->
<!--@dblclick.native="param=0;openSupplier()"/>-->
</el-col>
<el-col style="width: 450px">
<el-button
@@ -313,14 +326,27 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="供货商" prop="供货商">
<el-input
v-model="form.供货商"
placeholder="供货商"
size="small"
clearable
<el-form-item label="供货商" prop="GonghuoshangValue">
<el-select
v-model="form.GonghuoshangValue"
placeholder="请选择"
filterable
style="width:200px"
@click.native="param=1;openSupplier()"/>
size="small"
clearable>
<el-option
v-for="item in Gonghuoshang2"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--<el-input-->
<!--v-model="form.供货商"-->
<!--placeholder="供货商"-->
<!--size="small"-->
<!--clearable-->
<!--style="width:200px"-->
<!--@click.native="param=1;openSupplier()"/>-->
</el-form-item>
</el-col>
<el-col :span="12">
@@ -459,6 +485,7 @@
<script>
import {
getSupplier1,
AddGonghuoshang,
initDepartmentName,
initMaterialCategory,
@@ -484,6 +511,9 @@ import { mapGetters } from 'vuex'
export default {
data() {
return {
Gonghuoshang: [],
Gonghuoshang2: [],
GonghuoshangValue: '',
form3: {
供货商名称: ''
},
@@ -555,11 +585,11 @@ export default {
物料型号: '',
计量单位流水号: '',
物料来源流水号: '',
供货商: ''
GonghuoshangValue: ''
},
rules: {
物料名称: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
供货商: [{ required: true, message: '请选择供货商', trigger: 'change' }],
GonghuoshangValue: [{ required: true, message: '请选择供货商', trigger: 'change' }],
物料类别流水号: [{ required: true, message: '请选择物料类别', trigger: 'change' }],
物料品种流水号: [{ required: true, message: '请选择物料品种', trigger: 'change' }],
计量单位流水号: [{ required: true, message: '请选择计量单位', trigger: 'change' }],
@@ -577,8 +607,25 @@ export default {
created() {
this.fetchData()
this.searchMaterialCategory()
this.getGonghuoshang()
},
methods: {
getGonghuoshang() { // 供货商初始化查询
this.Gonghuoshang = []
this.Gonghuoshang2 = []
getSupplier1(0, 0).then(response => {
response.data.map(v => {
this.Gonghuoshang.push({
label: v.供货商,
value: v.供货商流水号
})
this.Gonghuoshang2.push({
label: v.供货商,
value: v.供货商流水号
})
})
})
},
open() {
if (this.$refs['form3'] !== undefined) {
this.$refs['form3'].resetFields()
@@ -627,8 +674,8 @@ export default {
this.MaterialVarietyValue !== '' ? this.check6 = 1 : this.check6 = 0 // 物料品种
this.MeasurementUnitValue !== '' ? this.check7 = 1 : this.check7 = 0 // 计量单位
this.MaterialSourceValue !== '' ? this.check8 = 1 : this.check8 = 0 // 物料来源
this.supplier !== '' ? this.check9 = 1 : this.check9 = 0 // 供货商
searchmaterial(this.check1, this.MaterialName, this.check2, this.FullNameOfMaterial, this.check3, this.MaterialSpecification, this.check4, this.MaterialModel, this.pageCurrent, this.pageSize, this.check5, this.MaterialCategoryValue, this.check6, this.MaterialVarietyValue, this.check7, this.MeasurementUnitValue, this.check8, this.MaterialSourceValue, this.check9, this.supplierValue).then(response => {
this.GonghuoshangValue !== '' ? this.check9 = 1 : this.check9 = 0 // 供货商
searchmaterial(this.check1, this.MaterialName, this.check2, this.FullNameOfMaterial, this.check3, this.MaterialSpecification, this.check4, this.MaterialModel, this.pageCurrent, this.pageSize, this.check5, this.MaterialCategoryValue, this.check6, this.MaterialVarietyValue, this.check7, this.MeasurementUnitValue, this.check8, this.MaterialSourceValue, this.check9, this.GonghuoshangValue).then(response => {
this.tableData = response.data.result
this.total = parseInt(response.data.output[0].ItemCount)
})
@@ -692,7 +739,7 @@ export default {
this.addForm('form', [this.dialogFormVisible1 = true, this.title = '增加'])
},
submitAdd() { // 提交增加
this.addTable(addData, [this.form.物料品种流水号, this.form.物料名称, this.form.物料全名, this.form.物料规格, this.form.物料型号, this.form.计量单位流水号, this.form.物料来源流水号, this.supplierValue1], 'form', function() {
this.addTable(addData, [this.form.物料品种流水号, this.form.物料名称, this.form.物料全名, this.form.物料规格, this.form.物料型号, this.form.计量单位流水号, this.form.物料来源流水号, this.form.GonghuoshangValue], 'form', function() {
this.dialogFormVisible1 = false
this.searchMaterial()
})

View File

@@ -276,14 +276,17 @@
size="small"
style="margin-left: 10px"
@click="addOfflineContract">创建离线合同</el-button>
<el-button
type="warning"
size="small"
style="margin-left: 10px"
@click="addMateriel">选入物料</el-button>
<el-tooltip :open-delay="1000" effect="dark" content="将勾选的物料库中物料选入到选中的离线合同" placement="top">
<el-button
type="warning"
size="small"
style="margin-left: 10px"
@click="addMateriel">选入物料</el-button>
</el-tooltip>
</div>
<el-table v-loading="" :data="tableData2" border style="max-height: 460px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column type="expand" fixed="left">
<el-table-column label="详情" type="expand" fixed="left">
<template slot-scope="scope">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="离线合同备注">
@@ -368,8 +371,9 @@
<el-button v-if="quickChangePrice" size="mini" style="float:right;" @click="quickChangePrice=!quickChangePrice">快速修改价格</el-button>
<el-button v-else size="mini" style="float:right;" @click="quickChangePrice=!quickChangePrice">还原</el-button>
</div>
<el-table v-loading="" :data="tableData3" :summary-method="getSummaries" border style="max-height: 500px;" height="500px" size="mini" show-summary>
<el-table-column label="离线合同编号" align="center" min-width="150">
<!--<h3>合同详细信息</h3>-->
<el-table v-loading="" :data="tableData3" :summary-method="getSummaries" border style="max-height: 500px;" height="450px" size="mini" show-summary>
<el-table-column label="离线合同编号" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
@@ -395,7 +399,7 @@
<b v-else>{{ scope.row.数量 }}</b>
</template>
</el-table-column>
<el-table-column label="单位" align="center" min-width="100">
<el-table-column label="单位" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.计量单位 }}
</template>

View File

@@ -41,54 +41,35 @@
<b style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</b>
</el-option>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px;"
@click="pageCurrent0=1;pageSize0=20;total0=0;searchTable0()">查询</el-button>
<div style="float:right;">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
</el-row>
<el-row style="margin-bottom: 5px">
<span style="margin-left: 0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-select v-model="groupValue" placeholder="组号" size="small" filterable clearable>
<span style="margin-left: 5px">组号:</span>
<el-select v-model="groupValue" placeholder="组号" size="small" filterable clearable width="100px">
<el-option
v-for="item in group"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-right: -10px">物料状态:</span>
<el-cascader :options="materialStatus" :props="{ checkStrictly: true }" v-model="materialStatusValue" size="small" style="margin-left: 10px"/>
<div style="float:right;padding-top:10px;">
<el-button
type="primary"
size="small"
icon="el-icon-menu"
style="margin-left: 10px"
@click="allocateTask1">分配</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-back"
style="margin-left: 10px"
@click="executeReturn1">退回</el-button>
</div>
<span style="margin-left: 10px">时间段:</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
style="width:250px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
</el-row>
<el-row style="margin-bottom: 15px">
<el-row style="margin-bottom: 5px">
<span>物料状态:</span>
<el-cascader :options="materialStatus" :props="{ checkStrictly: true }" v-model="materialStatusValue" size="small" width="100px" style="margin-top: 5px"/>
<span style="margin-left: 0">物料类别:</span>
<el-select
v-model="MaterialCategoryValue"
placeholder="请选择"
placeholder="请选择物料类别"
size="small"
clearable
@change="searchMaterialVariety">
@@ -101,7 +82,7 @@
<span>物料品种:</span>
<el-select
v-model="MaterialVarietyValue"
placeholder="请选择"
placeholder="请选择物料品种"
size="small"
clearable>
<el-option
@@ -110,14 +91,48 @@
:label="item.label"
:value="item.value"/>
</el-select>
<div style="float:right;">
<span style="margin-left: 0">采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
</el-row>
<el-row style="margin-bottom: 15px">
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<el-input v-model="materialName" placeholder="请选择物料名称" size="small" style="margin-top: 5px" clearable/>
<span>物料规格:</span>
<el-input v-model="materialSpec" placeholder="物料规格" size="small" clearable/>
<el-input v-model="materialSpec" placeholder="请选择物料规格" size="small" clearable/>
<span>物料型号:</span>
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
<el-input v-model="materialModel" placeholder="请选择物料型号" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px;"
@click="pageCurrent0=1;pageSize0=20;total0=0;searchTable0()">查询</el-button>
<div style="float:right;padding-top:5px;">
<el-tooltip :open-delay="1000" effect="dark" content="选择采购员后,将物料分配给所选的采购员" placement="top">
<el-button
type="primary"
size="small"
icon="el-icon-menu"
style="margin-left: 10px"
@click="allocateTask1">分配</el-button>
</el-tooltip>
<el-tooltip :open-delay="1000" effect="dark" content="退回勾选的未分配的物料至车间" placement="top">
<el-button
type="danger"
size="small"
icon="el-icon-back"
style="margin-left: 10px"
@click="executeReturn1">退回</el-button>
</el-tooltip>
</div>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table v-loading="" :data="tableData0" size="mini" style="max-height: 600px" height="500px" border stripe @selection-change="handleSelectionChange1">
@@ -646,6 +661,42 @@ export default {
name: '', // 采购任务分配
data() {
return {
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
}
}, {
text: '近一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
picker.$emit('pick', [start, end])
}
}]
},
dateRange: '',
timer2: '',
machines: [],
source: [
@@ -741,11 +792,19 @@ export default {
this.fetchData() // 初始化数据
this.searchUnallocatePartNumber()
this.timer2 = setInterval(this.searchUnallocatePartNumber, 20 * 60 * 1000) // 20 分钟一刷新
this.getDefaultTime()
},
beforeDestroy() {
clearInterval(this.timer2)
},
methods: {
getDefaultTime() {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
end.getTime(start.getTime())
this.dateRange = [start, end]
},
// 选择机床
clickCard(project, machine) {
this.projectValue = project
@@ -861,13 +920,14 @@ export default {
this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 0
let check0, check1, check2, check3
let check0, check1, check2, check3, check4
this.machineValue ? check0 = 1 : check0 = 0
this.groupValue ? check1 = 1 : check1 = 0
this.materialName ? this.check4 = 1 : this.check4 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
searchTable1(this.pageCurrent0, this.pageSize0, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, check0, this.machineValue, check1, this.groupValue, this.check4, this.materialName, this.materialStatusValue[this.materialStatusValue.length - 1], check2, this.materialSpec, check3, this.materialModel, 1).then(response => {
this.dateRange ? check4 = 1 : (check4 = 0, this.dateRange = '')
searchTable1(this.pageCurrent0, this.pageSize0, this.check1, this.MaterialCategoryValue, this.check2, this.MaterialVarietyValue, this.check3, this.projectValue, check0, this.machineValue, check1, this.groupValue, this.check4, this.materialName, this.materialStatusValue[this.materialStatusValue.length - 1], check2, this.materialSpec, check3, this.materialModel, 1, check4, this.dateRange[0], this.dateRange[1]).then(response => {
this.tableData0 = response.data.rows
this.total0 = response.data.total
})
@@ -1087,9 +1147,6 @@ export default {
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.item {

View File

@@ -0,0 +1,224 @@
/* eslint-disable */
require('script-loader!file-saver');
// import XLSX from 'xlsx'
import XLSX from 'xlsx-style'
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
var ranges = [];
for (var R = 0; R < rows.length; ++R) {
var outRow = [];
var row = rows[R];
var columns = row.querySelectorAll('td');
for (var C = 0; C < columns.length; ++C) {
var cell = columns[C];
var colspan = cell.getAttribute('colspan');
var rowspan = cell.getAttribute('rowspan');
var cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
}
});
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
ranges.push({
s: {
r: R,
c: outRow.length
},
e: {
r: R + rowspan - 1,
c: outRow.length + colspan - 1
}
});
};
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
//Handle Colspan
if (colspan)
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
}
out.push(outRow);
}
return [out, ranges];
};
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
var ws = {};
var range = {
s: {
c: 10000000,
r: 10000000
},
e: {
c: 0,
r: 0
}
};
for (var R = 0; R != data.length; ++R) {
for (var C = 0; C != data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
var cell = {
v: data[R][C]
};
if (cell.v == null) continue;
var cell_ref = XLSX.utils.encode_cell({
c: C,
r: R
});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
} else cell.t = 's';
ws[cell_ref] = cell;
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
var oo = generateArray(theTable);
var ranges = oo[1];
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), "test.xlsx")
}
export function export_json_to_excel({
headerGroup,
dataGroup,
sheetGroup,
filename,
autoWidth = true,
bookType= 'xlsx'
} = {}) {
var wb = new Workbook()
for (let i = 0; i < dataGroup.length; i++) {
/* original data */
let data = dataGroup[i]
filename = filename || 'excel-list'
data = [...data]
data.unshift(headerGroup[i]);
var ws_name = sheetGroup[i];
var ws = sheet_from_array_of_arrays(data);
if (autoWidth) {
/*设置worksheet每列的最大宽度*/
const colWidth = data.map(row => row.map(val => {
/*先判断是否为null/undefined*/
if (val == null) {
return {
'wch': 10
};
}
/*再判断是否为中文*/
else if (val.toString().charCodeAt(0) > 255) {
return {
'wch': val.toString().length * 2
};
} else {
return {
'wch': val.toString().length
};
}
}))
/*以第一行为初始值*/
let result = colWidth[0];
for (let i = 1; i < colWidth.length; i++) {
for (let j = 0; j < colWidth[i].length; j++) {
if (result[j]['wch'] < colWidth[i][j]['wch']) {
result[j]['wch'] = colWidth[i][j]['wch'];
}
}
}
ws['!cols'] = result;
}
let R = 0;
data.map(item => {
let C = 0;
item.map(itm => {
var cell_ref = XLSX.utils.encode_cell({c:C,r:R});
var cell = {v: itm }
cell.s= {
alignment: {
horizontal: "center"
}
}
ws[cell_ref] = cell;
C++;
})
R++;
})
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
}
var wbout = XLSX.write(wb, {
bookType: bookType,
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), `${filename}.${bookType}`);
}

View File

@@ -0,0 +1,522 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>名称:</span>
<el-input v-model="Name" placeholder="名称" size="small" clearable style="width:200px"/>
<span>规格:</span>
<el-input v-model="spec" placeholder="规格" size="small" clearable style="width:200px"/>
<span>型号:</span>
<el-input v-model="model" placeholder="型号" size="small" clearable style="width:200px"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable()">查询</el-button>
</el-row>
<el-row v-show="false">
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange">
<el-option
v-for="item in machineNumber"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-select v-model="groupNumberValue" placeholder="组号" size="small" clearable>
<el-option
v-for="item in groupNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
</el-card>
<el-tabs v-model="PartType" type="border-card" @tab-click="searchTable()">
<el-tab-pane label="标准件" name="标准件">
<el-table :data="tableData0" size="mini" style="max-height: 600px" height="600px" border stripe>
<el-table-column align="center" label="采购情况" width="80px">
<template slot-scope="scope">
<el-tag v-if="!scope.row.人员编号" type="primary" size="small">未分配</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="名称" width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="型号" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="200px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="技术下达数量" width="100px">
<template slot-scope="scope">
{{ scope.row.零件数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="合同采购数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || scope.row.离线采购数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="到货数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || scope.row.离线到货数量 || '—' }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent0"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize0"
:total="total0"
style="margin-top:10px;display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange0"
@current-change="handleCurrentChange0"/>
</div>
</el-tab-pane>
<el-tab-pane label="外购件" name="外购件">
<el-table :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe>
<el-table-column align="center" label="采购情况" width="80px">
<template slot-scope="scope">
<el-tag v-if="!scope.row.人员编号" type="primary" size="small">未分配</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<!--<el-table-column align="center" label="机床图号" width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.机床图号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="组号" width="80px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.组号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="名称" width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="型号" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="200px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<!--<el-table-column align="center" label="供货商" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.供货商 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="备注" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.备注 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="技术下达数量" width="100px">
<template slot-scope="scope">
{{ scope.row.零件数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="合同采购数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || scope.row.离线采购数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="到货数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || scope.row.离线到货数量 || '—' }}
</template>
</el-table-column>
<!--<el-table-column align="center" label="供应商" min-width="150px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.供应商名称 || scope.row.离线合同供应商名称 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="合同编号" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.采购合同编号 || scope.row.离线合同编号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="采购员" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.姓名 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="margin-top:10px;display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件" name="基本件">
<el-table :data="tableData2" size="mini" style="max-height: 600px" height="600px" border stripe>
<el-table-column align="center" label="采购情况" width="80px">
<template slot-scope="scope">
<el-tag v-if="!scope.row.人员编号" type="primary" size="small">未分配</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<!--<el-table-column align="center" label="机床图号" width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.机床图号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="名称" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<!--<el-table-column align="center" label="图号" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.零件图号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="规格" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
</el-table-column>
<!--<el-table-column align="center" label="材料" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.材料 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="供货商" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.供货商 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="备注" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="技术下达数量" width="100px">
<template slot-scope="scope">
{{ scope.row.零件数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="采购数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="到货数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || '—' }}
</template>
</el-table-column>
<!--<el-table-column align="center" label="供应商" min-width="100px" show-overflow-tooltip>-->
<!--<template slot-scope="scope">-->
<!--{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.供应商名称 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="采购合同编号" min-width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.采购合同编号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="采购员" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.姓名 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="margin-top:10px;display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { initMachineProject, searchgroup, searchTable1, searchTable2, searchTable1Export, searchTable2Export } from '@/api/PurchasingCenter/PurchaseSituationSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购件采购查询
data() {
return {
Name: '',
spec: '',
model: '',
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
groupNumber: [],
PartType: '标准件',
tableData0: [],
tableData1: [],
tableData2: [],
tableData3: [],
pageCurrent0: 1,
pageSize0: 20,
total0: 0,
pageCurrent1: 1,
pageSize1: 20,
total1: 0,
pageCurrent2: 1,
pageSize2: 20,
total2: 0
}
},
computed: {
...mapGetters([
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
this.searchTable()
},
methods: {
// 导出采购物料执行情况
exportDetail() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 1).then(res1 => { // 标准件
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 2).then(res2 => { // 外购件
searchTable2Export(check1, this.machineNumberValue, check2, this.groupNumberValue).then(res3 => { // 基本件
import('./Export2Excel').then(excel => {
const dataGroup = []
const filterVal1 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '备注'] // tableData0里的属性名
const filterVal2 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '备注'] // tableData1里的属性名
const filterVal3 = ['机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '零件数量', '数量', '已到货数量', '供应商名称', '采购合同编号', '姓名', '供货商', '备注'] // tableData2里的属性名
const data1 = res1.data.map(v => filterVal1.map(j => {
if (typeof (j) === 'string') {
return v[j] || '—'
} else {
return v[j[0]] || v[j[1]] || '—'
}
}))
data1.map(v => {
v.push('') // 物料状态
if (v[10] === '—') {
v[13] = '未分配'
} else if (v[6] === '—') {
v[13] = '未采购'
} else if (v[6] !== '—' && v[6] !== v[7]) {
v[13] = '未全部到货'
} else if (v[6] !== '—' && v[6] === v[7]) {
v[13] = '全部到货'
}
})
dataGroup.push(data1)
const data2 = res2.data.map(v => filterVal2.map(j => {
if (typeof (j) === 'string') {
return v[j] || '—'
} else {
return v[j[0]] || v[j[1]] || '—'
}
}))
data2.map(v => {
v.push('') // 物料状态
if (v[10] === '—') {
v[13] = '未分配'
} else if (v[6] === '—') {
v[13] = '未采购'
} else if (v[6] !== '—' && v[6] !== v[7]) {
v[13] = '未全部到货'
} else if (v[6] !== '—' && v[6] === v[7]) {
v[13] = '全部到货'
}
})
dataGroup.push(data2)
const data3 = res3.data.map(v => filterVal3.map(j => {
if (typeof (j) === 'string') {
return v[j] || '—'
} else {
return v[j[0]] || v[j[1]] || '—'
}
}))
data3.map(v => {
v.push('') // 物料状态
if (v[11] === '—') {
v[14] = '未分配'
} else if (v[7] === '—') {
v[14] = '未采购'
} else if (v[7] !== '—' && v[7] !== v[8]) {
v[14] = '未全部到货'
} else if (v[7] !== '—' && v[7] === v[8]) {
v[14] = '全部到货'
}
})
dataGroup.push(data3)
const headerGroup = [['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态'],
['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态'],
['机床号', '组号', '名称', '图号或型号', '规格', '材料', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态']]
const sheetGroup = ['标准件', '外购件', '基本件']
excel.export_json_to_excel({
headerGroup: headerGroup,
dataGroup: dataGroup,
sheetGroup: sheetGroup,
filename: '采购物料执行情况',
autoWidth: true,
bookType: 'xlsx'
})
})
})
})
})
},
fetchData() {
initMachineProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
})
},
machineChange() {
this.groupNumberValue = ''
this.groupNumber = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNumber.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
searchTable() {
if (this.PartType === '标准件') {
this.searchTable0()
} else if (this.PartType === '外购件') {
this.searchTable1()
} else if (this.PartType === '基本件') {
this.searchTable2()
}
},
handleSizeChange0(val) {
this.pageSize0 = val
this.pageCurrent0 = 1
this.searchTable0()
},
handleCurrentChange0(val) {
this.pageCurrent0 = val
this.searchTable0()
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
searchTable0() { // 查询标准件
let check1, check2, check3, check4, check5
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
this.Name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
console.log(this.tableData0)
this.tableData0 = response.data.rows
this.total0 = response.data.total
})
},
searchTable1() { // 查询外购件
let check1, check2, check3, check4, check5
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
this.Name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
searchTable2() { // 查询基本件
let check1, check2, check3, check4, check5
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
this.Name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 0px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -292,7 +292,7 @@
</el-table-column>
<el-table-column align="center" label="创立日期">
<template slot-scope="scope">
{{ scope.row.创立日期 }}
{{ scope.row.创立日期&&scope.row.创立日期!=='1900-01-01' ? scope.row.创立日期 : '-' }}
</template>
</el-table-column>
<el-table-column align="center" label="注册资本">
@@ -435,7 +435,6 @@ export default {
methods: {
searchData() {
searchData1(this.contractNumValue).then(response => {
console.log(response.data, 222)
for (let j = 0; j < response.data.length; j++) {
response.data[j].物料计划到货时间 = (response.data[j].物料计划到货时间).split(' ')[0]
}

View File

@@ -182,9 +182,9 @@
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="求购重量" align="center">
<el-table-column label="成品尺寸(长、宽、高)" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.重量1" size="mini" style="width:120px" @change="saveWeight(scope.$index, scope.row)"/>
<el-input v-model="scope.row.成品尺寸" size="mini" style="width:120px" @change="saveWeight(scope.$index, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="单价" align="center" >
@@ -368,7 +368,7 @@
</div>
</el-dialog>
<el-card style="width: 1100px;margin: 10px auto">
<div id="cjn" style="width: 1000px;margin: 0 auto">
<div id="WGBLD" style="width: 1000px;margin: 0 auto">
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr>
<th colspan="14"><h3>江苏高精机电装备有限公司</h3></th>
@@ -389,7 +389,7 @@
<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">
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 0px">
<tr id="tablehead" style="height: 35px">
<td style="text-align: center;width: 7%">序号</td>
<td colspan="2" style="text-align: center;width: 20%">图号</td>
@@ -397,7 +397,7 @@
<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 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">
@@ -407,7 +407,7 @@
<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 colspan="2" style="text-align: center;width: 20%">{{ list.成品尺寸 }}</td>
<td style="text-align: center;width: 17%">{{ list.备注1 }}</td>
</tr>
</table>
@@ -423,6 +423,7 @@ import { initPartDrawing, searchPurchasedMaterials, searchPurchaseOrder, searchS
import QRCode from 'qrcode'
import $ from 'jquery'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购计划
data() {
@@ -555,13 +556,7 @@ export default {
}
},
saveWeight(index, row) {
var reg = /^[0-9]*$/
if (!reg.test(row.重量1)) {
this.$message.error('请输入正确的重量')
row.重量1 = ''
} else {
saveWeight(row.采购计划明细流水号, row.重量1, row.备注1, row.单价)
}
saveWeight(row.采购计划明细流水号, row.成品尺寸, row.备注1, row.单价)
},
saveMoney(index, row) {
var reg = /^[0-9]*$/
@@ -569,11 +564,11 @@ export default {
this.$message.error('请输入正确的单价')
row.单价 = ''
} else {
saveWeight(row.采购计划明细流水号, row.重量1, row.备注1, row.单价)
saveWeight(row.采购计划明细流水号, row.成品尺寸, row.备注1, row.单价)
}
},
saveRemarks(index, row) {
saveWeight(row.采购计划明细流水号, row.重量1, row.备注1, row.单价)
saveWeight(row.采购计划明细流水号, row.成品尺寸, row.备注1, row.单价)
},
// ///////////////////////////////////////////////////////////////////////////////////////0529新加↑
useqrcode(contractNum) {
@@ -777,7 +772,6 @@ export default {
this.计划完成日期 = row.计划完成日期.split(' ')[0]
this.下单日期 = row.下单日期.split(' ')[0]
searchMateriel(this.purchasingOrderNumber).then(response => {
console.log(response.data)
this.tableData3 = response.data
})
},
@@ -863,7 +857,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const htmlNode = $('#cjn').html()
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)

View File

@@ -0,0 +1,499 @@
<template>
<div>
<el-card>
<div>
<span>采购单号:</span>
<el-input v-model="purchasingOrder" placeholder="采购单号" size="small" style="margin: 3px 0" clearable/>
<span style="margin-left: 10px">供应商:</span>
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
<el-tooltip :open-delay="1200" effect="dark" content="查询采购单" placement="top">
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
</el-tooltip>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入原材料</el-button>
</div>
<el-table v-loading="" :data="tableData2" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
<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="170">
<template slot-scope="scope">
{{ scope.row.采购单名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="250" show-overflow-tooltip>
<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" width="100">
<template slot-scope="scope">
{{ scope.row.下单日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="计划完成日期" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.计划完成日期.split(' ')[0] }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
<el-table v-loading="" :data="tableData3" border highlight-current-row stripe style="margin: 3px 0" height="200px" size="mini" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="物料编码" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.物料零件编码 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="材料" align="center" >
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="成品尺寸(长、宽、高)" align="center">
<template slot-scope="scope">
{{ scope.row.成品尺寸 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" >
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注1 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<div>
<span>采购单号:</span>
<el-input v-model="purchasingOrder" placeholder="采购单号" size="small" style="margin: 3px 0" clearable/>
<span style="margin-left: 10px">供应商:</span>
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
<el-tooltip :open-delay="1200" effect="dark" content="查询采购单" placement="top">
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent4=1;pageSize4=10;total4=0;searchTable4()">查询</el-button>
</el-tooltip>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addPurchaseOrder">新增到货单</el-button>
</div>
<el-table v-loading="" :data="tableData4" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable5">
<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="170">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="250" show-overflow-tooltip>
<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="250" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="创建日期" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.日期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150" fixed="right">
<template slot-scope="scope">
<el-tooltip effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" icon="el-icon-edit-outline" @click="editPurchaseOrder(scope.row)"/>
</div>
</el-tooltip>
<el-tooltip effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deletePurchaseOrder(scope.row)"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent4"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize4"
:total="total4"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange4"
@current-change="handleCurrentChange4"/>
</div>
<el-table v-loading="" :data="tableData5" border highlight-current-row stripe style="margin: 3px 0" height="200px" size="mini">
<el-table-column label="物料编码" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="材料" align="center" >
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="成品尺寸(长、宽、高)" align="center">
<template slot-scope="scope">
{{ scope.row.成品尺寸 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" >
<template slot-scope="scope">
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注1 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog v-el-drag-dialog :title="title" :visible.sync="dialogVisible" center style="min-height: 300px" width="750px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="材料" prop="材料">
<el-input v-model="form.材料" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="单位">
<el-input v-model="form.单位" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="数量" prop="数量">
<el-input v-model="form.数量" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="金额" prop="金额">
<el-input v-model="form.金额" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注" prop="备注">
<el-input v-model="form.备注" size="small"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
v-show="title==='创建到货单'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitAddPurchaseOrder">确定</el-button>
<el-button
v-show="title==='编辑到货单'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitEditPurchaseOrder">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchPurchaseOrder, searchMateriel, addMateriel, searchArriveOrder, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, searchTable5 } from '@/api/WorkshopProcurement/NewArrivalList.js'
import { mapGetters } from 'vuex'
export default {
data() {
return {
purchasingOrder: '',
supplierName0: '',
arrest: [],
tableData2: [],
total2: 0,
pageCurrent2: 1,
pageSize2: 10,
tableData3: [],
采购计划流水号: '',
tableData4: [],
total4: 0,
pageCurrent4: 1,
pageSize4: 10,
tableData5: [],
到货单流水号: '',
form: {
材料: '',
单位: '',
数量: '',
金额: '',
备注: ''
},
dialogVisible: false,
title: '',
rules: { // 采购表单验证规则
材料: [{ required: true, message: '请填写材料' }],
单位: [{ required: true, message: '请填写单位' }],
数量: [{ required: true, message: '请填写数量' }],
金额: [{ required: true, message: '请填写金额' }],
备注: [{ required: true, message: '请填写备注' }]
},
工艺计划流水号组: [],
采购计划明细流水号组: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.searchTable2()
this.searchTable4()
},
methods: {
searchTable2() { // 查询采购单列表
this.purchasingOrder ? this.check3 = 1 : this.check3 = 0
this.supplierName0 ? this.check4 = 1 : this.check4 = 0
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) { // 采购单列表分页
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) { // 采购单列表分页
this.pageCurrent2 = val
this.searchTable2()
},
searchTable3(row) { // 查询采购计划明细
this.采购计划流水号 = row.采购计划流水号
searchMateriel(this.采购计划流水号).then(response => {
this.tableData3 = response.data
})
},
// 查询到货单
searchTable4() {
searchArriveOrder(this.pageCurrent4, this.pageSize4).then(response => {
this.tableData4 = response.data.rows
this.total4 = response.data.total
})
},
handleSizeChange4(val) { // 采购单列表分页
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange4(val) { // 采购单列表分页
this.pageCurrent2 = val
this.searchTable2()
},
// 创建采购单
addPurchaseOrder() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '创建到货单'
this.form.材料 = ''
this.form.单位 = ''
this.form.数量 = ''
this.form.金额 = ''
this.form.备注 = ''
this.dialogVisible = true
},
// 新增
submitAddPurchaseOrder() {
this.$refs['form'].validate((valid) => {
if (valid) {
addPurchaseOrder(this.form.材料, this.form.单位, this.form.数量, this.form.金额, this.form.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新建到货单成功')
this.pageCurrent4 = 1
this.pageSize4 = 10
this.searchTable4()
this.dialogVisible = false
} else { this.$message.error('新建到货单失败') }
})
} else {
return false
}
})
},
// 编辑
editPurchaseOrder(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑到货单'
this.form.材料 = row.材料
this.form.单位 = row.单位
this.form.数量 = row.数量
this.form.金额 = row.金额
this.form.备注 = row.备注
this.dialogVisible = true
},
submitEditPurchaseOrder() {
this.$refs['form'].validate((valid) => {
if (valid) {
editPurchaseOrder(this.form.材料, this.form.单位, this.form.数量, this.form.金额, this.form.备注, this.到货单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改到货单成功')
this.searchTable4()
this.dialogVisible = false
} else { this.$message.error('修改到货单失败') }
})
} else {
return false
}
})
},
deletePurchaseOrder(row) { // 删除采购单
this.$confirm('确定删除该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deletePurchaseOrder(row.到货单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable4()
} else { this.$message.error('数据占用,删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable5(row) {
this.到货单流水号 = row.到货单流水号
searchTable5(this.到货单流水号).then(response => {
this.tableData5 = response.data
})
},
handleSelectionChange(val) {
this.arrest = val
},
// 选入
addMateriel() {
if (!this.到货单流水号) {
this.$message.warning('请选择到货单')
} else if (this.arrest.length === 0) {
this.$message.warning('请勾选原材料')
} else {
this.工艺计划流水号组 = []
this.采购计划明细流水号组 = []
this.arrest.map(v => {
this.工艺计划流水号组.push(v.工艺计划流水号)
this.采购计划明细流水号组.push(v.采购计划明细流水号)
})
addMateriel(this.到货单流水号, this.工艺计划流水号组, this.采购计划明细流水号组).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
searchMateriel(this.采购计划流水号).then(response => {
this.tableData3 = response.data
})
searchTable5(this.到货单流水号).then(response => {
this.tableData5 = response.data
})
} else { this.$message.error('选入失败') }
})
}
}
}
}
</script>
<style scoped>
.offlineContract td{
height: 40px;
text-align: center;
}
/*.el-card{*/
/* margin-bottom: 15px;*/
/*}*/
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
/*margin: 10px 0 10px 0px;*/
}
.el-tag{
margin: 0
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 5px;
}
</style>

View File

@@ -17,7 +17,7 @@
<span class="svg-container svg-container_login">
<svg-icon icon-class="username" />
</span>
<el-input v-model="loginForm.username" name="username" type="text" auto-complete="on" placeholder="请输入用户名" @input.native="changeUser" />
<el-input v-model="loginForm.username" name="username" type="text" auto-complete="off" placeholder="请输入用户名" @input.native="changeUser" />
</el-form-item>
<el-form-item prop="password">
<span class="svg-container">