|
|
@@ -1,220 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="dialog">
|
|
|
- <el-dialog
|
|
|
- v-model="dialogVisible"
|
|
|
- :title="dialogTitle"
|
|
|
- width="500"
|
|
|
- draggable
|
|
|
- @close="closeDialog()"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="formRef"
|
|
|
- :model="formData"
|
|
|
- :rules="rules"
|
|
|
- label-width="150"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item prop="machineName" label="机台名称">
|
|
|
- <el-input v-model="formData.machineName"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item prop="machineSize" label="机台规格">
|
|
|
- <el-input v-model="formData.machineSize"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item prop="psSize" label="ps版规格">
|
|
|
- <el-input v-model="formData.psSize"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item prop="psSize" label="默认版芯">
|
|
|
- <el-select v-model="formData.idDefaultPlateTemplate" placeholder="请选择" style="width: 320px">
|
|
|
- <el-option
|
|
|
- v-for="type in optionsList"
|
|
|
- :key="type.id"
|
|
|
- :label="type.name"
|
|
|
- :value="type.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-col :span="24">-->
|
|
|
-<!-- <el-form-item prop="idMachineType" label="机型">-->
|
|
|
-<!-- <el-select v-model="formData.idMachineType">-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="item in machineTypes"-->
|
|
|
-<!-- :key="item.id"-->
|
|
|
-<!-- :label="item.typeName"-->
|
|
|
-<!-- :value="item.id"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-select>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-<!-- <el-row>-->
|
|
|
-<!-- <el-col :span="24">-->
|
|
|
-<!-- <el-form-item prop="systemType" label="机台类型">-->
|
|
|
-<!-- <el-radio-group v-model="formData.systemType">-->
|
|
|
-<!-- <el-radio :value="0">彩色</el-radio>-->
|
|
|
-<!-- <el-radio :value="1">单色</el-radio>-->
|
|
|
-<!-- </el-radio-group>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- </el-row>-->
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item prop="calcBurdenFlag" label="参与机台负荷统计">
|
|
|
- <el-radio-group v-model="formData.calcBurdenFlag">
|
|
|
- <el-radio :value="0">否</el-radio>
|
|
|
- <el-radio :value="1">是</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <template #footer>
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button v-throttle type="primary" @click="handleSubmit">确 定</el-button>
|
|
|
- <el-button @click="closeDialog()">取 消</el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-<script setup lang="ts">
|
|
|
-import type {FormInstance} from 'element-plus'
|
|
|
-import {addMachineInfo, getMachineInfo, updateMachineInfo,getPlateSizeTemplateSelectList} from "@/api/baseInfo/machineInfo";
|
|
|
-import {getAllEnableMachineType} from "@/api/baseInfo/machineType";
|
|
|
-
|
|
|
-let dialogVisible = ref(false)
|
|
|
-let dialogTitle = ref("")
|
|
|
-const formRef = ref<FormInstance>()
|
|
|
-let optionsList = ref(new Array<any>())
|
|
|
-const emit = defineEmits(['dialogChange'])
|
|
|
-const formData = reactive({
|
|
|
- calcBurdenFlag: 1,
|
|
|
- idMachineType: 0,
|
|
|
- machineSize:"",
|
|
|
- idDefaultPlateTemplate:"",
|
|
|
- psSize:"",
|
|
|
- machineName: '',
|
|
|
- systemType: 0,
|
|
|
- id: ""
|
|
|
-})
|
|
|
-const rules = reactive({
|
|
|
- machineName: [{required: true, message: "请输入机台名称", trigger: "blur"}],
|
|
|
-});
|
|
|
-const machineTypes = ref([]);
|
|
|
-
|
|
|
-function initMachineTypes() {
|
|
|
- getAllEnableMachineType({}).then(response => {
|
|
|
- if (response.httpCode == 200) {
|
|
|
- const data = response.data
|
|
|
- Object.assign(machineTypes.value, data);
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-function handleSubmit() {
|
|
|
- formRef.value.validate((valid: any) => {
|
|
|
- if (valid) {
|
|
|
- const itemId = formData.id;
|
|
|
- if (itemId) {
|
|
|
- //修改
|
|
|
- const postData = JSON.stringify(formData)
|
|
|
- const params = {
|
|
|
- "machineInfo": postData,
|
|
|
- }
|
|
|
- updateMachineInfo(params).then((response) => {
|
|
|
- dialogVisible.value = false
|
|
|
- if (response.httpCode == 200) {
|
|
|
- emit('dialogChange');
|
|
|
- ElMessage.success("操作成功");
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- //增加
|
|
|
- const postData = JSON.stringify(formData)
|
|
|
- const params = {
|
|
|
- "machineInfo": postData,
|
|
|
- }
|
|
|
- addMachineInfo(params).then((response) => {
|
|
|
- dialogVisible.value = false
|
|
|
- if (response.httpCode == 200) {
|
|
|
- emit('dialogChange');
|
|
|
- ElMessage.success("操作成功");
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
-/** 重置表单 */
|
|
|
-function resetForm() {
|
|
|
- formRef.value.resetFields();
|
|
|
- formData.id = ''
|
|
|
-}
|
|
|
-
|
|
|
-/**关闭弹窗 */
|
|
|
-function closeDialog() {
|
|
|
- dialogVisible.value = false
|
|
|
- formRef.value.resetFields();
|
|
|
- formData.id = undefined;
|
|
|
-}
|
|
|
-
|
|
|
-function getItemData(item) {
|
|
|
- const data = {
|
|
|
- idMachineInfo: item
|
|
|
- }
|
|
|
- getMachineInfo(data).then(response => {
|
|
|
- if (response.httpCode == 200) {
|
|
|
- const data = response.data
|
|
|
- Object.assign(formData, {...data});
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-//获取版心档案
|
|
|
-function getOptionsList() {
|
|
|
- const data = {}
|
|
|
- getPlateSizeTemplateSelectList(data).then((response) => {
|
|
|
- if (response.httpCode == 200) {
|
|
|
- console.log("5445",response);
|
|
|
- const { data } = response
|
|
|
- optionsList.value = data
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-onMounted(() => {
|
|
|
- initMachineTypes();
|
|
|
- if(optionsList.value.length<=0){
|
|
|
- getOptionsList()
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
-defineExpose({
|
|
|
- dialogVisible,
|
|
|
- dialogTitle,
|
|
|
- getItemData,
|
|
|
- resetForm
|
|
|
-})
|
|
|
-</script>
|
|
|
-
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-
|
|
|
-</style>
|