| | |
| | | @change="handleTableChange" |
| | | :loading="loading" |
| | | > |
| | | |
| | | <template |
| | | v-for="col in columns" |
| | | :slot="col.dataIndex" |
| | | slot-scope='text, record, index' |
| | | > |
| | | <div :key="col.dataIndex"> |
| | | <a-input-search |
| | | v-if="col.dataIndex == 'materialName'" |
| | | enter-button |
| | | @search="onSearchMaterial(index)" |
| | | <a-input |
| | | :value="text" |
| | | :read-only="true" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | v-if="col.dataIndex == 'sparePartId'" |
| | | auto-size |
| | | placeholder="请输入物料名称" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="dailyMaintenanceOrderStatus!='4'" |
| | | /> |
| | | <a-input |
| | | :value="text" |
| | | v-if="col.dataIndex == 'smoamUda2'" |
| | | auto-size |
| | | placeholder="请输入单位" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="dailyMaintenanceOrderStatus!='4'" |
| | | /> |
| | | <j-dict-select-tag |
| | | :value='text' |
| | | v-if="col.dataIndex == 'smoamUda1'" |
| | | dictCode="material_type" |
| | | style="width: 100%;" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="dailyMaintenanceOrderStatus!='4'" |
| | | /> |
| | | <a-input-number |
| | | :value="text" |
| | |
| | | :min="1" |
| | | :max="99999" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="record.isLock == 'yes'||dailyMaintenanceOrderStatus!='4'" |
| | | :disabled="dailyMaintenanceOrderStatus!='4'" |
| | | /> |
| | | |
| | | </div> |
| | | </template> |
| | | <span |
| | | slot='action' |
| | | slot-scope='text, record' |
| | | slot-scope='text, record,index' |
| | | > |
| | | <a-popconfirm |
| | | title="确认锁料吗?" |
| | | @confirm="() => handleLock(record)" |
| | | dailyMaintenanceOrder:actualMaterialLock |
| | | > |
| | | <a |
| | | v-has="'dailyMaintenanceOrder:actualMaterialLock'" |
| | | v-if="record.isLock=='no'&&dailyMaintenanceOrderStatus=='4'" |
| | | >锁料</a> |
| | | </a-popconfirm> |
| | | <a-divider |
| | | v-if="record.isLock=='no'" |
| | | type="vertical" |
| | | /> |
| | | <a-popconfirm |
| | | title="解锁后会自动释放库存,确认解锁吗?" |
| | | @confirm="() => handleUnLock(record)" |
| | | > |
| | | <a |
| | | v-has="'dailyMaintenanceOrder:actualMaterialLock'" |
| | | v-if="record.isLock=='yes'&&dailyMaintenanceOrderStatus=='4'" |
| | | >解锁</a> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | title="确定删除吗?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a |
| | | v-has="'dailyMaintenanceOrder:actualMaterialDelete'" |
| | | v-if="record.isLock=='no'&&dailyMaintenanceOrderStatus=='4'" |
| | | >删除</a> |
| | | </a-popconfirm> |
| | | <a |
| | | :disabled="dailyMaintenanceOrderStatus!='4'" |
| | | @click='handleDeleteFake(index)' |
| | | >删除</a> |
| | | <!-- :disabled="mainId.status=='4'" --> |
| | | </span> |
| | | </a-table> |
| | | <a-button |
| | |
| | | type="primary" |
| | | :style="{marginRight: '8px'}" |
| | | :disabled="specialyMaintenanceOrderStatus!='4'" |
| | | >暂存</a-button> |
| | | >暂存</a-button> --> |
| | | <a-button |
| | | @click="handleOk(0)" |
| | | type="primary" |
| | | :disabled="specialyMaintenanceOrderStatus!='4'" |
| | | >保存</a-button> --> |
| | | :disabled="dailyMaintenanceOrderStatus!='4'" |
| | | >保存</a-button> |
| | | </a-row> |
| | | <!-- :disabled="false" --> |
| | | </div> |
| | | <actual-material-select ref="actualMaterialSelect"> |
| | | <!-- @sendMaterialRecord="sendMaterialRecord" --> |
| | | </actual-material-select> |
| | | <j-select-spare-part-modal ref='JSelectSparePartModal' @selection2Rows="getSelectRows"></j-select-spare-part-modal> |
| | | <j-select-spare-part-modal |
| | | ref='JSelectSparePartModal' |
| | | @selection2Rows="getSelectRows" |
| | | ></j-select-spare-part-modal> |
| | | </a-card> |
| | | </template> |
| | | <script> |
| | |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: '领料出库单', |
| | | dataIndex: 'num', |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | width: 150, |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: '备件编码', |
| | | dataIndex: 'sparePartNum', |
| | | title: '物料名称', |
| | | dataIndex: 'sparePartId', |
| | | scopedSlots: { customRender: 'sparePartId' }, |
| | | align: "center", |
| | | |
| | | // className: 'red', |
| | | // width: 250, |
| | | }, |
| | | { |
| | | title: '备件名称', |
| | | dataIndex: 'sparePartName', |
| | | title: '物料种类', |
| | | dataIndex: 'smoamUda1', |
| | | scopedSlots: { customRender: 'smoamUda1' }, |
| | | align: "center", |
| | | |
| | | }, |
| | | { |
| | | title: '规格', |
| | | dataIndex: 'specification', |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: '型号', |
| | | dataIndex: 'model', |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: '制造商', |
| | | dataIndex: 'constructorName', |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: '主单位', |
| | | dataIndex: 'mainUnitName', |
| | | align: "center", |
| | | |
| | | }, |
| | | { |
| | | title: '主数量', |
| | | align: 'center', |
| | | dataIndex: 'mainQuantity' |
| | | }, |
| | | { |
| | | title: '可用数量', |
| | | align: 'center', |
| | | dataIndex: 'availableQuantity' |
| | | // width: 250, |
| | | }, |
| | | { |
| | | title: '使用数量', |
| | | dataIndex: 'quantity', |
| | | align: "center", |
| | | scopedSlots: { customRender: 'quantity' }, |
| | | className: 'red', |
| | | |
| | | // className: 'red', |
| | | }, |
| | | { |
| | | title: '单位', |
| | | dataIndex: 'smoamUda2', |
| | | |
| | | align: "center", |
| | | scopedSlots: { customRender: 'smoamUda2' }, |
| | | // className: 'red', |
| | | }, |
| | | |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | width: 250, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | |
| | | unLock: "/eam/maintenanceOrderActualMaterial/unLock" |
| | | }, |
| | | changeIndex: 0, |
| | | loading:false, |
| | | loading: false, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | // } |
| | | // } |
| | | }, |
| | | // created() { |
| | | // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId; |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.loadData(1); |
| | | // }, |
| | | created() { |
| | | this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId; |
| | | this.queryParam['equipmentId'] = this.equipmentId |
| | | this.loadData(1); |
| | | }, |
| | | methods: { |
| | | // addMaterial() { |
| | | // let ids = []; |
| | | // for (let i = 0; i < this.dataSource.length; i++) { |
| | | // ids.push(this.dataSource[i].outboundOrderDetailId); |
| | | // } |
| | | // this.$refs.JSelectSparePartModal.showModals(ids); |
| | | // this.$refs.JSelectSparePartModal.title = '选择备件信息' |
| | | // this.$refs.JSelectSparePartModal.disableSubmit = false |
| | | // }, |
| | | addMaterial() { |
| | | let ids = []; |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].outboundOrderDetailId); |
| | | } |
| | | this.$refs.JSelectSparePartModal.showModals(ids); |
| | | this.$refs.JSelectSparePartModal.title = '选择备件信息' |
| | | this.$refs.JSelectSparePartModal.disableSubmit = false |
| | | this.dataSource.push({ sparePartId: '', smoamUda1: '', smoamUda2: '', quantity: '', repairOrderId: this.equipmentId }) |
| | | }, |
| | | handleCancel() { |
| | | this.$bus.$emit('closeDrawer'); |
| | |
| | | if (saveStatus == 0) { |
| | | let materialDataSource = that.dataSource; |
| | | let indexIdList = []; |
| | | for (let i = 0; i < materialDataSource.length; i++) { |
| | | if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') { |
| | | that.$message.warning("请选择第" + (i + 1) + "行物料!"); |
| | | return false; |
| | | } |
| | | if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') { |
| | | that.$message.warning("请填写第" + (i + 1) + "行用料数!"); |
| | | return false; |
| | | } |
| | | } |
| | | // for (let i = 0; i < materialDataSource.length; i++) { |
| | | // if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') { |
| | | // that.$message.warning("请选择第" + (i + 1) + "行物料!"); |
| | | // return false; |
| | | // } |
| | | // if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') { |
| | | // that.$message.warning("请填写第" + (i + 1) + "行用料数!"); |
| | | // return false; |
| | | // } |
| | | // } |
| | | } |
| | | if (that.dataSource.length === 0) { |
| | | that.$message.warning("请添加物料!") |
| | |
| | | console.log(column) |
| | | const temp = [...this.dataSource] |
| | | const target = temp[index] |
| | | let availableQuantity = target['availableQuantity'] |
| | | if (target) { |
| | | if (value != undefined && value != null && value != '' && availableQuantity < value) { |
| | | this.$message.error('使用数量不能大于可用数量!') |
| | | } else { |
| | | } |
| | | target[column.dataIndex] = value |
| | | this.dataSource = temp |
| | | // let availableQuantity = target['availableQuantity'] |
| | | // if (target) { |
| | | // if (value != undefined && value != null && value != '' && availableQuantity < value) { |
| | | // this.$message.error('使用数量不能大于可用数量!') |
| | | // } else { |
| | | // } |
| | | // target[column.dataIndex] = value |
| | | // this.dataSource = temp |
| | | // } |
| | | if ('sparePartId' == column.dataIndex) { |
| | | target['sparePartId'] = value.target.value |
| | | } |
| | | if ('smoamUda2' == column.dataIndex) { |
| | | target['smoamUda2'] = value.target.value |
| | | } |
| | | if ('quantity' == column.dataIndex) { |
| | | target['quantity'] = value |
| | | } |
| | | if ('smoamUda1' == column.dataIndex) { |
| | | target['smoamUda1'] = value |
| | | } |
| | | }, |
| | | onSearchMaterial(index) { |
| | |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | getSelectRows(data){ |
| | | getSelectRows(data) { |
| | | let newActualMaterials = []; |
| | | for (let i = 0; i < data.length; i++) { |
| | | newActualMaterials.push({ |