Files
JY1.0/src/views/PurchasingCenter/MaterialManagement/index.vue
zhangdingyu fee437d2d5 物料管理
2019-10-12 16:35:29 +08:00

1007 lines
37 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="app-container">
<el-card>
<el-row>
<el-col style="width: 280px;margin-top: 3px">
<span>物料类别:</span>
<el-select
v-model="MaterialCategoryValue"
placeholder="请选择"
size="small"
clearable
@change="searchMaterialVariety">
<el-option
v-for="item in MaterialCategory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 280px;margin-top: 3px">
<span>物料品种:</span>
<el-select
v-model="MaterialVarietyValue"
placeholder="请选择"
size="small"
clearable
@change="searchMaterial">
<el-option
v-for="item in MaterialVariety"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 280px;margin-top: 3px">
<span>物料名称:</span>
<el-input v-model="MaterialName" placeholder="物料名称" size="small" clearable />
</el-col>
<el-col style="width: 280px;margin-top: 3px">
<span>物料全称:</span>
<el-input
v-model="FullNameOfMaterial"
placeholder="物料全称"
size="small"
clearable/>
</el-col>
<el-col style="width: 280px;margin-top: 3px">
<span>物料规格:</span>
<el-input
v-model="MaterialSpecification"
placeholder="物料规格"
size="small"
clearable/>
</el-col>
<el-col style="width: 280px;margin-top: 3px">
<span>物料型号:</span>
<el-input
v-model="MaterialModel"
placeholder="物料型号"
size="small"
clearable/>
</el-col>
<el-col style="width: 280px">
<span>计算单位:</span>
<el-select
v-model="MeasurementUnitValue"
placeholder="请选择"
style="margin-bottom: 3px;margin-top: 10px"
size="small"
clearable>
<el-option
v-for="item in MeasurementUnit"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 280px">
<span>物料来源:</span>
<el-select
v-model="MaterialSourceValue"
placeholder="请选择"
style="margin-bottom: 3px;margin-top: 10px"
size="small"
clearable>
<el-option
v-for="item in MaterialSource"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 280px">
<span style="margin-left: 25px">供货商:</span>
<el-select
v-model="GonghuoshangValue"
placeholder="请选择"
filterable
style="margin-bottom: 3px;margin-top: 10px"
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: 550px">
<el-button
type="success"
icon="el-icon-search"
size="small"
style="margin-left: 10px"
@click="pageCurrent=1;searchMaterial()">查询
</el-button>
<el-button :disabled="token !== 11 && token !== 36" type="primary" style="margin-bottom: 3px;margin-top: 10px" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd()">新增</el-button>
<el-button
:disabled="token !== 11 && token !== 36"
type="warning"
icon="el-icon-refresh"
size="small"
style="margin:10px 5px 3px"
@click="CategoryMaintenance">维护物料类别
</el-button>
<el-button type="primary" style="margin-bottom: 3px;margin-top: 10px" icon="el-icon-circle-plus-outline" size="small" @click="open()">新增供货商</el-button>
<el-badge :value="weishenhe" class="item">
<el-button type="primary" size="small" @click="daishenhe()">待审核</el-button>
</el-badge>
</el-col>
</el-row>
</el-card>
<el-card>
<el-table
:data="tableData"
style="width: 100%;margin-top: 3px"
height="720"
size="mini"
highlight-current-row
border
stripe>
<el-table-column align="center" label="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column align="center" label="参考价格">
<template slot-scope="scope">
{{ scope.row.参考价格 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template slot-scope="scope">
<el-tooltip :open-delay="1000" effect="dark" content="编辑">
<div style="display: inline-block">
<el-button
:disabled="token !== 11 && token !== 36"
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleEdit(scope.row)"/>
</div>
</el-tooltip>
<el-tooltip effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button
:disabled="token !== 11 && token !== 36"
size="mini"
type="text"
style="margin-left: 20px"
icon="el-icon-delete"
@click="handleDelete(scope.row)"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="选择供货商" center width="400px">
<el-input v-model="supplier1" placeholder="供货商" size="small" clearable style="width:200px"/>
<el-button
type="success"
icon="el-icon-search"
size="small"
style="margin-left: 15px; margin-bottom: 10px"
@click="pageCurrent1=1;searchSupplier()">查询
</el-button>
<el-table
:data="tableData1"
size="mini"
highlight-current-row
border
@row-click="selectSupplier">
<el-table-column align="center" label="供货商">
<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]"
:page-size="pageSize1"
:total="total1"
small
layout="sizes, prev, pager, next"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitSupplier">提交</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :title="title" :visible.sync="dialogFormVisible1" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="物料类别" prop="物料类别流水号">
<el-select
v-model="form.物料类别流水号"
style="width:200px"
placeholder="请选择"
size="small"
clearable
@change="searchMaterialVariety1">
<el-option
v-for="item in MaterialCategory1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料品种" prop="物料品种流水号">
<el-select v-model="form.物料品种流水号" style="width:200px" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in MaterialVariety1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物料名称" prop="物料名称">
<el-input v-model="form.物料名称" placeholder="物料名称" size="small" clearable style="width:200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料全名" prop="物料全名">
<el-input v-model="form.物料全名" placeholder="物料全名" size="small" clearable style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物料规格" prop="物料规格">
<el-input v-model="form.物料规格" placeholder="物料规格" size="small" clearable style="width:200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料型号" prop="物料型号">
<el-input v-model="form.物料型号" placeholder="物料型号" size="small" clearable style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="计量单位" prop="计量单位流水号">
<el-select v-model="form.计量单位流水号" style="width:200px" placeholder="请选择" size="small">
<el-option
v-for="item in MeasurementUnit"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料来源" prop="物料来源流水号">
<el-select v-model="form.物料来源流水号" style="width:200px" placeholder="请选择" size="small">
<el-option
v-for="item in MaterialSource"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="供货商" prop="GonghuoshangValue">
<el-select
v-model="form.GonghuoshangValue"
placeholder="请选择"
filterable
style="width:200px"
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">
<el-form-item label="常用符号">
Φ × μ δ ±
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel('form')">取消</el-button>
<el-button v-show="title==='增加'" type="primary" @click="submitAdd('form')">确定</el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="物料类别维护" center width="1200px">
<div style="width: 47%;display: inline-block">
<el-card>
<span>物料类别:</span>
<el-input v-model="MaterialCategory2" placeholder="物料类别" size="mini" clearable style="width:100px"/>
<span>类别编号:</span>
<el-input v-model="CategoryNumber" placeholder="类别编号" size="mini" clearable style="width:100px"/>
<el-button type="primary" size="mini" style="margin-left: 10px" @click="handleAdd1">增加</el-button>
<el-button type="warning" size="mini" @click="handleEdit1">编辑</el-button>
<br>
</el-card>
<el-card>
<el-table
:data="tableData2"
size="mini"
height="328"
highlight-current-row
border
@row-click="selectMaterialCategory">
<el-table-column align="center" label="物料类别">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column align="center" label="类别编号">
<template slot-scope="scope">
{{ scope.row.类别编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="ID">
<template slot-scope="scope">
{{ scope.row.物料类别ID }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="handleDelete1(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<div style="width: 49%;display: inline-block;margin-left: 20px">
<el-card>
<span>品种编号:</span>
<el-input v-model="VarietyNumber" placeholder="品种编号" size="mini" clearable style="width:100px"/>
<span>物料品种:</span>
<el-input v-model="MaterialVariety2" placeholder="物料品种" size="mini" clearable style="width:100px"/>
<span>规格1:</span>
<el-input v-model="Specifications1" placeholder="规格1" size="mini" clearable style="width:100px"/>
<br>
<span style="margin-left: 30px">规格2:</span>
<el-input v-model="Specifications2" placeholder="规格2" size="mini" clearable style="width:100px"/>
<el-button type="primary" size="mini" style="margin-left: 10px" @click="handleAdd2">增加</el-button>
<el-button type="warning" size="mini" @click="handleEdit2">编辑</el-button>
</el-card>
<el-card>
<el-table
:data="tableData3"
size="mini"
height="300"
highlight-current-row
border
@row-click="selectMaterialVariety">
<el-table-column align="center" label="品种编号">
<template slot-scope="scope">
{{ scope.row.品种编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料品种">
<template slot-scope="scope">
{{ scope.row.物料品种 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格1">
<template slot-scope="scope">
{{ scope.row.规格1 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格2">
<template slot-scope="scope">
{{ scope.row.规格2 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="handleDelete2(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible3" title="新增供应商" center style="min-height: 300px" width="400px">
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="供货商名称" prop="供货商名称">
<el-input v-model="form3.供货商名称" placeholder="供货商名称" size="small" clearable style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3=false">取消</el-button>
<el-button type="primary" @click="AddGonghuoshang('form3')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible4" title="采购部申请物料" center style="min-height: 300px" width="700px">
<el-form>
<el-table
:data="tableData5"
style="width: 100%;margin-top: 3px"
height="300"
size="mini"
highlight-current-row
border
stripe>
<el-table-column align="center" label="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料规格">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料型号">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="供货商">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template slot-scope="scope">
<div style="display: inline-block">
<el-button type="primary" size="small" @click="Tongguo(scope.row)">通过</el-button>
</div>
<div style="display: inline-block">
<el-popover
placement="bottom"
width="400"
trigger="click">
<span>打回原因</span>
<el-input v-model="打回原因" placeholder="打回原因" size="small" clearable/>
<el-button type="danger" size="small" @click="queren()">确认</el-button>
<el-button slot="reference" type="danger" size="small" @click="Dahui(scope.row)">打回</el-button>
</el-popover>
</div>
</template>
</el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible4=false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getSupplier1,
AddGonghuoshang,
initDepartmentName,
initMaterialCategory,
initMaterialVariety,
initMeasurementUnit,
initMaterialSource,
searchmaterial,
getSupplier,
addData,
editData,
deleteData,
searchCategory,
searchVarieties,
editCategory,
addCategory,
deleteCategory,
editVariety,
addVariety,
deleteVariety,
getMaterial,
searchmateria5,
Dahui,
Tongguo
} from '@/api/PurchasingCenter/MaterialManagement'
import { mapGetters } from 'vuex'
export default {
data() {
return {
打回原因: '',
物料流水号: '',
tableData5: [],
dialogFormVisible4: false,
weishenhe: 0,
Gonghuoshang: [],
Gonghuoshang2: [],
GonghuoshangValue: '',
form3: {
供货商名称: ''
},
rules3: {
供货商名称: [{ required: true, message: '请输入供货商名称', trigger: 'blur' }]
},
dialogFormVisible3: false,
DepartmentValue: '', // 部门名称
Department: [], // 部门数组
MaterialCategoryValue: '', // 物料类别
MaterialCategory: [], // 物料类别数组
MaterialVarietyValue: '', // 物料品种
MaterialVariety: [], // 物料品种数组
MaterialName: '', // 物料名称
FullNameOfMaterial: '', // 物料全称
MaterialSpecification: '', // 物料规格
MaterialModel: '', // 物料型号
MeasurementUnitValue: '', // 计量单位
MeasurementUnit: [], // 计量单位数组
MaterialSourceValue: '', // 物料来源
MaterialSource: [], // 物料来源数组
supplier: '', // 供货商
supplier1: '', // 供货商(弹框)
supplierValue: '', // 供货商流水号
ReferencePrice: '', // 参考价格
supplierValue1: '',
MaterialCategory1: [],
MaterialVariety1: [],
MaterialCategory2: '', // 物料类别
CategoryNumber: '', // 类别编号
VarietyNumber: '', // 品种编号
MaterialVariety2: '', // 物料品种
Specifications1: '', // 规格1
Specifications2: '', // 规格2
MaterialCategoryNum: '', // 物料类别流水号
MaterialVarietyNum: '', // 物料品种流水号
param: 0,
tableData: [],
pageCurrent: 1,
pageSize: 30,
total: null,
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: null,
tableData2: [],
tableData3: [],
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
check1: '',
check2: '',
check3: '',
check4: '',
check5: '',
check6: '',
check7: '',
check8: '',
check9: '',
check10: '',
title: '',
form: {
物料流水号: '',
物料类别流水号: '',
物料品种流水号: '',
物料名称: '',
物料全名: '',
物料规格: '',
物料型号: '',
计量单位流水号: '',
物料来源流水号: '',
GonghuoshangValue: ''
},
rules: {
物料名称: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
GonghuoshangValue: [{ required: true, message: '请选择供货商', trigger: 'change' }],
物料类别流水号: [{ required: true, message: '请选择物料类别', trigger: 'change' }],
物料品种流水号: [{ required: true, message: '请选择物料品种', trigger: 'change' }],
计量单位流水号: [{ required: true, message: '请选择计量单位', trigger: 'change' }],
物料来源流水号: [{ required: true, message: '请选择物料来源', trigger: 'change' }]
}
}
},
computed: {
...mapGetters([
'name',
'id',
'token'
])
},
created() {
this.getMaterial()
this.fetchData()
this.searchMaterialCategory()
this.getGonghuoshang()
},
methods: {
// 通过
Tongguo(row) {
this.$confirm('通过该物料, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
Tongguo(row.物料流水号).then(response => {
if (response.data[0].result === '1') {
this.getMaterial()
this.daishenhe()
this.searchMaterial()
this.$message.success('通过成功')
} else { this.$message.error('通过失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消通过'
})
})
},
// 打回
Dahui(row) {
this.物料流水号 = row.物料流水号
},
// 打回确认
queren() {
Dahui(this.物料流水号, this.打回原因).then(response => {
if (response.data[0].result === '1') {
this.getMaterial()
this.daishenhe()
this.$message.success('打回成功')
} else { this.$message.error('打回失败') }
})
},
// 查询采购部物料申请明细
daishenhe() {
this.tableData5 = []
searchmateria5(0, 0, 0, 0, 0, 0, 0, 0, 1, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).then(response => {
this.tableData5 = response.data.result
this.dialogFormVisible4 = true
})
},
// 查询待审核物料数量
getMaterial() {
getMaterial().then(response => {
this.weishenhe = response.data[0].数量
})
},
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()
}
this.form3.供货商名称 = ''
this.dialogFormVisible3 = true
},
AddGonghuoshang(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
AddGonghuoshang(this.form3.供货商名称).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.dialogFormVisible3 = false
} else {
this.dialogFormVisible3 = false
this.$message.error('添加失败')
}
})
}
})
},
fetchData() {
this.getSelect(initDepartmentName, ['物料部门名称', '物料部门流水号'], 'Department') // 物料部门
this.getSelect(initMeasurementUnit, ['计量单位', '计量单位流水号'], 'MeasurementUnit') // 计量单位
this.getSelect(initMaterialSource, ['物料来源', '物料来源流水号'], 'MaterialSource') // 物料来源
},
searchMaterialCategory() { // 获取物料类别
this.MaterialCategory = []
this.MaterialVariety = []
this.MaterialCategoryValue = ''
this.MaterialVarietyValue = ''
this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory', [0, this.DepartmentValue])
},
searchMaterialVariety() { // 初始化物料品种
this.MaterialVariety = []
this.MaterialVarietyValue = ''
this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety', this.MaterialCategoryValue)
},
searchMaterial() { // 物料查询
this.MaterialName !== '' ? this.check1 = 1 : this.check1 = 0 // 物料名称
this.FullNameOfMaterial !== '' ? this.check2 = 1 : this.check2 = 0 // 物料全称
this.MaterialSpecification !== '' ? this.check3 = 1 : this.check3 = 0 // 物料规格
this.MaterialModel !== '' ? this.check4 = 1 : this.check4 = 0 // 物料型号
this.MaterialCategoryValue !== '' ? this.check5 = 1 : this.check5 = 0 // 物料类别
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.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)
})
},
openSupplier() {
this.dialogFormVisible = true
this.supplier1 = ''
this.check10 = 0
this.pageCurrent1 = 1
this.pageSize1 = 10
this.getTable(getSupplier, [this.check10, this.supplier1, this.pageCurrent1, this.pageSize1], ['tableData1', 'total1'])
},
searchSupplier() {
this.supplier1 !== '' ? this.check10 = 1 : this.check10 = 0
this.getTable(getSupplier, [this.check10, this.supplier1, this.pageCurrent1, this.pageSize1], ['tableData1', 'total1'])
},
selectSupplier(row) {
if (this.param === 0) {
this.supplierValue = row.供货商流水号
} else if (this.param === 1) {
this.supplierValue1 = row.供货商流水号
}
this.supplier1 = row.供货商
},
submitSupplier() {
if (this.param === 0) {
this.supplier = this.supplier1
} else if (this.param === 1) {
this.form.供货商 = this.supplier1
}
this.dialogFormVisible = false
},
cancel() { // 取消
this.dialogFormVisible1 = false
},
searchMaterialVariety1() { // 物料品种
this.MaterialVariety1 = []
this.form.物料品种流水号 = ''
this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety1', this.form.物料类别流水号)
},
handleEdit(row) {
this.supplierValue1 = ''
this.MaterialCategory1 = []
this.MaterialVariety1 = []
this.supplierValue1 = row.供货商流水号
this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory1')
this.getSelect(initMaterialVariety, ['物料品种', '物料品种流水号'], 'MaterialVariety1', row.物料类别流水号)
this.editForm(row, 'form', [this.title = '编辑', this.dialogFormVisible1 = true])
},
submitEdit() {
this.editTable(editData, [this.form.物料流水号, this.form.物料品种流水号, this.form.物料名称, this.form.物料全名, this.form.物料规格, this.form.物料型号, this.form.计量单位流水号, this.form.物料来源流水号, this.form.GonghuoshangValue], 'form', function() {
this.searchMaterial()
this.dialogFormVisible1 = false
})
},
handleAdd() {
this.supplierValue1 = ''
this.MaterialCategory1 = []
this.MaterialVariety1 = []
this.getSelect(initMaterialCategory, ['物料类别', '物料类别流水号'], 'MaterialCategory1')
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.form.GonghuoshangValue], 'form', function() {
this.dialogFormVisible1 = false
this.searchMaterial()
})
},
handleDelete(row) { // 删除
this.deleteRow(deleteData, row.物料流水号, function() {
this.searchMaterial()
})
},
CategoryMaintenance() {
this.dialogFormVisible2 = true
this.getData(searchCategory, 'tableData2')
},
selectMaterialCategory(row) {
this.MaterialCategory2 = row.物料类别
this.CategoryNumber = row.类别编号
this.MaterialCategoryNum = row.物料类别流水号
this.getData(searchVarieties, 'tableData3', row.物料类别流水号)
},
selectMaterialVariety(row) {
this.MaterialVarietyNum = row.物料品种流水号
this.VarietyNumber = row.品种编号
this.MaterialVariety2 = row.物料品种
this.Specifications1 = row.规格1
this.Specifications2 = row.规格2
},
handleEdit1() {
editCategory(this.MaterialCategoryNum, this.MaterialCategory2, this.CategoryNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.getData(searchCategory, 'tableData2')
this.tableData3 = []
} else {
this.$message.error('编辑失败')
}
})
},
handleAdd1() {
addCategory(this.MaterialCategory2, this.CategoryNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.getData(searchCategory, 'tableData2')
this.tableData3 = []
} else {
this.$message.error('增加失败')
}
})
},
handleDelete1(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteCategory(row.物料类别流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getData(searchCategory, 'tableData2')
this.tableData3 = []
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleEdit2() {
editVariety(this.MaterialVarietyNum, this.MaterialCategoryNum, this.MaterialVariety2, this.VarietyNumber, this.Specifications1, this.Specifications2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.getData(searchVarieties, 'tableData3', this.MaterialCategoryNum)
} else {
this.$message.error('编辑失败')
}
})
},
handleAdd2() {
addVariety(this.MaterialCategoryNum, this.MaterialVariety2, this.VarietyNumber, this.Specifications1, this.Specifications2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.getData(searchVarieties, 'tableData3', this.MaterialCategoryNum)
} else {
this.$message.error('增加失败')
}
})
},
handleDelete2(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteVariety(row.物料品种流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getData(searchVarieties, 'tableData3', this.MaterialCategoryNum)
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.searchMaterial()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchMaterial()
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.supplier1 !== '' ? this.check10 = 1 : this.check10 = 0
this.getTable(getSupplier, [this.check10, this.supplier1, this.pageCurrent1, this.pageSize1], ['tableData1', 'total1'])
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.supplier1 !== '' ? this.check10 = 1 : this.check10 = 0
this.getTable(getSupplier, [this.check10, this.supplier1, this.pageCurrent1, this.pageSize1], ['tableData1', 'total1'])
}
}
}
</script>
<style scoped>
span {
margin: 10px 0px 10px 10px;
}
.el-select{
width:190px
}
.el-input{
width:190px
}
</style>