master
parent
e4d891d974
commit
1f63e3d017
|
|
@ -0,0 +1,35 @@
|
||||||
|
<script lang="ts" setup>
|
||||||
|
const showDialog = ref(false)
|
||||||
|
const submiting = ref(false)
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(_: CraftTypes.SearchCraftResult = {}) {
|
||||||
|
showDialog.value = true
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ElDialog v-model="showDialog"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
destroy-on-close
|
||||||
|
width="90vw"
|
||||||
|
@close="dialogCloseHandler">
|
||||||
|
<div></div>
|
||||||
|
<template #footer>
|
||||||
|
<ElButton @click="showDialog = false">关闭</ElButton>
|
||||||
|
<ElButton :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||||
|
</template>
|
||||||
|
</ElDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -58,22 +58,7 @@
|
||||||
<ElTableColumn label="操作" width="180">
|
<ElTableColumn label="操作" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<!-- <ElPopconfirm
|
<ElButton text type="primary" @click="configCraftFlow(scope)">配置工艺流程</ElButton>
|
||||||
confirm-button-text="是"
|
|
||||||
cancel-button-text="否"
|
|
||||||
confirm-button-type="danger"
|
|
||||||
cancel-button-type="primary"
|
|
||||||
placement="top"
|
|
||||||
title="是否删除当前数据?"
|
|
||||||
width="180"
|
|
||||||
@confirm="delHandler(scope)">
|
|
||||||
<template #reference>
|
|
||||||
<ElButton text type="danger" :loading="deling">删除</ElButton>
|
|
||||||
</template>
|
|
||||||
</ElPopconfirm> -->
|
|
||||||
|
|
||||||
<!-- <ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton> -->
|
|
||||||
<ElButton text type="primary" @click="modifyHandler(scope)">配置工艺流程</ElButton>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
|
|
@ -88,6 +73,7 @@
|
||||||
layout="->, sizes, total, prev, pager, next"
|
layout="->, sizes, total, prev, pager, next"
|
||||||
@change="paging"/>
|
@change="paging"/>
|
||||||
<CraftForm ref="craftForm" @edit-succ="paging"/>
|
<CraftForm ref="craftForm" @edit-succ="paging"/>
|
||||||
|
<CraftFlow ref="craftFlow" @edit-succ="paging"/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -98,6 +84,7 @@ import Page from '@/components/page/Page.vue'
|
||||||
import { elIcons } from '@/common/element/element.ts'
|
import { elIcons } from '@/common/element/element.ts'
|
||||||
import Utils from '@/common/utils'
|
import Utils from '@/common/utils'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import CraftFlow from '@/pages/mfg/craft-flow/CraftFlow.vue'
|
||||||
|
|
||||||
const totalCount = ref(0)
|
const totalCount = ref(0)
|
||||||
const tableData = Utils.resetAble(reactive<CraftTypes.SearchCraftResult[]>([]))
|
const tableData = Utils.resetAble(reactive<CraftTypes.SearchCraftResult[]>([]))
|
||||||
|
|
@ -106,30 +93,16 @@ const searchForm = Utils.resetAble(reactive<CraftTypes.SearchCraftParam>({
|
||||||
size: 20,
|
size: 20,
|
||||||
}))
|
}))
|
||||||
const searching = ref(false)
|
const searching = ref(false)
|
||||||
const deling = ref(false)
|
|
||||||
const showSearchForm = ref(true)
|
const showSearchForm = ref(true)
|
||||||
const craftFormIns = useTemplateRef<InstanceType<typeof CraftForm>>('craftForm')
|
const craftFormIns = useTemplateRef<InstanceType<typeof CraftForm>>('craftForm')
|
||||||
|
const craftFlowIns = useTemplateRef<InstanceType<typeof CraftFlow>>('craftFlow')
|
||||||
|
|
||||||
function showDialog(data?: CraftTypes.SearchCraftResult) {
|
function showDialog(data?: CraftTypes.SearchCraftResult) {
|
||||||
craftFormIns.value?.open(data)
|
craftFormIns.value?.open(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
function configCraftFlow(data?: CraftTypes.SearchCraftResult) {
|
||||||
function delHandler({row}: { row: CraftTypes.SearchCraftResult }) {
|
craftFlowIns.value?.open(data)
|
||||||
deling.value = true
|
|
||||||
CraftApi.del([ row.id! ])
|
|
||||||
.then(() => {
|
|
||||||
ElMessage.success('删除成功')
|
|
||||||
paging()
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
deling.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
function modifyHandler({row}: { row: CraftTypes.SearchCraftResult }) {
|
|
||||||
showDialog(row)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addHandler() {
|
function addHandler() {
|
||||||
|
|
@ -157,7 +130,7 @@ function disabledCraftHandler(val: string | number | boolean, id: string) {
|
||||||
searching.value = true
|
searching.value = true
|
||||||
CraftApi.disable(id, val as boolean)
|
CraftApi.disable(id, val as boolean)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ElMessage.success(val ? '禁用成功' : '启用成功')
|
ElMessage.success(val ? '启用成功' : '禁用成功')
|
||||||
paging()
|
paging()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,8 @@
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
class="form-panel"
|
class="form-panel"
|
||||||
label-width="auto">
|
label-width="auto">
|
||||||
<ElFormItem label="编码" prop="sn">
|
|
||||||
<ElInput
|
|
||||||
v-model="formData.sn"
|
|
||||||
:disabled="status === 'view'"
|
|
||||||
placeholder="编码"/>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="产品" prop="goodsId">
|
<ElFormItem label="产品" prop="goodsId">
|
||||||
<ADropTable v-model="formData.goodsId as string" :columns="dropTableColumns" :loader="dropTableLoader" :multiple="true" display-field="goodsName"/>
|
<ADropTable v-model="formData.goodsId as string" :columns="dropTableColumns" :loader="dropTableLoader" display-field="goodsName"/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="工艺名称" prop="craftName">
|
<ElFormItem label="工艺名称" prop="craftName">
|
||||||
<ElInput
|
<ElInput
|
||||||
|
|
@ -36,18 +30,18 @@
|
||||||
<ElOption label="人工" value="RenGong"/>
|
<ElOption label="人工" value="RenGong"/>
|
||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="是否可用" prop="canuse">
|
|
||||||
<ElCheckbox
|
|
||||||
v-model="formData.canuse"
|
|
||||||
:disabled="status === 'view'"
|
|
||||||
placeholder="是否可用"/>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="备注" prop="memo">
|
<ElFormItem label="备注" prop="memo">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="formData.memo"
|
v-model="formData.memo"
|
||||||
:disabled="status === 'view'"
|
:disabled="status === 'view'"
|
||||||
placeholder="备注"/>
|
placeholder="备注"/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
|
<ElFormItem label="是否可用" prop="canuse">
|
||||||
|
<ElCheckbox
|
||||||
|
v-model="formData.canuse"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="是否可用"/>
|
||||||
|
</ElFormItem>
|
||||||
</ElForm>
|
</ElForm>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||||
|
|
@ -78,14 +72,11 @@ const craftFormIns = useTemplateRef<FormInstance>('craftForm')
|
||||||
|
|
||||||
const formData = Utils.resetAble(reactive<CraftTypes.SearchCraftResult>({}))
|
const formData = Utils.resetAble(reactive<CraftTypes.SearchCraftResult>({}))
|
||||||
const rules = reactive<FormRules<CraftTypes.SearchCraftResult>>({
|
const rules = reactive<FormRules<CraftTypes.SearchCraftResult>>({
|
||||||
id: [ {required: true, message: '请填写Id', trigger: 'blur'} ],
|
goodsId: [ {required: true, message: '请选择产品', trigger: 'change'} ],
|
||||||
sn: [ {required: true, message: '请填写编码', trigger: 'blur'} ],
|
|
||||||
goodsId: [ {required: true, message: '请填写终产品 Id', trigger: 'blur'} ],
|
|
||||||
craftName: [ {required: true, message: '请填写工艺名称', trigger: 'blur'} ],
|
craftName: [ {required: true, message: '请填写工艺名称', trigger: 'blur'} ],
|
||||||
craftVer: [ {required: true, message: '请填写工艺版本号', trigger: 'blur'} ],
|
craftVer: [ {required: true, message: '请填写工艺版本号', trigger: 'blur'} ],
|
||||||
craftCategory: [ {required: true, message: '请填写工艺类型;字典编码:craft_category,ZiDongHua-->自动化、RenGong-->人工', trigger: 'blur'} ],
|
craftCategory: [ {required: true, message: '请填写工艺类型', trigger: 'blur'} ],
|
||||||
canuse: [ {required: true, message: '请填写是否可用;0-->否、1-->是', trigger: 'blur'} ],
|
canuse: [ {required: true, message: '请选择是否可用', trigger: 'blur'} ],
|
||||||
memo: [ {required: true, message: '请填写备注', trigger: 'blur'} ],
|
|
||||||
})
|
})
|
||||||
const dropTableColumns = [
|
const dropTableColumns = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue