| | |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="overallFlag" label="是否为自动线" :labelCol="{xs: { span: 24 },sm: { span: 8 }}" |
| | | :wrapperCol="{xs: { span: 24 },sm: { span: 16 }}"> |
| | | <j-switch v-model="model.overallFlag"></j-switch> |
| | | <j-switch v-model="model.overallFlag" @change="handleSwitchChange"></j-switch> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | <a-col :span="12"> |
| | | <a-col :span="12" v-if="model.overallFlag==='N'"> |
| | | <a-form-model-item prop="equipmentId" label="生产设备" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-select v-model="model.equipmentId" placeholder="请选择生产设备" style="width: 100%"> |
| | | <a-select v-model="model.equipmentId" placeholder="请选择生产设备" mode="multiple" :maxTagCount="1" |
| | | style="width: 100%" allow-clear> |
| | | <a-select-option v-for="(item,index) in equipmentList" :key="index" :value="item.equipmentId"> |
| | | {{item.equipmentId}} |
| | | </a-select-option> |
| | |
| | | |
| | | |
| | | <template slot="footer"> |
| | | <a-popconfirm title="确定放弃操作?" @confirm="visible=false" okText="确定" cancelText="取消"> |
| | | <a-popconfirm title="确定放弃操作?" @confirm="handleModalClose" okText="确定" cancelText="取消"> |
| | | <a-button style="margin-right: .8rem">取消</a-button> |
| | | </a-popconfirm> |
| | | <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button> |
| | |
| | | edit(record) { |
| | | this.visible = true |
| | | this.model = Object.assign({}, record) |
| | | this.model.equipmentId = this.model.equipmentId.split(',') |
| | | console.log('model', this.model) |
| | | this.getProductionLineByApi() |
| | | this.$nextTick(() => { |
| | |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let obj |
| | | if (!this.model.equipmentId) this.model.equipmentId = '' |
| | | else this.model.equipmentId = this.model.equipmentId.join(',') |
| | | if (this.title == '新增') { |
| | | obj = api.addSparePartApi(this.model) |
| | | } else { |
| | |
| | | this.getEquipmentListByProductionId() |
| | | }, |
| | | |
| | | handleSwitchChange(value) { |
| | | console.log('value', value) |
| | | if (value === 'Y') delete this.model.equipmentId |
| | | }, |
| | | |
| | | getEquipmentListByProductionId() { |
| | | api.getEquipmentListByProductionIdApi(this.model.productionId) |
| | | .then(res => { |
| | |
| | | handleModalClose() { |
| | | this.visible = false |
| | | this.equipmentList = [] |
| | | this.removeValidate() |
| | | }, |
| | | |
| | | /** |