采购任务分配;创建询价单

This commit is contained in:
chenjianan
2018-12-10 16:12:09 +08:00
parent 3cfd0aa067
commit 167a69f685
4 changed files with 781 additions and 359 deletions

View File

@@ -11,7 +11,7 @@ export function initInquiryState() {
} }
}) })
} }
// 根据续表查物料表 // 查询分配后的标准件和外购件
export function searchMaterial(pageCurrent, pageSize, check1, num1, check2, num2, person) { export function searchMaterial(pageCurrent, pageSize, check1, num1, check2, num2, person) {
return request({ return request({
url: '', url: '',
@@ -24,6 +24,19 @@ export function searchMaterial(pageCurrent, pageSize, check1, num1, check2, num2
} }
}) })
} }
// 查询分配后的基本件
export function searchPart(pageCurrent, pageSize, check1, num1, person) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_基本件_分配后',
param: `询价状态编号_check=${check1}&询价状态编号=${num1}&人员编号=${person}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询供应商 // 查询供应商
export function searchSupplier(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, check6, value6, check7, value7, check8, value8, check9, value9, check10, value10, check11, value11, check12, value12) { export function searchSupplier(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, check6, value6, check7, value7, check8, value8, check9, value9, check10, value10, check11, value11, check12, value12) {
return request({ return request({
@@ -69,7 +82,7 @@ export function searchSheetDetail(num2) {
data: { data: {
type: '1', type: '1',
name: '采购管理_询价单明细_查询数据', name: '采购管理_询价单明细_查询数据',
param: '询价单流水号_check=1&询价单流水号=' + num2 param: '询价单流水号=' + num2
} }
}) })
} }
@@ -97,27 +110,39 @@ export function deleteInquirySheet(num1) {
} }
}) })
} }
// 追加现有询价单 // 将标准件和外购件追加现有询价单
export function addInquirySheet(num1, num2, num3, num4, remark) { export function addInquirySheet1(num1, num2, num3) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_询价单明细_增加数据', name: '采购管理_询价单明细_增加数据',
param: '询价单流水号=' + num1 + '&组件零件流水号=' + num2 + '&数量=' + num3 + '&备量=' + num4 + '&备注=' + remark + '&identity=1=output' param: '询价单流水号=' + num1 + '&组件零件流水号=' + num2 + '&数量=' + num3
}
})
}
// 将基本件追加现有询价单
export function addInquirySheet2(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_询价单明细_增加数据',
param: '询价单流水号=' + num1 + '&组件零件基本件流水号=' + num2 + '&数量=' + num3
} }
}) })
} }
// 移出询价单 // 移出询价单
export function outInquirySheet(num1, num2) { export function outInquirySheet(num1, num2, num3) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '采购管理_询价单明细_删除数据', name: '采购管理_询价单明细_删除数据',
param: '询价单流水号=' + num1 + '&组件零件流水号=' + num2 param: '询价单明细流水号=' + num1 + '&组件零件流水号=' + num2 + '&组件零件基本件流水号=' + num3
} }
}) })
} }

View File

@@ -46,7 +46,7 @@ export function initBuyer() {
} }
}) })
} }
// 查询表1 // 查询表1标准件和外购件
export function searchTable1(...params) { export function searchTable1(...params) {
return request({ return request({
url: '', url: '',
@@ -59,8 +59,21 @@ export function searchTable1(...params) {
} }
}) })
} }
// 分配任务 // 查询表1基本件
export function allocateTask(group, person) { export function searchTable2(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_基本件',
param: `项目流水号_check=${params[2]}&项目流水号=${params[3]}&分配状态=${params[4]}`,
Pagination: params[0] + '&' + params[1]
}
})
}
// 分配任务1标准件和外购件
export function allocateTask1(group, person) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
@@ -70,8 +83,21 @@ export function allocateTask(group, person) {
param: `标准件和外购件流水号组=${group}&人员编号=${person}` param: `标准件和外购件流水号组=${group}&人员编号=${person}`
} }
}) })
}// 执行退回 }
export function executeReturn(...params) { // 分配任务2基本件
export function allocateTask2(group, person) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购部采购_分配任务_基本件',
param: `基本件流水号组=${group}&人员编号=${person}`
}
})
}
// 执行退回1标准件和外购件
export function executeReturn1(...params) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
@@ -82,3 +108,15 @@ export function executeReturn(...params) {
} }
}) })
} }
// 执行退回1基本件
export function executeReturn2(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购部采购_退回物料_基本件',
param: `基本件流水号组=${params[0]}&组件零件基本件流水号组=${params[1]}`
}
})
}

View File

@@ -1,102 +1,214 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-tabs type="border-card" @tab-click="searchTable11();searchTable12()">
<span>询价状态:</span> <el-tab-pane label="标准件和外购件">
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable> <el-row style="margin-bottom: 10px">
<el-option <span>询价状态:</span>
v-for="item in inquiryState" <el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
:key="item.value" <el-option
:label="item.label" v-for="item in inquiryState"
:value="item.value"/> :key="item.value"
</el-select> :label="item.label"
<span>物料名称:</span> :value="item.value"/>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/> </el-select>
<el-button <span>物料名称:</span>
type="success" <el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
size="small" <el-button
icon="el-icon-search" type="success"
style="margin-left: 10px" size="small"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button> icon="el-icon-search"
</el-card> style="margin-left: 10px"
@click="pageCurrent11=1;pageSize11=10;total11=0;searchTable11()">查询</el-button>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData11"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" 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.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="物料类别" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column label="物料品种" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</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="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<el-pagination
:current-page="pageCurrent11"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize11"
:total="total11"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange11"
@current-change="handleCurrentChange11"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件">
<el-row style="margin-bottom: 10px">
<span>询价状态:</span>
<el-select v-model="inquiryStateValue" placeholder="询价状态" size="small" clearable>
<el-option
v-for="item in inquiryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent12=1;pageSize12=10;total12=0;searchTable12()">查询</el-button>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData12"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="partChange(scope.row)">零件变更</el-button>
</template>
</el-table-column>
<el-table-column label="零件状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" 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.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
</el-table-column>
<el-table-column label="材料" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<el-pagination
:current-page="pageCurrent12"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize12"
:total="total12"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange12"
@current-change="handleCurrentChange12"/>
</div>
</el-tab-pane>
</el-tabs>
<el-card> <el-card style="margin-top: 15px">
<el-table
v-loading=""
:data="tableData1"
:row-class-name="tableRowClassName"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" 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.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="supplier">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="计划到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="库存量" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.库存量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<span>询价单号:</span> <span>询价单号:</span>
<el-input v-model="inquirySheetNum" placeholder="询价单号" size="small" clearable/> <el-input v-model="inquirySheetNum" placeholder="询价单号" size="small" clearable/>
<span>供应商:</span> <span>供应商:</span>
@@ -168,24 +280,24 @@
@current-change="handleCurrentChange2"/> @current-change="handleCurrentChange2"/>
</div> </div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini"> <el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="物料名称" align="center" min-width="150"> <el-table-column label="图号" align="center" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料名称 }} {{ scope.row.组件零件流水号 ? scope.row.物料型号 : scope.row.零件图号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料规格" align="center" min-width="100"> <el-table-column label="名称" align="center" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料规格 }} {{ scope.row.组件零件流水号 ? scope.row.物料名称 : scope.row.零件名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料型号" align="center" min-width="200"> <el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料型号 }} {{ scope.row.组件零件流水号 ? scope.row.物料规格 : scope.row.规格 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="零件数量" align="center" min-width="100"> <el-table-column label="数量" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.零件数量 }} {{ scope.row.数量 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="询价单编号" align="center" min-width="70"> <el-table-column label="询价单编号" align="center" min-width="70">
@@ -312,7 +424,7 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<el-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="400px"> <el-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 ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px">
<el-form-item label="询价单号" prop="inquirySheetNum"> <el-form-item label="询价单号" prop="inquirySheetNum">
<el-input v-model="form2.inquirySheetNum" size="small"/> <el-input v-model="form2.inquirySheetNum" size="small"/>
@@ -379,8 +491,8 @@
</template> </template>
<script> <script>
import { searchMaterial, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet, import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet, outInquirySheet, searchAllMaterial, materialChange } from '@/api/PurchasingCenter/CreateInquirySheet' createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@@ -400,10 +512,14 @@ export default {
value: 3 value: 3
}], }],
materialName: '', materialName: '',
tableData1: [], // 采购任务单明细 tableData11: [], // 标准件和外购件列表
total1: 0, total11: 0,
pageCurrent1: 1, pageCurrent11: 1,
pageSize1: 10, pageSize11: 10,
tableData12: [], // 基本件列表
total12: 0,
pageCurrent12: 1,
pageSize12: 10,
supplierFilters: [{ text: '', value: '' }], supplierFilters: [{ text: '', value: '' }],
tableData2: [], // 询价单列表 tableData2: [], // 询价单列表
total2: 0, total2: 0,
@@ -439,7 +555,7 @@ export default {
openingBank: '', // 开户行 openingBank: '', // 开户行
phone: '', // 电话号码 phone: '', // 电话号码
fax: '', // 传真 fax: '', // 传真
tableData01: [], tableData01: [], // 供应商
dialogVisible2: false, dialogVisible2: false,
form2: { form2: {
inquirySheetNumValue: '', // 询价单流水号 inquirySheetNumValue: '', // 询价单流水号
@@ -452,6 +568,7 @@ export default {
supplierName: [{ required: true, message: '请选择供应商' }] supplierName: [{ required: true, message: '请选择供应商' }]
}, },
groupPartNum: [], // 组件零件流水号 groupPartNum: [], // 组件零件流水号
groupPartBasicNum: [], // 组件零件基本件流水号
allNum: [], // 总数量 allNum: [], // 总数量
dialogVisible3: false, dialogVisible3: false,
materialName0: '', materialName0: '',
@@ -476,34 +593,50 @@ export default {
]) ])
}, },
created() { created() {
this.fetchData() this.searchTable11() // 查表1
this.searchTable2() // 查表2
}, },
methods: { methods: {
fetchData() {
},
selectable(row, index) { // 控制某行是否可选 selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改 return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
}, },
filterHandler(value, row) { // 筛选供货商 filterHandler(value, row) { // 筛选供货商
return row['供货商'] === value return row['供货商'] === value
}, },
searchTable1() { // 查询物料列表 searchTable11() { // 查询标准件和外购件列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0 this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
this.materialName ? this.check2 = 1 : this.check2 = 0 this.materialName ? this.check2 = 1 : this.check2 = 0
searchMaterial(this.pageCurrent1, this.pageSize1, this.check1, this.inquiryStateValue, this.check2, this.materialName, this.id).then(response => { searchMaterial(this.pageCurrent11, this.pageSize11, this.check1, this.inquiryStateValue, this.check2, this.materialName, this.id).then(response => {
this.tableData1 = response.data.rows this.tableData11 = response.data.rows
console.log(response.data.rows) console.log(response.data.rows)
this.total1 = response.data.total this.total11 = response.data.total
}) })
}, },
handleSizeChange1(val) { // 物料列表分页 handleSizeChange11(val) { // 标准件和外购件列表分页
this.pageSize1 = val this.pageSize11 = val
this.pageCurrent1 = 1 this.pageCurrent11 = 1
this.searchTable1() this.searchTable11()
}, },
handleCurrentChange1(val) { // 物料列表分页 handleCurrentChange11(val) { // 标准件和外购件列表分页
this.pageCurrent1 = val this.pageCurrent11 = val
this.searchTable1() this.searchTable11()
},
searchTable12() { // 查询基本件列表
this.inquiryStateValue !== '' && this.inquiryStateValue !== null ? this.check1 = 1 : this.check1 = 0
searchPart(this.pageCurrent12, this.pageSize12, this.check1, this.inquiryStateValue, this.id).then(response => {
this.tableData12 = response.data.rows
console.log(response.data.rows)
this.total12 = response.data.total
})
},
handleSizeChange12(val) { // 基本件列表分页
this.pageSize12 = val
this.pageCurrent12 = 1
this.searchTable12()
},
handleCurrentChange12(val) { // 基本件列表分页
this.pageCurrent12 = val
this.searchTable12()
}, },
searchTable2() { // 查询询价单列表 searchTable2() { // 查询询价单列表
this.supplierName ? this.check3 = 1 : this.check3 = 0 this.supplierName ? this.check3 = 1 : this.check3 = 0
@@ -522,14 +655,14 @@ export default {
this.searchTable2() this.searchTable2()
}, },
createInquirySheet() { // 创建空单据--询价单 createInquirySheet() { // 创建空单据--询价单
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.title2 = '创建询价单' this.title2 = '创建询价单'
this.form2.inquirySheetNum = '' this.form2.inquirySheetNum = ''
this.form2.supplierValue = '' this.form2.supplierValue = ''
this.form2.supplierName = '' this.form2.supplierName = ''
this.dialogVisible2 = true this.dialogVisible2 = true
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
}, },
submitCreateInquirySheet() { // 提交创建询价单 submitCreateInquirySheet() { // 提交创建询价单
this.$refs['form2'].validate((valid) => { this.$refs['form2'].validate((valid) => {
@@ -573,7 +706,6 @@ export default {
this.inquirySheetNum = '' this.inquirySheetNum = ''
this.supplierName = '' this.supplierName = ''
this.supplierValue = '' this.supplierValue = ''
this.searchTable1()
this.searchTable2() this.searchTable2()
} else { this.$message.error('删除失败') } } else { this.$message.error('删除失败') }
}) })
@@ -633,19 +765,19 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
import('@/vendor/Export2Excelcjn').then(excel => { // import('@/vendor/Export2Excelcjn').then(excel => {
const tHeader = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '数量', '单价', '备注'] // 表头内容 // const tHeader = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '数量', '单价', '备注'] // 表头内容
const filterVal = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '零件数量'] // tableData3里的属性名 // const filterVal = ['询价单编号', '供应商名称', '物料名称', '物料规格', '物料型号', '零件数量'] // tableData3里的属性名
const list = this.tableData3 // const list = this.tableData3
const data = list.map(v => filterVal.map(j => v[j])) // const data = list.map(v => filterVal.map(j => v[j]))
excel.export_json_to_excel({ // excel.export_json_to_excel({
header: tHeader, // header: tHeader,
data, // data,
filename: row.询价单编号 + '_' + row.供应商名称, // filename: row.询价单编号 + '_' + row.供应商名称,
autoWidth: true, // autoWidth: true,
bookType: 'xlsx' // bookType: 'xlsx'
}) // })
}) // })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
@@ -653,8 +785,7 @@ export default {
}) })
}) })
}, },
handleSelectionChange(val) { // 表1多选 handleSelectionChange1(val) { // 标准件和外购件多选
console.log(val)
this.groupPartNum = [] this.groupPartNum = []
this.allNum = [] this.allNum = []
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
@@ -662,50 +793,90 @@ export default {
this.allNum[i] = val[i].零件数量 this.allNum[i] = val[i].零件数量
} }
}, },
handleSelectionChange2(val) { // 基本件多选
this.groupPartBasicNum = []
this.allNum = []
for (let i = 0; i < val.length; i++) {
this.groupPartBasicNum[i] = val[i].组件零件基本件流水号
this.allNum[i] = val[i].数量
}
},
addInquirySheet() { // 追加物料 addInquirySheet() { // 追加物料
const numGroup2 = [] // 空数组,放该询价单中已有的物料 const numGroup1 = [] // 空数组,放该询价单中已有的组件零件流水号
const numGroup2 = [] // 空数组,放该询价单中已有的组件零件基本件流水号
if (this.inquirySheetNum === '' || this.inquirySheetNum === null) { if (this.inquirySheetNum === '' || this.inquirySheetNum === null) {
this.$message.error('请选择一个询价单') this.$message.error('请选择一个询价单')
} else if (this.groupPartNum.length === 0 && this.groupPartBasicNum.length === 0) {
this.$message.error('请选择待询价物料或零件')
} else { } else {
searchSheetDetail(this.inquirySheetFlowNum).then(response => { searchSheetDetail(this.inquirySheetFlowNum).then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
numGroup2.push(response.data[i].组件零件流水号) numGroup1.push(response.data[i].组件零件流水号)
numGroup2.push(response.data[i].组件零件基本件流水号)
} }
}).then(() => { }).then(() => {
let x = true // 为了只执行一次的中间变量 let x = true // 为了只执行一次的中间变量
for (let i = 0; i < this.groupPartNum.length; i++) { if (this.groupPartBasicNum.length === 0) { // 标准件和外购件
if (numGroup2.indexOf(parseInt(this.groupPartNum[i])) !== -1) { for (let i = 0; i < this.groupPartNum.length; i++) {
if (x) { if (numGroup1.indexOf(parseInt(this.groupPartNum[i])) !== -1) {
this.$notify({ if (x) {
title: '注意', this.$notify({
message: '无法向该询价单中追加重复物料,已自动跳过', title: '注意',
type: 'warning' message: '无法向该询价单中追加重复物料,已自动跳过',
}) type: 'warning'
x = false
}
} else {
addInquirySheet(this.inquirySheetFlowNum, this.groupPartNum[i], this.allNum[i], 0, '').then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
}) })
} else { this.$message.error('操作失败') } x = false
}) }
} else {
addInquirySheet1(this.inquirySheetFlowNum, this.groupPartNum[i], this.allNum[i]).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable11()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('操作失败') }
})
}
}
} else { // 基本件
for (let i = 0; i < this.groupPartBasicNum.length; i++) {
if (numGroup2.indexOf(parseInt(this.groupPartBasicNum[i])) !== -1) {
if (x) {
this.$notify({
title: '注意',
message: '无法向该询价单中追加重复零件,已自动跳过',
type: 'warning'
})
x = false
}
} else {
addInquirySheet2(this.inquirySheetFlowNum, this.groupPartBasicNum[i], this.allNum[i]).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable12()
searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data
})
} else {
this.$message.error('操作失败')
}
})
}
} }
} }
}) })
} }
}, },
outInquirySheet(row) { outInquirySheet(row) {
outInquirySheet(row.询价单流水号, row.组件零件流水号).then(response => { outInquirySheet(row.询价单明细流水号, row.组件零件流水号, row.组件零件基本件流水号).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('操作成功') this.searchTable11()
this.searchTable1() this.searchTable12()
searchSheetDetail(this.inquirySheetFlowNum).then(response => { searchSheetDetail(this.inquirySheetFlowNum).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
}) })
this.$message.success('操作成功')
} else { this.$message.error('操作失败') } } else { this.$message.error('操作失败') }
}) })
}, },
@@ -761,23 +932,23 @@ export default {
submitSelectSupplier() { // 确定选择供应商 submitSelectSupplier() { // 确定选择供应商
this.dialogVisible1 = false this.dialogVisible1 = false
}, },
searchTable3(row) { // 查询该询价单中的物料 searchTable3(row) { // 查询该询价单中的物料和零件
this.tableData3 = [] this.tableData3 = []
this.inquirySheetNum = row.询价单编号
this.inquirySheetFlowNum = row.询价单流水号 this.inquirySheetFlowNum = row.询价单流水号
this.supplierValue = row.供应商流水号
this.supplierName = row.供应商名称
searchSheetDetail(row.询价单流水号).then(response => { searchSheetDetail(row.询价单流水号).then(response => {
this.tableData3 = response.data this.tableData3 = response.data
}) })
}, },
materialChange(row) { // 物料变更 materialChange(row) { // 物料变更 标准件和外购件
this.dialogVisible3 = true this.dialogVisible3 = true
console.log(row)
this.groupPartNumValue = row.组件零件流水号 this.groupPartNumValue = row.组件零件流水号
this.standardAndPurchaseValue = row.标准件和外购件流水号 this.standardAndPurchaseValue = row.标准件和外购件流水号
this.materialOldValue = row.物料流水号 this.materialOldValue = row.物料流水号
}, },
partChange(row) { // 零件变更 基本件
alert('没有基本件库,你想替换啥?')
console.log(row)
},
searchMaterial() { searchMaterial() {
searchAllMaterial(this.materialName0, this.pageCurrent02, this.pageSize02).then(response => { searchAllMaterial(this.materialName0, this.pageCurrent02, this.pageSize02).then(response => {
this.tableData02 = response.data.result this.tableData02 = response.data.result
@@ -802,10 +973,9 @@ export default {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('提交变更申请成功') this.$message.success('提交变更申请成功')
this.dialogVisible3 = false this.dialogVisible3 = false
this.searchTable1() this.searchTable11()
} else { this.$message.error('操作失败') } } else { this.$message.error('操作失败') }
}) })
console.log(this.groupPartNumValue, this.standardAndPurchaseValue, this.materialOldValue, this.materialNewValue)
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
if (parseInt(row.是否确认) === 0) { if (parseInt(row.是否确认) === 0) {

View File

@@ -1,175 +1,292 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="10"> <el-tabs type="border-card" @tab-click="searchTable1();searchTable2()">
<el-col :span="16"> <el-tab-pane label="标准件和外购件">
<el-card> <el-row style="margin-bottom: 10px">
<el-row style="margin-bottom: 10px"> <span style="margin-left: 0">项目名称:</span>
<span style="margin-left: 0">物料类别:</span> <el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable style="width: 170px">
<el-select
v-model="MaterialCategoryValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable
@change="searchMaterialVariety">
<el-option
v-for="item in MaterialCategory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料品种:</span>
<el-select
v-model="MaterialVarietyValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable>
<el-option
v-for="item in MaterialVariety"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" style="width:170px" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
</el-row>
<el-row>
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
</el-card>
</el-col>
<el-col :span="8">
<el-card>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option <el-option
v-for="item in person" v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<el-button <el-button
type="primary" type="success"
size="small" size="small"
icon="el-icon-menu" icon="el-icon-search"
style="margin-left: 10px" style="margin-left: 10px"
@click="allocateTask">分配</el-button> @click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</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>
<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>
</el-row>
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">物料类别:</span>
<el-select
v-model="MaterialCategoryValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable
@change="searchMaterialVariety">
<el-option
v-for="item in MaterialCategory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料品种:</span>
<el-select
v-model="MaterialVarietyValue"
style="width:150px"
placeholder="请选择"
size="small"
clearable>
<el-option
v-for="item in MaterialVariety"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" style="width:170px" size="small" clearable/>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
v-loading=""
:data="tableData1"
size="mini"
style="max-height: 600px"
height="400px"
border
stripe
@selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="项目名称" min-width="150px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料类别" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料品种" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" min-width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商" min-width="100px">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划到货时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
<template slot-scope="scope">
{{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件">
<el-row style="margin-bottom: 10px">
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable style="width: 170px">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分配情况:</span>
<el-select v-model="allocateStateValue" placeholder="分配情况" size="small" style="width: 100px">
<el-option
v-for="item in allocateState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button <el-button
type="danger" type="success"
size="small" size="small"
icon="el-icon-back" icon="el-icon-search"
style="margin-left: 10px" style="margin-left: 10px"
@click="executeReturn">退回</el-button> @click="pageCurrent2=1;pageSize2=20;total2=0;searchTable2()">查询</el-button>
</el-card> <div style="float:right">
</el-col> <span style="margin-left: 0">采购员:</span>
</el-row> <el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
<el-card> v-for="item in person"
<el-table :key="item.value"
v-loading="" :label="item.label"
:data="tableData1" :value="item.value"/>
size="mini" </el-select>
style="max-height: 600px" <el-button
height="600px" type="primary"
border size="small"
stripe icon="el-icon-menu"
@selection-change="handleSelectionChange1"> style="margin-left: 10px"
<el-table-column :selectable="selectable" align="center" type="selection"/> @click="allocateTask2">分配</el-button>
<el-table-column align="center" label="项目名称" min-width="150px"> <el-button
<template slot-scope="scope"> type="danger"
{{ scope.row.项目名称 }} size="small"
</template> icon="el-icon-back"
</el-table-column> style="margin-left: 10px"
<el-table-column align="center" label="物料类别" min-width="100px"> @click="executeReturn2">退回</el-button>
<template slot-scope="scope"> </div>
{{ scope.row.物料类别 }} </el-row>
</template> <el-row style="margin-bottom: 10px">
</el-table-column> <el-table
<el-table-column align="center" label="物料品种" min-width="100px"> v-loading=""
<template slot-scope="scope"> :data="tableData2"
{{ scope.row.物料品种 }} size="mini"
</template> style="max-height: 600px"
</el-table-column> height="400px"
<el-table-column align="center" label="图号" min-width="100px"> border
<template slot-scope="scope"> stripe
{{ scope.row.物料型号 }} @selection-change="handleSelectionChange2">
</template> <el-table-column :selectable="selectable" align="center" type="selection"/>
</el-table-column> <el-table-column align="center" label="项目名称" min-width="150px">
<el-table-column align="center" label="名称" min-width="100px"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.row.项目名称 }}
{{ scope.row.物料名称 }} </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.零件图号 }}
{{ scope.row.物料规格 }} </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="80px"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.row.零件名称 }}
{{ scope.row.零件数量 }} </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.规格 }}
{{ scope.row.备注 }} </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.材料 }}
{{ scope.row.供货商 }} </template>
</template> </el-table-column>
</el-table-column> <el-table-column align="center" label="数量" min-width="80px">
<el-table-column align="center" label="计划到货时间" min-width="100px"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.row.数量 }}
{{ scope.row.物料计划到货时间.split(' ')[0] }} </template>
</template> </el-table-column>
</el-table-column> <el-table-column align="center" label="备注" min-width="100px">
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.row.备注 }}
{{ scope.row.姓名 }} </template>
</template> </el-table-column>
</el-table-column> <el-table-column align="center" label="供货商" min-width="100px">
</el-table> <template slot-scope="scope">
<div class="block" style="margin-top: 10px;"> {{ scope.row.供货商 }}
<el-pagination </template>
:current-page="pageCurrent1" </el-table-column>
:page-sizes="[10, 20, 30, 40]" <el-table-column align="center" label="计划到货时间" min-width="100px">
:page-size="pageSize1" <template slot-scope="scope">
:total="total1" {{ scope.row.物料计划到货时间.split(' ')[0] }}
style="display:inline-block;width:50%" </template>
layout="total, sizes, prev, pager, next, jumper" </el-table-column>
@size-change="handleSizeChange1" <el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
@current-change="handleCurrentChange1"/> <template slot-scope="scope">
</div> {{ scope.row.姓名 ? scope.row.姓名 : '—' }}
</el-card> </template>
</el-table-column>
</el-table>
</el-row>
<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-tab-pane>
</el-tabs>
</div> </div>
</template> </template>
<script> <script>
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchTable1, allocateTask, executeReturn } from '@/api/PurchasingCenter/PurchaseTaskAllocate' import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchTable1, searchTable2, allocateTask1, allocateTask2, executeReturn1, executeReturn2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@@ -205,11 +322,17 @@ export default {
check3: 0, check3: 0,
check4: 0, check4: 0,
tableData1: [], tableData1: [],
tableData2: [],
standardAndPurchase: [], standardAndPurchase: [],
basic: [],
groupAndPart: [], groupAndPart: [],
groupAndPartBasic: [],
pageCurrent1: 1, pageCurrent1: 1,
pageSize1: 20, pageSize1: 20,
total1: 0 total1: 0,
pageCurrent2: 1,
pageSize2: 20,
total2: 0
} }
}, },
computed: { computed: {
@@ -221,8 +344,8 @@ export default {
]) ])
}, },
created() { created() {
this.fetchData() this.searchTable1() // 查表1
this.searchMaterialCategory() this.fetchData() // 初始化数据
}, },
methods: { methods: {
fetchData() { // 初始化 fetchData() { // 初始化
@@ -243,12 +366,6 @@ export default {
}) })
} }
}) })
},
searchMaterialCategory() { // 获取物料类别
this.MaterialCategory = []
this.MaterialVariety = []
this.MaterialCategoryValue = ''
this.MaterialVarietyValue = ''
this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory', [0, this.DepartmentValue]) this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory', [0, this.DepartmentValue])
}, },
searchMaterialVariety() { // 初始化物料品种 searchMaterialVariety() { // 初始化物料品种
@@ -256,7 +373,7 @@ export default {
this.MaterialVarietyValue = '' this.MaterialVarietyValue = ''
this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety', this.MaterialCategoryValue) this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety', this.MaterialCategoryValue)
}, },
searchTable1() { // 查询 searchTable1() { // 查询标准件和外购件
this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0 this.MaterialCategoryValue ? this.check1 = 1 : this.check1 = 0
this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0 this.MaterialVarietyValue ? this.check2 = 1 : this.check2 = 0
this.projectValue ? this.check3 = 1 : this.check3 = 0 this.projectValue ? this.check3 = 1 : this.check3 = 0
@@ -266,7 +383,14 @@ export default {
this.total1 = response.data.total this.total1 = response.data.total
}) })
}, },
handleSelectionChange1(val) { // 多选 searchTable2() { // 查询基本件
this.projectValue ? this.check3 = 1 : this.check3 = 0
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, this.allocateStateValue).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSelectionChange1(val) { // 标准件和外购件多选
this.standardAndPurchase = [] this.standardAndPurchase = []
this.groupAndPart = [] this.groupAndPart = []
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
@@ -274,10 +398,18 @@ export default {
this.groupAndPart.push(val[i].组件零件流水号) this.groupAndPart.push(val[i].组件零件流水号)
} }
}, },
handleSelectionChange2(val) { // 基本件多选
this.basic = []
this.groupAndPartBasic = []
for (let i = 0; i < val.length; i++) {
this.basic.push(val[i].基本件流水号)
this.groupAndPartBasic.push(val[i].组件零件基本件流水号)
}
},
selectable(row) { // 多选禁用 selectable(row) { // 多选禁用
return row.人员编号 === '' || row.人员编号 === null return row.人员编号 === '' || row.人员编号 === null
}, },
allocateTask() { // 分配任务 allocateTask1() { // 标准件和外购件分配任务
if (!this.personValue) { if (!this.personValue) {
this.$message.error('请选择采购员') this.$message.error('请选择采购员')
} else if (this.standardAndPurchase.length === 0) { } else if (this.standardAndPurchase.length === 0) {
@@ -288,7 +420,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
allocateTask(this.standardAndPurchase, this.personValue).then(response => { allocateTask1(this.standardAndPurchase, this.personValue).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('操作成功') this.$message.success('操作成功')
this.searchTable1() this.searchTable1()
@@ -302,6 +434,31 @@ export default {
}) })
} }
}, },
allocateTask2() { // 基本件分配任务
if (!this.personValue) {
this.$message.error('请选择采购员')
} else if (this.basic.length === 0) {
this.$message.error('请选择需分配的零件')
} else {
this.$confirm('此操作执行后不可修改,是否确定分配?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
allocateTask2(this.basic, this.personValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable2()
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
},
filterHandler(value, row) { filterHandler(value, row) {
console.log(row, value) console.log(row, value)
return parseInt(row['人员编号']) === parseInt(value) return parseInt(row['人员编号']) === parseInt(value)
@@ -315,7 +472,16 @@ export default {
this.pageCurrent1 = val this.pageCurrent1 = val
this.searchTable1() this.searchTable1()
}, },
executeReturn() { // 退回 handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
executeReturn1() { // 退回标准件和外购件
if (this.standardAndPurchase.length === 0) { if (this.standardAndPurchase.length === 0) {
this.$message.error('请选择需退回的物料') this.$message.error('请选择需退回的物料')
} else { } else {
@@ -324,7 +490,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
executeReturn(this.standardAndPurchase, this.groupAndPart).then(response => { executeReturn1(this.standardAndPurchase, this.groupAndPart).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('操作成功') this.$message.success('操作成功')
this.searchTable1() this.searchTable1()
@@ -337,6 +503,29 @@ export default {
}) })
}) })
} }
},
executeReturn2() { // 退回基本件
if (this.basic.length === 0) {
this.$message.error('请选择需退回的零件')
} else {
this.$confirm('此操作执行后不可修改,是否确定退回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
executeReturn2(this.basic, this.groupAndPartBasic).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable2()
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
} }
} }
} }