代码更新
This commit is contained in:
@@ -128,4 +128,12 @@ export function getFileBom(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom }
|
||||
export function submitReceive(data) {
|
||||
return request({
|
||||
url: 'api/devicerepairmst/submitReceive',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive }
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<el-table-column show-overflow-tooltip prop="sparepart_only_id" label="备件唯一标识" align="center" />
|
||||
<el-table-column prop="change_only_id" label="更换备件唯一标识" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.change_only_id" class="input-with-select"/>
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.change_only_id" @focus="addIvt(scope.$index, scope.row)" class="input-with-select"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
@@ -107,6 +107,7 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<BomDialog :dialog-show.sync="bomShow" :is-single="true" @tableChanged2="tableChanged2"/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -114,10 +115,11 @@
|
||||
|
||||
import crudDevicerepairmst from '@/api/wms/sb/devicerepairmst'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import BomDialog from '@/views/wms/sb/repair/devicerepairpa/BomDialog'
|
||||
|
||||
export default {
|
||||
name: 'AddChangeDialog',
|
||||
components: { },
|
||||
components: { BomDialog },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -133,6 +135,9 @@ export default {
|
||||
form4: {},
|
||||
normBomData: [],
|
||||
fileBom: [],
|
||||
fileBomJson: null,
|
||||
fileBomindex: null,
|
||||
bomShow: false,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
@@ -166,6 +171,7 @@ export default {
|
||||
'material_id': row.material_id,
|
||||
'qty': row.qty,
|
||||
'repair_item_id': this.form4.repair_item_id,
|
||||
'repair_dtl_id': this.form4.repair_dtl_id,
|
||||
'device_id': this.form4.device_id,
|
||||
'device_code': this.form4.device_code
|
||||
}
|
||||
@@ -181,6 +187,21 @@ export default {
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', rows)
|
||||
},
|
||||
addIvt(index, row) {
|
||||
this.bomShow = true
|
||||
this.fileBomJson = row
|
||||
this.fileBomindex = index
|
||||
},
|
||||
tableChanged2(row) {
|
||||
debugger
|
||||
const arr = this.fileBom
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (i === this.fileBomindex) {
|
||||
arr[i].change_only_id = row.sparepart_only_id
|
||||
}
|
||||
}
|
||||
this.fileBom = arr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
153
mes/qd/src/views/wms/sb/repair/devicerepairpa/BomDialog.vue
Normal file
153
mes/qd/src/views/wms/sb/repair/devicerepairpa/BomDialog.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.sparepart_only_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="唯一标识"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="sparepart_only_id" label="唯一标识" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批次号" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="数量" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="qty_unit_name" label="单位" min-width="130" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudDevicerepairmst from '@/api/wms/sb/devicerepairmst'
|
||||
|
||||
export default {
|
||||
name: 'Device',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '备件Bom',
|
||||
url: 'api/devicerepairmst/queryBom',
|
||||
crudMethod: { ...crudDevicerepairmst }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
checkrow: null,
|
||||
rows: [],
|
||||
XLList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (this.isSingle) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选设备')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -234,18 +234,28 @@ export default {
|
||||
this.form3.repair_item_code = row.repair_item_code
|
||||
this.form3.repair_item_id = row.repair_item_id
|
||||
this.form3.repair_item_name = row.repair_item_name
|
||||
this.form3.repair_dtl_id = row.repair_dtl_id
|
||||
this.form3.device_id = row.device_id
|
||||
},
|
||||
tableChanged(rows) {
|
||||
debugger
|
||||
const arr = rows
|
||||
arr.forEach((item) => {
|
||||
this.tableData.push(item)
|
||||
})
|
||||
},
|
||||
submitReceive() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0) {
|
||||
const data = {
|
||||
'tableData': this.tableData,
|
||||
'mst': this.form3
|
||||
}
|
||||
if (this.tableData.length === 0) {
|
||||
return this.crud.notify('设备bom不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicerepairmst.submitReceive(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user