更新
This commit is contained in:
84
src/views/asrs/goodSpecification/add-or-updata.vue
Normal file
84
src/views/asrs/goodSpecification/add-or-updata.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-31 16:35:40
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="120px">
|
||||
<el-form-item label="产品编码" prop="goodSpecificationCode">
|
||||
<el-input
|
||||
v-model="dataForm.goodSpecificationCode"
|
||||
clearable
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="goodSpecificationName">
|
||||
<el-input
|
||||
v-model="dataForm.goodSpecificationName"
|
||||
clearable
|
||||
placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="需要熟化时间" prop="cureTime">
|
||||
<el-input-number
|
||||
v-model="dataForm.cureTime"
|
||||
controls-position="right"
|
||||
:min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否需要熟化" prop="cure">
|
||||
<el-switch
|
||||
v-model="dataForm.cure"
|
||||
:active-value="1"
|
||||
:inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="deactivate">
|
||||
<el-switch
|
||||
v-model="dataForm.deactivate"
|
||||
:active-value="1"
|
||||
:inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../mixins/basic-add';
|
||||
import { createGoodSpecification, updateGoodSpecification, getGoodSpecification, getCode } from "@/api/asrs/goodSpecification";
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
codeName: 'goodSpecificationCode',
|
||||
createURL: createGoodSpecification,
|
||||
updateURL: updateGoodSpecification,
|
||||
infoURL: getGoodSpecification,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
goodSpecificationCode: undefined,
|
||||
goodSpecificationName: undefined,
|
||||
cureTime: undefined,
|
||||
cure: undefined,
|
||||
deactivate: undefined,
|
||||
},
|
||||
dataRule: {
|
||||
goodSpecificationCode: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
goodSpecificationName: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
178
src/views/asrs/goodSpecification/index.vue
Normal file
178
src/views/asrs/goodSpecification/index.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="70%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import codeFilter from '../mixins/code-filter';
|
||||
import { deleteGoodSpecification, getGoodSpecificationPage } from "@/api/asrs/goodSpecification";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'goodSpecificationCode',
|
||||
label: '产品编码',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'goodSpecificationName',
|
||||
label: '产品名称',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'cure',
|
||||
label: '是否需要熟化',
|
||||
align: 'center',
|
||||
filter: codeFilter('cure'),
|
||||
},
|
||||
{
|
||||
prop: 'cureTime',
|
||||
label: '需要熟化时间(小时)',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'deactivate',
|
||||
label: '是否启用',
|
||||
align: 'center',
|
||||
filter: codeFilter('deactivate'),
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getGoodSpecificationPage,
|
||||
deleteURL: deleteGoodSpecification,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`asrs:good-specification:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`asrs:good-specification:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v)=>v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品名称',
|
||||
placeholder: '产品名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('asrs:good-specification:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.goodSpecificationName = val.name;
|
||||
this.listQuery.goodSpecificationCode = val.code;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
181
src/views/asrs/goodSpecification/indexb.vue
Normal file
181
src/views/asrs/goodSpecification/indexb.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="70%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import codeFilter from '../mixins/code-filter';
|
||||
import { deleteGoodSpecification, getGoodSpecificationPage } from "@/api/asrs/goodSpecification";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'goodSpecificationCode',
|
||||
label: '产品编码',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'goodSpecificationName',
|
||||
label: '产品名称',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'cure',
|
||||
label: '是否需要熟化',
|
||||
align: 'center',
|
||||
filter: codeFilter('cure'),
|
||||
},
|
||||
{
|
||||
prop: 'cureTime',
|
||||
label: '需要熟化时间(小时)',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'deactivate',
|
||||
label: '是否启用',
|
||||
align: 'center',
|
||||
filter: codeFilter('deactivate'),
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getGoodSpecificationPage,
|
||||
deleteURL: deleteGoodSpecification,
|
||||
},
|
||||
tableProps,
|
||||
bPage: true,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`asrs:good-specification:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`asrs:good-specification:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v)=>v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品名称',
|
||||
placeholder: '产品名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('asrs:good-specification:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
this.listQuery.warehouseId = this.bId;
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.goodSpecificationName = val.name;
|
||||
this.listQuery.goodSpecificationCode = val.code;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user