|
@@ -0,0 +1,451 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="物料编码" prop="materialCode">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.materialCode"
|
|
|
+ placeholder="请输入物料编码"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物料名称" prop="materialName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.materialName"
|
|
|
+ placeholder="请输入物料名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="型号" prop="model">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.model"
|
|
|
+ placeholder="请输入型号"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发料方式" prop="issueMethod">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.issueMethod"
|
|
|
+ placeholder="请输入发料方式"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['system:materialInfo:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['system:materialInfo:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['system:materialInfo:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['system:materialInfo:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" style="margin-top: 20px" :data="tableData" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="主键" align="center" prop="id" />
|
|
|
+ <el-table-column label="指导书名称" align="center" prop="title" />
|
|
|
+ <el-table-column label="作业名" align="center" prop="materialName" />
|
|
|
+ <el-table-column label="描述" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-dropdown @command="(command)=>{handleCommand(command, scope.row)}">
|
|
|
+ <el-button type="warning">
|
|
|
+ 操作<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item icon="el-icon-edit" command="catOperationInstruction">查看作业指导书</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-edit" command="handleUpdate">修改</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-delete" command="handleDelete">删除</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改物料信息对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="物料编码" prop="materialCode">
|
|
|
+ <el-input v-model="form.materialCode" placeholder="请输入物料编码" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物料名称" prop="materialName">
|
|
|
+ <el-input v-model="form.materialName" placeholder="请输入物料名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="型号" prop="model">
|
|
|
+ <el-input v-model="form.model" placeholder="请输入型号" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="规格" prop="specification">
|
|
|
+ <el-input v-model="form.specification" placeholder="请输入规格" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="属性" prop="attribute">
|
|
|
+ <el-select
|
|
|
+ v-model="form.attribute"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item,index) in dict.type.wlsx"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位" prop="unit">
|
|
|
+ <el-input v-model="form.unit" placeholder="请输入单位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发料方式" prop="issueMethod">
|
|
|
+ <el-input v-model="form.issueMethod" placeholder="请输入发料方式" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="库存量" prop="stockQuantity">
|
|
|
+ <el-input v-model="form.stockQuantity" placeholder="请输入库存量" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 添加或修改物料信息对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="catOperationInstructionBoolean" width="1500px" append-to-body>
|
|
|
+ <!-- 动态加载组件 -->
|
|
|
+ <component :is="catOperationInstructionCurrentComponent"></component>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="catOperationInstructionBoolean=false">确 定</el-button>
|
|
|
+ <el-button @click="catOperationInstructionBoolean=false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listMaterialInfo, getMaterialInfo, delMaterialInfo, addMaterialInfo, updateMaterialInfo } from "@/api/amichi/materiel/materialInfo";
|
|
|
+import driverInstallation from '@/views/amichi/operationInstruction/page/driverInstallation.vue';
|
|
|
+import excitationStator from '@/views/amichi/operationInstruction/page/excitationStator.vue';
|
|
|
+import statorCore from '@/views/amichi/operationInstruction/page/statorCore.vue';
|
|
|
+import statorPressFit from '@/views/amichi/operationInstruction/page/statorPressFit.vue';
|
|
|
+import StatorWireEmbedding from '@/views/amichi/operationInstruction/page/StatorWireEmbedding.vue';
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "MaterialInfo",
|
|
|
+ dicts: ["wlsx"],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ catOperationInstructionTitle: '',
|
|
|
+ catOperationInstructionCurrentComponent: "", // 默认显示ComponentA
|
|
|
+ catOperationInstructionBoolean:false,
|
|
|
+ tableData: [{
|
|
|
+ id:"1",
|
|
|
+ title: '励磁定子自动绕线工序作业指导书',
|
|
|
+ path: '/excitationStator',
|
|
|
+ }, {
|
|
|
+ id:"3",
|
|
|
+ title: '定子嵌线工序作业指导书',
|
|
|
+ path: '/StatorWireEmbedding',
|
|
|
+ }, {
|
|
|
+ id:"4",
|
|
|
+ title: '驱动片安装工序作业指导书',
|
|
|
+ path: '/driverInstallation',
|
|
|
+ }, {
|
|
|
+ id:"5",
|
|
|
+ title: '定子铁芯焊接作业指导书',
|
|
|
+ path: '/statorCore',
|
|
|
+ }, {
|
|
|
+ id:"6",
|
|
|
+ title: '定子压装工序作业指导书',
|
|
|
+ path: '/statorPressFit',
|
|
|
+ }],
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 物料信息表格数据
|
|
|
+ materialInfoList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ materialCode: null,
|
|
|
+ materialName: null,
|
|
|
+ model: null,
|
|
|
+ specification: null,
|
|
|
+ unit: null,
|
|
|
+ attribute: null,
|
|
|
+ issueMethod: null,
|
|
|
+ stockQuantity: null,
|
|
|
+ createById: null,
|
|
|
+ updateById: null,
|
|
|
+ dataApprovalStatus: null,
|
|
|
+ processKey: null,
|
|
|
+ taskProcessKey: null,
|
|
|
+ taskNodeKey: null
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ materialCode: [
|
|
|
+ { required: true, message: "物料编码不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ materialName: [
|
|
|
+ { required: true, message: "物料名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ unit: [
|
|
|
+ { required: true, message: "单位不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ attribute: [
|
|
|
+ { required: true, message: "属性 0自制 1外购不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ driverInstallation,
|
|
|
+ excitationStator,
|
|
|
+ statorCore,
|
|
|
+ statorPressFit,
|
|
|
+ StatorWireEmbedding,
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleClick(row) {
|
|
|
+ console.log(row);
|
|
|
+ switch (row.title) {
|
|
|
+ case "驱动片安装工序作业指导书":
|
|
|
+ this.catOperationInstructionCurrentComponent = driverInstallation;
|
|
|
+ this.catOperationInstructionBoolean = true;
|
|
|
+ this.catOperationInstructionTitle = '驱动片安装工序作业指导书';
|
|
|
+ break;
|
|
|
+ case "励磁定子自动绕线工序作业指导书":
|
|
|
+ this.catOperationInstructionCurrentComponent = excitationStator;
|
|
|
+ this.catOperationInstructionBoolean = true;
|
|
|
+ console.log("ddddddddddd")
|
|
|
+ this.catOperationInstructionTitle = '励磁定子自动绕线工序作业指导书';
|
|
|
+ break;
|
|
|
+ case "定子铁芯焊接作业指导书":
|
|
|
+ this.catOperationInstructionCurrentComponent = statorCore;
|
|
|
+ this.catOperationInstructionBoolean = true;
|
|
|
+ this.catOperationInstructionTitle = '定子铁芯焊接作业指导书';
|
|
|
+ break;
|
|
|
+ case "定子压装工序作业指导书":
|
|
|
+ this.catOperationInstructionCurrentComponent = statorPressFit;
|
|
|
+ this.catOperationInstructionBoolean = true;
|
|
|
+ this.catOperationInstructionTitle = '驱动片安装工序作业指导书';
|
|
|
+ break;
|
|
|
+ case "定子压装定子嵌线工序作业指导书工序作业指导书":
|
|
|
+ this.catOperationInstructionCurrentComponent = StatorWireEmbedding;
|
|
|
+ this.catOperationInstructionBoolean = true;
|
|
|
+ this.catOperationInstructionTitle = '定子压装定子嵌线工序作业指导书工序作业指导书';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // this.$router.push({
|
|
|
+ // path: row.path
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ //下拉菜单点击事件
|
|
|
+ handleCommand(command, row) {
|
|
|
+ switch (command) {
|
|
|
+ case "handleUpdate":
|
|
|
+ this.handleUpdate(row)
|
|
|
+ break;
|
|
|
+ case "handleDelete":
|
|
|
+ this.handleDelete(row)
|
|
|
+ break;
|
|
|
+ case "catOperationInstruction":
|
|
|
+ this.catOperationInstructionBoolean= true;
|
|
|
+ this.handleClick(row)
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // catOperationInstruction(row){
|
|
|
+ // console.log(row)
|
|
|
+ //
|
|
|
+ // },
|
|
|
+ /** 查询物料信息列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listMaterialInfo(this.queryParams).then(response => {
|
|
|
+ this.materialInfoList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ materialCode: null,
|
|
|
+ materialName: null,
|
|
|
+ model: null,
|
|
|
+ specification: null,
|
|
|
+ unit: null,
|
|
|
+ attribute: null,
|
|
|
+ issueMethod: null,
|
|
|
+ stockQuantity: null,
|
|
|
+ remark: null,
|
|
|
+ createById: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateById: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ delFlag: null,
|
|
|
+ dataApprovalStatus: null,
|
|
|
+ processKey: null,
|
|
|
+ taskProcessKey: null,
|
|
|
+ taskNodeKey: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加物料信息";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getMaterialInfo(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改物料信息";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ this.form.typeOfOperation=1
|
|
|
+ updateMaterialInfo(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.form.typeOfOperation=0
|
|
|
+ addMaterialInfo(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除物料信息编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delMaterialInfo(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('system/materialInfo/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `materialInfo_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|