| | |
| | | <template> |
| | | <el-dialog :title="titleMap[mode]" v-model="visible" :width="800" destroy-on-close @closed="$emit('closed')"> |
| | | <el-form :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" label-width="120px" |
| | | label-position="center"> |
| | | <el-form v-if="visible" :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" |
| | | label-width="120px" label-position="center"> |
| | | <el-row> |
| | | <el-col :span="24" style="padding:12px 0;"> |
| | | 基础信息 |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工位编号" prop="code"> |
| | | <el-input style="width: 240px" :disabled="form.id" v-model="form.code" placeholder="工位编号" |
| | | <el-input style="width: 240px" :disabled="!!form.id" v-model="form.code" placeholder="工位编号" |
| | | clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工位类型" prop="type"> |
| | | <el-select v-model="form.type" style="width: 240px" :disabled="form.id"> |
| | | <el-select v-model="form.type" style="width: 240px" :disabled="!!form.id"> |
| | | <el-option v-for="item in options.types" :key="item.value" :label="item.label" |
| | | :value="item.value" /> |
| | | </el-select> |
| | |
| | | <el-col :span="12" v-if="form.type == 0 && !form.id"> |
| | | <el-form-item label="选择机器" prop="linkWay"> |
| | | <el-radio-group v-model="form.linkWay"> |
| | | <el-radio v-for="item in options.linkWays" :key="item.value" |
| | | :label="item.value">{{ item.label }}</el-radio> |
| | | <el-radio v-for="item in options.linkWays" :key="item.value" :label="item.value">{{ |
| | | item.label }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item label="程序传输方式" prop="transmissionMethod"> |
| | | <el-select v-model="form.transmissionMethod" style="width: 240px"> |
| | | <el-option label="FTP" :value="1" /> |
| | |
| | | :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="12" v-if="form.ftpDirectoryType == 1"> |
| | | <el-form-item label="关联目录" prop="directoryId"> |
| | | <el-select v-model="form.directoryId" style="width: 240px"> |
| | |
| | | methods: { |
| | | //显示 |
| | | open(mode = 'add', params) { |
| | | this.isSaveing = false; |
| | | this.mode = mode; |
| | | this.visible = true; |
| | | |
| | | console.log('---------', params) |
| | | if (params) { |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = params[key] |
| | |
| | | }) |
| | | } else { |
| | | this.form.id = '' |
| | | this.form.workbenchVOList = [] |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = '' |
| | | }) |
| | |
| | | }, |
| | | //表单提交方法 |
| | | submit() { |
| | | if (!this.form.workbenchVOList) { |
| | | this.form.workbenchVOList = [] |
| | | } |
| | | if (this.mode === 'add' && this.form.linkWay === 1) { |
| | | this.form.machineId |
| | | this.form.machineCode = this.form.code |
| | | this.form.machineName = this.form.name |
| | | } |
| | | this.$refs.dialogForm.validate(async (valid) => { |
| | | if (valid) { |
| | | this.isSaveing = true; |
| | | var res = await this.$API.workstation.add.post(this.form); |
| | | try { |
| | | var res = await this.$API.workstation.add.post(this.form); |
| | | } catch (error) { |
| | | this.isSaveing = false; |
| | | } |
| | | this.isSaveing = false; |
| | | if (res.code == 200) { |
| | | this.$emit('success', this.form, this.mode) |
| | |
| | | }) |
| | | }, |
| | | addWork() { |
| | | if (!this.form.workbenchVOList) { |
| | | this.form.workbenchVOList = [] |
| | | } |
| | | this.form.workbenchVOList.push({ |
| | | sort: this.form.workbenchVOList.length + 1, |
| | | name: '' |