|
|
|
|
@@ -17,8 +17,9 @@
|
|
|
|
|
<el-radio-button :value="-1">
|
|
|
|
|
全部
|
|
|
|
|
</el-radio-button>
|
|
|
|
|
<el-radio-button v-for="item in options.statusOptions" :key="item.dictValue" :value="parseInt(item.dictValue)">
|
|
|
|
|
{{item.dictLabel}}
|
|
|
|
|
<el-radio-button v-for="item in options.statusOptions" :key="item.dictValue"
|
|
|
|
|
:value="parseInt(item.dictValue)">
|
|
|
|
|
{{ item.dictLabel }}
|
|
|
|
|
</el-radio-button>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@@ -30,41 +31,59 @@
|
|
|
|
|
<!-- 工具区域 -->
|
|
|
|
|
<el-row :gutter="15" class="mb10">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" v-hasPermi="['baseManagement:baseworkroute:add']" plain icon="plus" @click="handleAdd">
|
|
|
|
|
<el-button type="primary" v-hasPermi="['baseManagement:baseworkroute:add']" plain icon="plus"
|
|
|
|
|
@click="handleAdd">
|
|
|
|
|
{{ $t('btn.add') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell" highlight-current-row @sort-change="sortChange">
|
|
|
|
|
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell"
|
|
|
|
|
highlight-current-row @sort-change="sortChange">
|
|
|
|
|
<el-table-column prop="id" label="主键" align="center" v-if="columns.showColumn('id')" />
|
|
|
|
|
<el-table-column prop="code" label="流程编码" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('code')" />
|
|
|
|
|
<el-table-column prop="name" label="流程名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('name')" />
|
|
|
|
|
<el-table-column prop="baseWorkProcessesList" label="绑定工序" min-width="260" align="left" v-if="columns.showColumn('baseWorkProcessesList')">
|
|
|
|
|
<el-table-column prop="code" label="流程编码" align="center" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('code')" />
|
|
|
|
|
<el-table-column prop="name" label="流程名称" align="center" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('name')" />
|
|
|
|
|
<el-table-column prop="productionCode" label="产成品编号" align="center" />
|
|
|
|
|
<el-table-column prop="baseWorkProcessesList" label="绑定工序" min-width="260" align="left"
|
|
|
|
|
v-if="columns.showColumn('baseWorkProcessesList')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag style="margin-right: 5px;" v-for="(item,index) in scope.row.baseWorkProcessesList" type="primary">{{`${index}-${item.name}`}}</el-tag>
|
|
|
|
|
<el-tag style="margin-right: 5px;" v-for="(item, index) in scope.row.baseWorkProcessesList"
|
|
|
|
|
type="primary">{{ `${index}-${item.name}` }}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="status" label="状态" align="center" v-if="columns.showColumn('status')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options=" options.statusOptions" :value="scope.row.status + ''" />
|
|
|
|
|
<dict-tag :options="options.statusOptions" :value="scope.row.status + ''" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('remark')" />
|
|
|
|
|
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
|
|
|
|
|
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
|
|
|
|
|
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
|
|
|
|
|
<el-table-column prop="updatedTime" label="更新时间" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
|
|
|
|
|
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('remark')" />
|
|
|
|
|
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('createdBy')" />
|
|
|
|
|
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('createdTime')" />
|
|
|
|
|
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('updatedBy')" />
|
|
|
|
|
<el-table-column prop="updatedTime" label="更新时间" :show-overflow-tooltip="true"
|
|
|
|
|
v-if="columns.showColumn('updatedTime')" />
|
|
|
|
|
<el-table-column label="操作" width="240">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button type="warning" size="small" title="工艺流程" v-hasPermi="['baseManagement:baseworkroute:edit']" @click="handleRouteDialogShow(scope.row)">工艺流程</el-button>
|
|
|
|
|
<el-button type="success" size="small" icon="edit" title="编辑信息" v-hasPermi="['baseManagement:baseworkroute:edit']" @click="handleUpdate(scope.row)"></el-button>
|
|
|
|
|
<el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['baseManagement:baseworkroute:delete']" @click="handleDelete(scope.row)"></el-button>
|
|
|
|
|
<el-button type="warning" size="small" title="工艺流程"
|
|
|
|
|
v-hasPermi="['baseManagement:baseworkroute:edit']"
|
|
|
|
|
@click="handleRouteDialogShow(scope.row)">工艺流程</el-button>
|
|
|
|
|
<el-button type="success" size="small" icon="edit" title="编辑信息"
|
|
|
|
|
v-hasPermi="['baseManagement:baseworkroute:edit']" @click="handleUpdate(scope.row)"></el-button>
|
|
|
|
|
<el-button type="danger" size="small" icon="delete" title="删除"
|
|
|
|
|
v-hasPermi="['baseManagement:baseworkroute:delete']"
|
|
|
|
|
@click="handleDelete(scope.row)"></el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
|
|
|
|
@pagination="getList" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改工艺路线对话框 -->
|
|
|
|
|
@@ -81,11 +100,17 @@
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入流程名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="产成品编号" prop="productionCode">
|
|
|
|
|
<el-input v-model="form.productionCode" placeholder="请输入产成品编号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
|
<el-radio v-for="item in options.statusOptions" :key="item.dictValue" :value="parseInt(item.dictValue)">
|
|
|
|
|
{{item.dictLabel}}
|
|
|
|
|
<el-radio v-for="item in options.statusOptions" :key="item.dictValue"
|
|
|
|
|
:value="parseInt(item.dictValue)">
|
|
|
|
|
{{ item.dictLabel }}
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@@ -103,216 +128,219 @@
|
|
|
|
|
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<TheRouteDialog v-model="TheRouteDialogShow" title="工艺流程" :routeId="TheRouteDialogId" fullScreen @refresh="getList"></TheRouteDialog>
|
|
|
|
|
<TheRouteDialog v-model="TheRouteDialogShow" title="工艺流程" :routeId="TheRouteDialogId" fullScreen
|
|
|
|
|
@refresh="getList">
|
|
|
|
|
</TheRouteDialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="baseworkroute">
|
|
|
|
|
import {
|
|
|
|
|
listBaseWorkRoute,
|
|
|
|
|
addBaseWorkRoute,
|
|
|
|
|
delBaseWorkRoute,
|
|
|
|
|
updateBaseWorkRoute,
|
|
|
|
|
getBaseWorkRoute,
|
|
|
|
|
}
|
|
|
|
|
import {
|
|
|
|
|
listBaseWorkRoute,
|
|
|
|
|
addBaseWorkRoute,
|
|
|
|
|
delBaseWorkRoute,
|
|
|
|
|
updateBaseWorkRoute,
|
|
|
|
|
getBaseWorkRoute,
|
|
|
|
|
}
|
|
|
|
|
from '@/api/baseManagement/baseworkroute.js'
|
|
|
|
|
import {
|
|
|
|
|
getOneDict
|
|
|
|
|
}
|
|
|
|
|
import {
|
|
|
|
|
getOneDict
|
|
|
|
|
}
|
|
|
|
|
from '@/utils/dict.js'
|
|
|
|
|
import { default as TheRouteDialog } from './TheRouteDialog'
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
|
const ids = ref([])
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const showSearch = ref(true)
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
status: -1,
|
|
|
|
|
sort: 'createdTime',
|
|
|
|
|
sortType: 'desc',
|
|
|
|
|
})
|
|
|
|
|
const columns = ref([
|
|
|
|
|
{ visible: false, prop: 'id', label: '主键' },
|
|
|
|
|
{ visible: true, prop: 'name', label: '名称' },
|
|
|
|
|
{ visible: true, prop: 'code', label: '编号' },
|
|
|
|
|
{ visible: true, prop: 'status', label: '状态' },
|
|
|
|
|
{ visible: true, prop: 'remark', label: '备注' },
|
|
|
|
|
{ visible: false, prop: 'createdBy', label: '创建人' },
|
|
|
|
|
{ visible: false, prop: 'createdTime', label: '创建时间' },
|
|
|
|
|
{ visible: false, prop: 'updatedBy', label: '更新人' },
|
|
|
|
|
{ visible: false, prop: 'updatedTime', label: '更新时间' },
|
|
|
|
|
import { default as TheRouteDialog } from './TheRouteDialog'
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
|
const ids = ref([])
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const showSearch = ref(true)
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
status: -1,
|
|
|
|
|
sort: 'createdTime',
|
|
|
|
|
sortType: 'desc',
|
|
|
|
|
})
|
|
|
|
|
const columns = ref([
|
|
|
|
|
{ visible: false, prop: 'id', label: '主键' },
|
|
|
|
|
{ visible: true, prop: 'name', label: '名称' },
|
|
|
|
|
{ visible: true, prop: 'code', label: '编号' },
|
|
|
|
|
{ visible: true, prop: 'status', label: '状态' },
|
|
|
|
|
{ visible: true, prop: 'remark', label: '备注' },
|
|
|
|
|
{ visible: false, prop: 'createdBy', label: '创建人' },
|
|
|
|
|
{ visible: false, prop: 'createdTime', label: '创建时间' },
|
|
|
|
|
{ visible: false, prop: 'updatedBy', label: '更新人' },
|
|
|
|
|
{ visible: false, prop: 'updatedTime', label: '更新时间' },
|
|
|
|
|
|
|
|
|
|
])
|
|
|
|
|
const total = ref(0)
|
|
|
|
|
const dataList = ref([])
|
|
|
|
|
const queryRef = ref()
|
|
|
|
|
const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)])
|
|
|
|
|
])
|
|
|
|
|
const total = ref(0)
|
|
|
|
|
const dataList = ref([])
|
|
|
|
|
const queryRef = ref()
|
|
|
|
|
const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dictParams = []
|
|
|
|
|
var dictParams = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getList() {
|
|
|
|
|
loading.value = true
|
|
|
|
|
listBaseWorkRoute(queryParams).then(res => {
|
|
|
|
|
const { code, data } = res
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
dataList.value = data.result
|
|
|
|
|
total.value = data.totalNum
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询
|
|
|
|
|
function handleQuery() {
|
|
|
|
|
queryParams.pageNum = 1
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 重置查询操作
|
|
|
|
|
function resetQuery() {
|
|
|
|
|
proxy.resetForm("queryRef")
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
// 自定义排序
|
|
|
|
|
function sortChange(column) {
|
|
|
|
|
var sort = undefined
|
|
|
|
|
var sortType = undefined
|
|
|
|
|
|
|
|
|
|
if (column.prop != null && column.order != null) {
|
|
|
|
|
sort = column.prop
|
|
|
|
|
sortType = column.order
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
queryParams.sort = sort
|
|
|
|
|
queryParams.sortType = sortType
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************** form操作 ***************/
|
|
|
|
|
const formRef = ref()
|
|
|
|
|
const title = ref('')
|
|
|
|
|
// 操作类型 1、add 2、edit 3、view
|
|
|
|
|
const opertype = ref(0)
|
|
|
|
|
const open = ref(false)
|
|
|
|
|
const state = reactive({
|
|
|
|
|
single: true,
|
|
|
|
|
multiple: true,
|
|
|
|
|
form: {},
|
|
|
|
|
rules: {
|
|
|
|
|
id: [{ required: true, message: "主键不能为空", trigger: "blur", type: "number" }],
|
|
|
|
|
},
|
|
|
|
|
options: {
|
|
|
|
|
// 状态 选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
|
|
|
|
statusOptions: [],
|
|
|
|
|
function getList() {
|
|
|
|
|
loading.value = true
|
|
|
|
|
listBaseWorkRoute(queryParams).then(res => {
|
|
|
|
|
const { code, data } = res
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
dataList.value = data.result
|
|
|
|
|
total.value = data.totalNum
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { form, rules, options, single, multiple } = toRefs(state)
|
|
|
|
|
async function initDict() {
|
|
|
|
|
const dictSelectList = ['common_status'];
|
|
|
|
|
const statusRes = await getOneDict(dictSelectList[0]);
|
|
|
|
|
if (statusRes.code === 200) {
|
|
|
|
|
state.options.statusOptions = statusRes.data[0].list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 关闭dialog
|
|
|
|
|
function cancel() {
|
|
|
|
|
open.value = false
|
|
|
|
|
reset()
|
|
|
|
|
}
|
|
|
|
|
// 查询
|
|
|
|
|
function handleQuery() {
|
|
|
|
|
queryParams.pageNum = 1
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 重置表单
|
|
|
|
|
function reset() {
|
|
|
|
|
form.value = {
|
|
|
|
|
id: null,
|
|
|
|
|
name: null,
|
|
|
|
|
code: null,
|
|
|
|
|
logicFlowData: null,
|
|
|
|
|
status: 1,
|
|
|
|
|
remark: null,
|
|
|
|
|
createdBy: null,
|
|
|
|
|
createdTime: null,
|
|
|
|
|
updatedBy: null,
|
|
|
|
|
updatedTime: null,
|
|
|
|
|
};
|
|
|
|
|
proxy.resetForm("formRef")
|
|
|
|
|
}
|
|
|
|
|
// 添加按钮操作
|
|
|
|
|
function handleAdd() {
|
|
|
|
|
reset();
|
|
|
|
|
open.value = true
|
|
|
|
|
title.value = '添加工艺路线'
|
|
|
|
|
opertype.value = 1
|
|
|
|
|
}
|
|
|
|
|
// 修改按钮操作
|
|
|
|
|
function handleUpdate(row) {
|
|
|
|
|
reset()
|
|
|
|
|
const id = row.id || ids.value
|
|
|
|
|
getBaseWorkRoute(id).then((res) => {
|
|
|
|
|
const { code, data } = res
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
open.value = true
|
|
|
|
|
title.value = '修改工艺路线'
|
|
|
|
|
opertype.value = 2
|
|
|
|
|
|
|
|
|
|
form.value = {
|
|
|
|
|
...data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加&修改 表单提交
|
|
|
|
|
function submitForm() {
|
|
|
|
|
proxy.$refs["formRef"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
|
|
if (form.value.id != undefined && opertype.value === 2) {
|
|
|
|
|
updateBaseWorkRoute(form.value).then((res) => {
|
|
|
|
|
proxy.$modal.msgSuccess("修改成功")
|
|
|
|
|
open.value = false
|
|
|
|
|
getList()
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
addBaseWorkRoute(form.value).then((res) => {
|
|
|
|
|
proxy.$modal.msgSuccess("新增成功")
|
|
|
|
|
open.value = false
|
|
|
|
|
getList()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除按钮操作
|
|
|
|
|
function handleDelete(row) {
|
|
|
|
|
const Ids = row.id || ids.value
|
|
|
|
|
|
|
|
|
|
proxy
|
|
|
|
|
.$confirm('是否确认删除主键为"' + Ids + '"的数据项?')
|
|
|
|
|
.then(function () {
|
|
|
|
|
return delBaseWorkRoute(Ids)
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
getList()
|
|
|
|
|
proxy.$modal.msgSuccess("删除成功")
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// dialog
|
|
|
|
|
const TheRouteDialogId = ref()
|
|
|
|
|
const TheRouteDialogShow = ref(false)
|
|
|
|
|
// 流程图按钮操作按钮操作
|
|
|
|
|
function handleRouteDialogShow(row) {
|
|
|
|
|
reset();
|
|
|
|
|
TheRouteDialogId.value = row.id
|
|
|
|
|
TheRouteDialogShow.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initDict()
|
|
|
|
|
// 重置查询操作
|
|
|
|
|
function resetQuery() {
|
|
|
|
|
proxy.resetForm("queryRef")
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
// 自定义排序
|
|
|
|
|
function sortChange(column) {
|
|
|
|
|
var sort = undefined
|
|
|
|
|
var sortType = undefined
|
|
|
|
|
|
|
|
|
|
if (column.prop != null && column.order != null) {
|
|
|
|
|
sort = column.prop
|
|
|
|
|
sortType = column.order
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
queryParams.sort = sort
|
|
|
|
|
queryParams.sortType = sortType
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************** form操作 ***************/
|
|
|
|
|
const formRef = ref()
|
|
|
|
|
const title = ref('')
|
|
|
|
|
// 操作类型 1、add 2、edit 3、view
|
|
|
|
|
const opertype = ref(0)
|
|
|
|
|
const open = ref(false)
|
|
|
|
|
const state = reactive({
|
|
|
|
|
single: true,
|
|
|
|
|
multiple: true,
|
|
|
|
|
form: {},
|
|
|
|
|
rules: {
|
|
|
|
|
id: [{ required: true, message: "主键不能为空", trigger: "blur", type: "number" }],
|
|
|
|
|
},
|
|
|
|
|
options: {
|
|
|
|
|
// 状态 选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
|
|
|
|
statusOptions: [{ dictLabel: '停用', dictValue: 0 }, { dictLabel: '启用', dictValue: 1 }],
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const { form, rules, options, single, multiple } = toRefs(state)
|
|
|
|
|
async function initDict() {
|
|
|
|
|
const dictSelectList = ['common_status'];
|
|
|
|
|
const statusRes = await getOneDict(dictSelectList[0]);
|
|
|
|
|
if (statusRes.code === 200) {
|
|
|
|
|
state.options.statusOptions = statusRes.data[0].list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 关闭dialog
|
|
|
|
|
function cancel() {
|
|
|
|
|
open.value = false
|
|
|
|
|
reset()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 重置表单
|
|
|
|
|
function reset() {
|
|
|
|
|
form.value = {
|
|
|
|
|
id: null,
|
|
|
|
|
name: null,
|
|
|
|
|
code: null,
|
|
|
|
|
logicFlowData: null,
|
|
|
|
|
productionCode: '',
|
|
|
|
|
status: 1,
|
|
|
|
|
remark: null,
|
|
|
|
|
createdBy: null,
|
|
|
|
|
createdTime: null,
|
|
|
|
|
updatedBy: null,
|
|
|
|
|
updatedTime: null,
|
|
|
|
|
};
|
|
|
|
|
proxy.resetForm("formRef")
|
|
|
|
|
}
|
|
|
|
|
// 添加按钮操作
|
|
|
|
|
function handleAdd() {
|
|
|
|
|
reset();
|
|
|
|
|
open.value = true
|
|
|
|
|
title.value = '添加工艺路线'
|
|
|
|
|
opertype.value = 1
|
|
|
|
|
}
|
|
|
|
|
// 修改按钮操作
|
|
|
|
|
function handleUpdate(row) {
|
|
|
|
|
reset()
|
|
|
|
|
const id = row.id || ids.value
|
|
|
|
|
getBaseWorkRoute(id).then((res) => {
|
|
|
|
|
const { code, data } = res
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
open.value = true
|
|
|
|
|
title.value = '修改工艺路线'
|
|
|
|
|
opertype.value = 2
|
|
|
|
|
|
|
|
|
|
form.value = {
|
|
|
|
|
...data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加&修改 表单提交
|
|
|
|
|
function submitForm() {
|
|
|
|
|
proxy.$refs["formRef"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
|
|
if (form.value.id != undefined && opertype.value === 2) {
|
|
|
|
|
updateBaseWorkRoute(form.value).then((res) => {
|
|
|
|
|
proxy.$modal.msgSuccess("修改成功")
|
|
|
|
|
open.value = false
|
|
|
|
|
getList()
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
addBaseWorkRoute(form.value).then((res) => {
|
|
|
|
|
proxy.$modal.msgSuccess("新增成功")
|
|
|
|
|
open.value = false
|
|
|
|
|
getList()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除按钮操作
|
|
|
|
|
function handleDelete(row) {
|
|
|
|
|
const Ids = row.id || ids.value
|
|
|
|
|
|
|
|
|
|
proxy
|
|
|
|
|
.$confirm('是否确认删除主键为"' + Ids + '"的数据项?')
|
|
|
|
|
.then(function () {
|
|
|
|
|
return delBaseWorkRoute(Ids)
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
getList()
|
|
|
|
|
proxy.$modal.msgSuccess("删除成功")
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// dialog
|
|
|
|
|
const TheRouteDialogId = ref()
|
|
|
|
|
const TheRouteDialogShow = ref(false)
|
|
|
|
|
// 流程图按钮操作按钮操作
|
|
|
|
|
function handleRouteDialogShow(row) {
|
|
|
|
|
reset();
|
|
|
|
|
TheRouteDialogId.value = row.id
|
|
|
|
|
TheRouteDialogShow.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initDict()
|
|
|
|
|
handleQuery()
|
|
|
|
|
</script>
|