|
|
|
@ -1,87 +1,43 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="!dataForm.id ? '新建' : '编辑'"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
append-to-body
|
|
|
|
|
:visible.sync="visible"
|
|
|
|
|
class="JNPF-dialog JNPF-dialog_center"
|
|
|
|
|
lock-scroll
|
|
|
|
|
width="850px"
|
|
|
|
|
>
|
|
|
|
|
<el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false" append-to-body :visible.sync="visible"
|
|
|
|
|
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="850px">
|
|
|
|
|
<el-row :gutter="15" class="">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="dataForm"
|
|
|
|
|
:rules="dataRule"
|
|
|
|
|
size="small"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
label-position="right"
|
|
|
|
|
>
|
|
|
|
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
|
|
|
|
label-position="right">
|
|
|
|
|
<template v-if="!loading">
|
|
|
|
|
<!-- 具体表单 -->
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="设备编号" prop="deviceCode">
|
|
|
|
|
<JnpfInput
|
|
|
|
|
v-model="dataForm.deviceCode"
|
|
|
|
|
@change="changeData('deviceCode', -1)"
|
|
|
|
|
placeholder="请输入设备编号"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
<JnpfInput v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)" placeholder="请输入设备编号"
|
|
|
|
|
clearable :disabled="!isDisabled" :style="{ width: '100%' }">
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="设备名称" prop="deviceName">
|
|
|
|
|
<JnpfInput
|
|
|
|
|
v-model="dataForm.deviceName"
|
|
|
|
|
@change="changeData('deviceName', -1)"
|
|
|
|
|
placeholder="请输入设备名称"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)" placeholder="请输入设备名称"
|
|
|
|
|
clearable :style="{ width: '100%' }">
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="所属部门" prop="deviceDept">
|
|
|
|
|
<JnpfDepSelect
|
|
|
|
|
v-model="dataForm.deviceDept"
|
|
|
|
|
@change="changeData('deviceDept', -1)"
|
|
|
|
|
placeholder="请选择所属部门"
|
|
|
|
|
selectType="all"
|
|
|
|
|
:ableIds="ableAll.deviceDeptableIds"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
<JnpfDepSelect v-model="dataForm.deviceDept" @change="changeData('deviceDept', -1)" placeholder="请选择所属部门"
|
|
|
|
|
selectType="all" :ableIds="ableAll.deviceDeptableIds" clearable :style="{ width: '100%' }">
|
|
|
|
|
</JnpfDepSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="设备类型" prop="deivceType">
|
|
|
|
|
<JnpfSelect
|
|
|
|
|
v-model="dataForm.deivceType"
|
|
|
|
|
@change="changeData('deivceType', -1)"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
:options="deivceTypeOptions"
|
|
|
|
|
:props="deivceTypeProps"
|
|
|
|
|
>
|
|
|
|
|
<JnpfSelect v-model="dataForm.deivceType" @change="changeData('deivceType', -1)" placeholder="请选择"
|
|
|
|
|
clearable :style="{ width: '100%' }" :options="deivceTypeOptions" :props="deivceTypeProps">
|
|
|
|
|
</JnpfSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="启用状态" prop="enabledStatus">
|
|
|
|
|
<JnpfSelect
|
|
|
|
|
v-model="dataForm.enabledStatus"
|
|
|
|
|
@change="changeData('enabledStatus', -1)"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
:options="enabledStatusOptions"
|
|
|
|
|
:props="enabledStatusProps"
|
|
|
|
|
>
|
|
|
|
|
<JnpfSelect v-model="dataForm.enabledStatus" @change="changeData('enabledStatus', -1)" placeholder="请选择"
|
|
|
|
|
clearable :style="{ width: '100%' }" :options="enabledStatusOptions" :props="enabledStatusProps">
|
|
|
|
|
</JnpfSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -115,12 +71,7 @@
|
|
|
|
|
<h2>绑定物料列表</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="dataForm.data" size="mini">
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="index"
|
|
|
|
|
width="50"
|
|
|
|
|
label="序号"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column type="index" width="50" label="序号" align="center" />
|
|
|
|
|
<!-- <el-table-column label="序号">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ scope.row.deviceCode }}
|
|
|
|
@ -138,31 +89,15 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="8小时产量">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInputNumber
|
|
|
|
|
v-model="scope.row.eightOutput"
|
|
|
|
|
@change="changeData('eightOutput', -1)"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
:precision="2"
|
|
|
|
|
:step="1"
|
|
|
|
|
:min="0"
|
|
|
|
|
>
|
|
|
|
|
<JnpfInputNumber v-model="scope.row.eightOutput" @change="changeData('eightOutput', -1)"
|
|
|
|
|
placeholder="请输入" clearable :style="{ width: '100%' }" :precision="2" :step="1" :min="0">
|
|
|
|
|
</JnpfInputNumber>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="12小时产量">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInputNumber
|
|
|
|
|
v-model="scope.row.twelveOutput"
|
|
|
|
|
@change="changeData('twelveOutput', -1)"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
:precision="2"
|
|
|
|
|
:step="1"
|
|
|
|
|
:min="0"
|
|
|
|
|
>
|
|
|
|
|
<JnpfInputNumber v-model="scope.row.twelveOutput" @change="changeData('twelveOutput', -1)"
|
|
|
|
|
placeholder="请输入" clearable :style="{ width: '100%' }" :precision="2" :step="1" :min="0">
|
|
|
|
|
</JnpfInputNumber>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -175,25 +110,15 @@
|
|
|
|
|
<!-- 表单结束 -->
|
|
|
|
|
</template>
|
|
|
|
|
</el-form>
|
|
|
|
|
<SelectDialog
|
|
|
|
|
v-if="selectDialogVisible"
|
|
|
|
|
:config="currTableConf"
|
|
|
|
|
:formData="dataForm"
|
|
|
|
|
ref="selectDialog"
|
|
|
|
|
@select="addForSelect"
|
|
|
|
|
@close="selectDialogVisible = false"
|
|
|
|
|
/>
|
|
|
|
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
|
|
|
|
@select="addForSelect" @close="selectDialogVisible = false" />
|
|
|
|
|
</el-row>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="visible = false"> 取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
|
|
|
|
|
确 定</el-button
|
|
|
|
|
>
|
|
|
|
|
确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
<MaterialListDialog
|
|
|
|
|
ref="materialListDialog"
|
|
|
|
|
@cbSltdChg="fnSltdMaterialChg"
|
|
|
|
|
/>
|
|
|
|
|
<MaterialListDialog ref="materialListDialog" @cbSltdChg="fnSltdMaterialChg" />
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -302,6 +227,9 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
isDisabled() {
|
|
|
|
|
return !this.dataForm.id;
|
|
|
|
|
},
|
|
|
|
|
...mapGetters(["userInfo"])
|
|
|
|
|
},
|
|
|
|
|
watch: {},
|
|
|
|
@ -312,6 +240,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
mounted() { },
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
fnMaterialListDialog() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.materialListDialog.init(this.dataForm.data);
|
|
|
|
|