Files
wuHanXinRui/mes/qd/src/views/wms/ql/physicalMstConfirm/PhySyncDialog.vue
2022-08-25 11:08:08 +08:00

146 lines
4.1 KiB
Vue

<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.material_code"
clearable
size="mini"
placeholder="编码"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="批次">
<el-input
v-model="query.pcsn"
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%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="inspection_code" label="单据编码" width="130px" />
<el-table-column show-overflow-tooltip prop="inspection_type" label="单据类型" width="130px" :formatter="formatType"/>
<el-table-column show-overflow-tooltip prop="biz_date" label="业务日期" width="130px" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="130px" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" width="130px" />
<el-table-column show-overflow-tooltip prop="confirm_optcode" label="确认人编码" width="130px" />
<el-table-column show-overflow-tooltip prop="confirm_time" label="确认时间" width="130px" />
<el-table-column show-overflow-tooltip prop="check_result" label="结果" width="130px" :formatter="formatResult"/>
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" icon="el-icon-refresh" @click="hpySync"> </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 crudPhysicalMst from '@/api/wms/ql/physicalMst'
export default {
name: 'DeviceDialog',
dicts: ['QC_RESULT_LHZJD'],
components: { rrOperation, pagination },
cruds() {
return CRUD({
title: 'erp理化信息',
optShow: {},
url: 'api/physicalMst/erpPhyQuery',
idField: 'inspection_id',
sort: '',
crudMethod: { ...crudPhysicalMst }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
// this.crud.resetQuery()
// this.$emit('update:dialogShow', false)
this.$parent._data.phySyncShow = false
},
formatType(row) {
if (row.inspection_type === '10') {
return '原料碳化钨'
} else if (row.inspection_type === '20') {
return '原料碳钴粉'
} else if (row.inspection_type === '30') {
return '成品混合料'
}
},
formatResult(row) {
return this.dict.label.QC_RESULT_LHZJD[row.check_result]
},
hpySync() {
const _selectData = this.$refs.table.selection
if (_selectData.length === 0) {
return this.crud.notify('请至少选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = {
'data': _selectData
}
crudPhysicalMst.hpySync(data).then(res => {
this.close()
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}
}
}
</script>