更新
This commit is contained in:
parent
f2ca004e6f
commit
3f8f5b5893
@ -25,6 +25,12 @@ const table = {
|
|||||||
'1': '可计数',
|
'1': '可计数',
|
||||||
'2': '不可计数',
|
'2': '不可计数',
|
||||||
},
|
},
|
||||||
|
inspectionStage: {
|
||||||
|
1: '进货检验',
|
||||||
|
2: '过程检验',
|
||||||
|
3: '成品检验',
|
||||||
|
4: '出货检验',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function(dictTable) {
|
export default function(dictTable) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Date: 2020-12-29 16:49:28
|
* @Date: 2020-12-29 16:49:28
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2023-01-05 15:49:17
|
* @LastEditTime: 2023-04-21 16:49:57
|
||||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@ -29,6 +29,10 @@ const table = {
|
|||||||
'0': i18n.t('logLogin.status0'),
|
'0': i18n.t('logLogin.status0'),
|
||||||
'1': i18n.t('logLogin.status1')
|
'1': i18n.t('logLogin.status1')
|
||||||
},
|
},
|
||||||
|
scheduleStatus: {
|
||||||
|
'0': i18n.t('schedule.status0'),
|
||||||
|
'1': i18n.t('schedule.status1')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function(dictTable) {
|
export default function(dictTable) {
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'name',
|
||||||
|
code: 'code',
|
||||||
status: 'status',
|
status: 'status',
|
||||||
createTime: 'create time',
|
createTime: 'create time',
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: '名称',
|
||||||
|
code: '编码',
|
||||||
status: '状态',
|
status: '状态',
|
||||||
createTime: '添加时间',
|
createTime: '添加时间',
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-08-24 11:19:43
|
* @Date: 2022-08-24 11:19:43
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2023-02-17 10:59:11
|
* @LastEditTime: 2023-04-20 10:48:23
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
@ -17,6 +17,7 @@ export default {
|
|||||||
},
|
},
|
||||||
addOrEditTitle: '',
|
addOrEditTitle: '',
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
dataForm: {},
|
||||||
listQuery: {
|
listQuery: {
|
||||||
limit: 10,
|
limit: 10,
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -104,7 +105,7 @@ export default {
|
|||||||
this.$refs.addOrUpdate.init(val.data.id);
|
this.$refs.addOrUpdate.init(val.data.id);
|
||||||
});
|
});
|
||||||
} else if (val.type === "delete") {
|
} else if (val.type === "delete") {
|
||||||
this.deleteHandle(val.data.id, val.data.name)
|
this.deleteHandle(val.data.id, val.data.name,val.data._pageIndex)
|
||||||
} else if (val.type === "change") {
|
} else if (val.type === "change") {
|
||||||
this.changeStatus(val.data.id)
|
this.changeStatus(val.data.id)
|
||||||
} else {
|
} else {
|
||||||
@ -112,8 +113,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle(id, name) {
|
deleteHandle(id, name,index) {
|
||||||
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
|
this.$confirm(`确定对${name?'[名称='+name+']':'[序号='+index+']'}进行删除操作?`, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||||
<el-form-item prop="beanName" :label="$t('schedule.beanName')">
|
<el-form-item prop="beanName" :label="$t('schedule.beanName')">
|
||||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
|
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
|
||||||
@ -17,20 +16,21 @@
|
|||||||
<el-input v-model="dataForm.remark" :placeholder="$t('schedule.remark')"></el-input>
|
<el-input v-model="dataForm.remark" :placeholder="$t('schedule.remark')"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template slot="footer">
|
|
||||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
|
||||||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add'
|
||||||
import debounce from 'lodash/debounce'
|
import debounce from 'lodash/debounce'
|
||||||
import { cron } from 'vue-cron'
|
import { cron } from 'vue-cron'
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
urlOptions: {
|
||||||
|
submitURL: '/sys/schedule/',
|
||||||
|
infoURL: '/sys/schedule'
|
||||||
|
},
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: '',
|
id: '',
|
||||||
beanName: '',
|
beanName: '',
|
||||||
@ -58,7 +58,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init (id) {
|
||||||
|
this.dataForm.id = id || "";
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs['dataForm'].resetFields()
|
this.$refs['dataForm'].resetFields()
|
||||||
|
@ -1,71 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card shadow="never" class="aui-card--fill">
|
<el-card shadow="never" class="aui-card--fill">
|
||||||
<div class="mod-job__schedule">
|
<div class="mod-job__schedule">
|
||||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
<el-form-item>
|
|
||||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
|
<base-table
|
||||||
</el-form-item>
|
:table-props="tableProps"
|
||||||
<el-form-item>
|
:page="listQuery.page"
|
||||||
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
:limit="listQuery.limit"
|
||||||
</el-form-item>
|
:table-data="tableData"
|
||||||
<el-form-item>
|
>
|
||||||
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
<method-btn
|
||||||
</el-form-item>
|
v-if="tableBtn.length"
|
||||||
<el-form-item>
|
slot="handleBtn"
|
||||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
:width="200"
|
||||||
</el-form-item>
|
label="操作"
|
||||||
<el-form-item>
|
:method-list="tableBtn"
|
||||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
|
@clickBtn="handleClick"
|
||||||
</el-form-item>
|
/>
|
||||||
<el-form-item>
|
</base-table>
|
||||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
|
<pagination
|
||||||
</el-form-item>
|
:limit.sync="listQuery.limit"
|
||||||
<el-form-item>
|
:page.sync="listQuery.page"
|
||||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
|
:total="listQuery.total"
|
||||||
</el-form-item>
|
@pagination="getDataList"
|
||||||
<el-form-item>
|
/>
|
||||||
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-table
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
:data="dataList"
|
|
||||||
border
|
|
||||||
@selection-change="dataListSelectionChangeHandle"
|
|
||||||
@sort-change="dataListSortChangeHandle"
|
|
||||||
style="width: 100%;">
|
|
||||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
|
||||||
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
|
|
||||||
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
|
||||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
|
|
||||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
|
|
||||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
|
|
||||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
:current-page="page"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="limit"
|
|
||||||
:total="total"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
@size-change="pageSizeChangeHandle"
|
|
||||||
@current-change="pageCurrentChangeHandle">
|
|
||||||
</el-pagination>
|
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @successSubmit="getDataList"></add-or-update>
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
>
|
||||||
|
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
<!-- 弹窗, 日志列表 -->
|
<!-- 弹窗, 日志列表 -->
|
||||||
<log v-if="logVisible" ref="log"></log>
|
<log v-if="logVisible" ref="log"></log>
|
||||||
</div>
|
</div>
|
||||||
@ -73,124 +41,255 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import mixinViewModule from '@/mixins/view-module'
|
import basicPage from "@/mixins/basic-page";
|
||||||
import AddOrUpdate from './schedule-add-or-update'
|
import AddOrUpdate from "./schedule-add-or-update";
|
||||||
import Log from './schedule-log'
|
import Log from "./schedule-log";
|
||||||
|
import i18n from "@/i18n";
|
||||||
|
import sysFilter from "@/filters/sys-filter";
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: "beanName",
|
||||||
|
label: i18n.t("schedule.beanName"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "params",
|
||||||
|
label: i18n.t("schedule.params"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "cronExpression",
|
||||||
|
label: i18n.t("schedule.cronExpression"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "remark",
|
||||||
|
label: i18n.t("schedule.remark"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "status",
|
||||||
|
label: i18n.t("schedule.status"),
|
||||||
|
filter: sysFilter("scheduleStatus"),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: "edit",
|
||||||
|
btnName: "编辑",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "pause",
|
||||||
|
btnName: "暂停",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "restore",
|
||||||
|
btnName: "恢复",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "run",
|
||||||
|
btnName: "执行",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "delete",
|
||||||
|
btnName: "删除",
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
mixins: [mixinViewModule],
|
mixins: [basicPage],
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
mixinViewModuleOptions: {
|
urlOptions: {
|
||||||
getDataListURL: '/sys/schedule/page',
|
getDataListURL: "/sys/schedule/page",
|
||||||
getDataListIsPage: true,
|
deleteURL: "/sys/schedule",
|
||||||
deleteURL: '/sys/schedule',
|
|
||||||
deleteIsBatch: true
|
|
||||||
},
|
},
|
||||||
dataForm: {
|
dataForm: {
|
||||||
beanName: ''
|
beanName: "",
|
||||||
},
|
},
|
||||||
logVisible: false
|
tableProps,
|
||||||
}
|
tableBtn,
|
||||||
|
addDeleteURL: true,
|
||||||
|
logVisible: false,
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: i18n.t("schedule.beanName"),
|
||||||
|
placeholder: i18n.t("schedule.beanName"),
|
||||||
|
param: "beanName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
btnName: "查询",
|
||||||
|
name: "search",
|
||||||
|
color: "primary",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
btnName: "新增",
|
||||||
|
name: "add",
|
||||||
|
color: "primary",
|
||||||
|
plain: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
btnName: "日志",
|
||||||
|
name: "log",
|
||||||
|
color: "success",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
Log
|
Log,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//search-bar点击
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case "search":
|
||||||
|
this.listQuery.beanName = val.beanName;
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case "add":
|
||||||
|
this.addOrEditTitle = '新增'
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle()
|
||||||
|
break;
|
||||||
|
case "log":
|
||||||
|
this.logHandle()
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
btnFun(val) {
|
||||||
|
if (val.type === "pause") {
|
||||||
|
this.pauseHandle(val.data.id);
|
||||||
|
} else if (val.type === "restore") {
|
||||||
|
this.resumeHandle(val.data.id);
|
||||||
|
} else {
|
||||||
|
this.runHandle(val.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
// 暂停
|
// 暂停
|
||||||
pauseHandle (id) {
|
pauseHandle(id) {
|
||||||
if (!id && this.dataListSelections.length <= 0) {
|
if (!id && this.dataListSelections.length <= 0) {
|
||||||
return this.$message({
|
return this.$message({
|
||||||
message: this.$t('prompt.deleteBatch'),
|
message: this.$t("prompt.deleteBatch"),
|
||||||
type: 'warning',
|
type: "warning",
|
||||||
duration: 500
|
duration: 500,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), {
|
this.$confirm(
|
||||||
confirmButtonText: this.$t('confirm'),
|
this.$t("prompt.info", { handle: this.$t("schedule.pause") }),
|
||||||
cancelButtonText: this.$t('cancel'),
|
this.$t("prompt.title"),
|
||||||
type: 'warning'
|
{
|
||||||
}).then(() => {
|
confirmButtonText: this.$t("confirm"),
|
||||||
this.$http.put('/sys/schedule/pause', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
cancelButtonText: this.$t("cancel"),
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.$http
|
||||||
|
.put("/sys/schedule/pause", id ? [id] : this.dataListSelections.map((item) => item.id))
|
||||||
|
.then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t('prompt.success'),
|
message: this.$t("prompt.success"),
|
||||||
type: 'success',
|
type: "success",
|
||||||
duration: 500,
|
duration: 500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
}
|
},
|
||||||
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
.catch(() => {});
|
||||||
}).catch(() => {})
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
// 恢复
|
// 恢复
|
||||||
resumeHandle (id) {
|
resumeHandle(id) {
|
||||||
if (!id && this.dataListSelections.length <= 0) {
|
if (!id && this.dataListSelections.length <= 0) {
|
||||||
return this.$message({
|
return this.$message({
|
||||||
message: this.$t('prompt.deleteBatch'),
|
message: this.$t("prompt.deleteBatch"),
|
||||||
type: 'warning',
|
type: "warning",
|
||||||
duration: 500
|
duration: 500,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), {
|
this.$confirm(
|
||||||
confirmButtonText: this.$t('confirm'),
|
this.$t("prompt.info", { handle: this.$t("schedule.resume") }),
|
||||||
cancelButtonText: this.$t('cancel'),
|
this.$t("prompt.title"),
|
||||||
type: 'warning'
|
{
|
||||||
}).then(() => {
|
confirmButtonText: this.$t("confirm"),
|
||||||
this.$http.put('/sys/schedule/resume', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
cancelButtonText: this.$t("cancel"),
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.$http
|
||||||
|
.put("/sys/schedule/resume", id ? [id] : this.dataListSelections.map((item) => item.id))
|
||||||
|
.then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t('prompt.success'),
|
message: this.$t("prompt.success"),
|
||||||
type: 'success',
|
type: "success",
|
||||||
duration: 500,
|
duration: 500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
}
|
},
|
||||||
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
.catch(() => {});
|
||||||
}).catch(() => {})
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
// 执行
|
// 执行
|
||||||
runHandle (id) {
|
runHandle(id) {
|
||||||
if (!id && this.dataListSelections.length <= 0) {
|
if (!id && this.dataListSelections.length <= 0) {
|
||||||
return this.$message({
|
return this.$message({
|
||||||
message: this.$t('prompt.deleteBatch'),
|
message: this.$t("prompt.deleteBatch"),
|
||||||
type: 'warning',
|
type: "warning",
|
||||||
duration: 500
|
duration: 500,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), {
|
this.$confirm(
|
||||||
confirmButtonText: this.$t('confirm'),
|
this.$t("prompt.info", { handle: this.$t("schedule.run") }),
|
||||||
cancelButtonText: this.$t('cancel'),
|
this.$t("prompt.title"),
|
||||||
type: 'warning'
|
{
|
||||||
}).then(() => {
|
confirmButtonText: this.$t("confirm"),
|
||||||
this.$http.put('/sys/schedule/run', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
cancelButtonText: this.$t("cancel"),
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.$http
|
||||||
|
.put("/sys/schedule/run", id ? [id] : this.dataListSelections.map((item) => item.id))
|
||||||
|
.then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t('prompt.success'),
|
message: this.$t("prompt.success"),
|
||||||
type: 'success',
|
type: "success",
|
||||||
duration: 500,
|
duration: 500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
}
|
},
|
||||||
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
.catch(() => {});
|
||||||
}).catch(() => {})
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
// 日志列表
|
// 日志列表
|
||||||
logHandle () {
|
logHandle() {
|
||||||
this.logVisible = true
|
this.logVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.log.init()
|
this.$refs.log.init();
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
|
||||||
<el-form-item prop="name" :label="$t('role.name')">
|
<el-form-item prop="name" :label="$t('role.name')">
|
||||||
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
|
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -117,7 +117,7 @@ export default {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmitHandle: debounce(function () {
|
dataFormSubmit: debounce(function () {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false
|
return false
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2022-12-28 09:25:04
|
* @LastEditTime: 2023-04-20 10:57:44
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-drawer :visible.sync="visible" size="90%" class="drawerClass" :before-close="handleClose">
|
<el-drawer :visible.sync="visible" size="90%" class="drawerClass" :before-close="handleClose">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<h3 style="margin:10px 20px">{{ !dataForm.id ? "登记" : "修改" }}</h3>
|
<h3 class="titleStyle">{{ !dataForm.id ? "登记" : "修改" }}</h3>
|
||||||
</template>
|
</template>
|
||||||
<el-collapse value="1" @change="handleChange">
|
<el-collapse value="1" @change="handleChange">
|
||||||
<el-collapse-item name="1">
|
<el-collapse-item name="1">
|
||||||
@ -438,4 +438,18 @@ export default {
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
.titleStyle{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.titleStyle::before{
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0B58FF;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-09-15 10:44:29
|
* @Date: 2022-09-15 10:44:29
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2022-12-09 11:16:58
|
* @LastEditTime: 2023-04-20 10:58:45
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-card shadow="never" class="aui-card--fill">
|
<el-card shadow="never" class="aui-card--fill">
|
||||||
<el-row :gutter="6" style="background-color:#e6f7ff;margin:-20px;padding-top:10px;margin-bottom:0">
|
<el-row :gutter="6" style="background-color:#e6f7ff;padding-top:10px;margin-bottom:0">
|
||||||
<el-form ref="dataForm" :model="dataForm" :rules="rules" size="small" label-width="80px">
|
<el-form ref="dataForm" :model="dataForm" :rules="rules" size="small" label-width="80px">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="检验时间" prop="time">
|
<el-form-item label="检验时间" prop="time">
|
||||||
@ -138,67 +138,27 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table
|
<base-table
|
||||||
:data="dataList"
|
:table-props="tableProps"
|
||||||
:stripe="true"
|
:page="listQuery.page"
|
||||||
:header-cell-style="{
|
:limit="listQuery.limit"
|
||||||
background: '#eef1f6',
|
:table-data="tableData"
|
||||||
color: '#606266',
|
|
||||||
height: '56px',
|
|
||||||
}"
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
style="width: 100%;"
|
|
||||||
>
|
>
|
||||||
<el-table-column prop="id" align="center" label="检验单号"> </el-table-column>
|
<method-btn
|
||||||
<el-table-column prop="batchNumber" align="center" label="批次号"> </el-table-column>
|
v-if="tableBtn.length"
|
||||||
<el-table-column prop="inspectionStage" align="center" label="检验阶段">
|
slot="handleBtn"
|
||||||
<template slot-scope="scope">
|
:width="150"
|
||||||
<span>{{
|
label="操作"
|
||||||
{ 1: "进货检验", 2: "过程检验", 3: "成品检验", 4: "出货检验" }[
|
:method-list="tableBtn"
|
||||||
scope.row.inspectionStage
|
@clickBtn="handleClick"
|
||||||
]
|
/>
|
||||||
}}</span>
|
</base-table>
|
||||||
</template>
|
<pagination
|
||||||
</el-table-column>
|
:limit.sync="listQuery.limit"
|
||||||
<el-table-column prop="productName" align="center" label="产品名称"> </el-table-column>
|
:page.sync="listQuery.page"
|
||||||
<el-table-column prop="machineName" align="center" label="机台"> </el-table-column>
|
:total="listQuery.total"
|
||||||
<el-table-column prop="workingProcedureName" align="center" label="工序"> </el-table-column>
|
@pagination="getDataList"
|
||||||
<el-table-column prop="createTime" align="center" label="检验时间"> </el-table-column>
|
/>
|
||||||
<el-table-column prop="shiftName" align="center" label="班次"> </el-table-column>
|
|
||||||
<el-table-column prop="numberOfSamples" align="center" label="抽样数量"> </el-table-column>
|
|
||||||
<el-table-column prop="numberOfDefects" align="center" label="缺陷数量"> </el-table-column>
|
|
||||||
<el-table-column prop="defectiveQuantity" align="center" label="不良数量"> </el-table-column>
|
|
||||||
<el-table-column prop="remark" align="center" label="备注"> </el-table-column>
|
|
||||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">
|
|
||||||
<el-tooltip class="item" effect="dark" content="修改" placement="top">
|
|
||||||
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
|
|
||||||
</el-tooltip>
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
style="color:red"
|
|
||||||
size="small"
|
|
||||||
@click="deleteHandle(scope.row.id, scope.row.id)"
|
|
||||||
>
|
|
||||||
<el-tooltip class="item" effect="dark" content="删除" placement="top">
|
|
||||||
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
|
|
||||||
</el-tooltip>
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
@size-change="sizeChangeHandle"
|
|
||||||
@current-change="currentChangeHandle"
|
|
||||||
:current-page="pageIndex"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="pageSize"
|
|
||||||
:total="totalPage"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
>
|
|
||||||
</el-pagination>
|
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update
|
<add-or-update
|
||||||
:optionArr="optionArr"
|
:optionArr="optionArr"
|
||||||
@ -209,10 +169,73 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import processPage from "@/mixins/process-page";
|
import basicPage from "@/mixins/basic-page";
|
||||||
import AddOrUpdate from './components/generalOperation-add'
|
import AddOrUpdate from './components/generalOperation-add'
|
||||||
|
import basicFilter from "@/filters/basic-filter";
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: "id",
|
||||||
|
label: "检验单号",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "batchNumber",
|
||||||
|
label: "批次号",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "inspectionStage",
|
||||||
|
label: "检验阶段",
|
||||||
|
filter: basicFilter("inspectionStage"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "productName",
|
||||||
|
label: "产品名称",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "machineName",
|
||||||
|
label: "机台",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "workingProcedureName",
|
||||||
|
label: "工序",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "createTime",
|
||||||
|
label: "检验时间",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "shiftName",
|
||||||
|
label: "班次",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "numberOfSamples",
|
||||||
|
label: "抽样数量",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "numberOfDefects",
|
||||||
|
label: "缺陷数量",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "defectiveQuantity",
|
||||||
|
label: "不良数量",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "remark",
|
||||||
|
label: "备注",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: "edit",
|
||||||
|
btnName: "编辑",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "delete",
|
||||||
|
btnName: "删除",
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
mixins: [processPage],
|
mixins: [basicPage],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@ -226,6 +249,9 @@ export default {
|
|||||||
"/basic/shift/page",
|
"/basic/shift/page",
|
||||||
"/sys/user/page",
|
"/sys/user/page",
|
||||||
],
|
],
|
||||||
|
tableProps,
|
||||||
|
tableBtn,
|
||||||
|
tableData: [],
|
||||||
optionArr: {},
|
optionArr: {},
|
||||||
time: [],
|
time: [],
|
||||||
rules: {},
|
rules: {},
|
||||||
@ -278,8 +304,8 @@ export default {
|
|||||||
this.$http
|
this.$http
|
||||||
.get(this.urlOptions.getDataListURL, {
|
.get(this.urlOptions.getDataListURL, {
|
||||||
params: {
|
params: {
|
||||||
page: this.pageIndex,
|
page: this.listQuery.page,
|
||||||
limit: this.pageSize,
|
limit: this.listQuery.limit,
|
||||||
startTime: this.time && this.time.length > 0 ? this.time[0] : "",
|
startTime: this.time && this.time.length > 0 ? this.time[0] : "",
|
||||||
endTime: this.time && this.time.length > 0 ? this.time[1] : "",
|
endTime: this.time && this.time.length > 0 ? this.time[1] : "",
|
||||||
...this.dataForm,
|
...this.dataForm,
|
||||||
@ -288,12 +314,12 @@ export default {
|
|||||||
.then(({ data: res }) => {
|
.then(({ data: res }) => {
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
this.dataList = [];
|
this.tableData = [];
|
||||||
this.totalPage = 0;
|
this.listQuery.total = 0;
|
||||||
return this.$message.error(res.msg);
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
this.dataList = res.data.list;
|
this.tableData = res.data.list;
|
||||||
this.totalPage = res.data.total;
|
this.listQuery.total = res.data.total;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
|
@ -41,15 +41,16 @@
|
|||||||
import AddOrUpdate from "./components/factoryManage-add";
|
import AddOrUpdate from "./components/factoryManage-add";
|
||||||
import basicPage from "@/mixins/basic-page";
|
import basicPage from "@/mixins/basic-page";
|
||||||
import basicFilter from "@/filters/basic-filter";
|
import basicFilter from "@/filters/basic-filter";
|
||||||
|
import i18n from "@/i18n";
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: "name",
|
prop: "name",
|
||||||
label: "名称",
|
label: i18n.t("module.basicData.name"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "code",
|
prop: "code",
|
||||||
label: "编码",
|
label: i18n.t("module.basicData.code"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "type",
|
prop: "type",
|
||||||
|
Loading…
Reference in New Issue
Block a user