| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <template>
- <el-dialog
- :model-value="modelValue"
- :title="`修正工单实际投料(${props?.['date']})`"
- fullscreen
- :before-close="()=>{emits('update:modelValue', false )}"
- >
- <el-button
- type="primary"
- style="width:80px; height: 40px;margin-bottom: 20px"
- @click="handleUpdate"
- >更新</el-button>
- <el-button
- type="primary"
- style="width:80px; height: 40px;margin-bottom: 20px"
- @click="handleSearch"
- >定位</el-button>
- <el-button
- type="primary"
- style="width:80px; height: 40px;margin-bottom: 20px"
- @click="emits('update:modelValue', false )"
- >退出</el-button>
- <el-table
- ref="table"
- highlight-current-row
- show-overflow-tooltip
- border
- :data="tableData"
- :row-style="{ height: '25px' }"
- :cell-style="{ padding: '0px' }"
- :header-row-style="{ height: '20px' }"
- :header-cell-style="{ padding: '0px' }"
- style="width: 100%;height: 75vh;"
- @selection-change="handleSelectionChange"
- >
- <el-table-column
- type="selection"
- width="55"
- />
- <el-table-column
- label="工单编号"
- prop="Gd_gdbh"
- width="100"
- />
- <el-table-column
- label="印件号"
- prop="yj_Yjno"
- width="100"
- />
- <el-table-column
- label="印件代号"
- prop="yj_yjdh"
- width="100"
- />
- <el-table-column
- label="开数*联数"
- prop="yj_ls"
- width="120"
- />
- <el-table-column
- label="物料代码"
- prop="yj_zzdh"
- width="100"
- />
- <el-table-column
- label="物料名称"
- prop="BOM_物料名称"
- width="250"
- />
- <el-table-column
- label="规格"
- prop="yj_tlgg"
- width="100"
- />
- <el-table-column
- label="领用单位"
- prop="BOM_投料单位"
- width="100"
- />
- <el-table-column
- label="订单数量(万张)"
- prop="订单数量"
- width="150"
- />
- <el-table-column
- label="当前投料"
- prop="yj_平张投料"
- width="100"
- />
- <el-table-column
- label="实际用量"
- prop="BOM_实际用量"
- width="100"
- />
- <el-table-column
- label="换算率"
- prop=""
- width="100"
- />
- <el-table-column
- label="折算投料(万张)"
- width="150"
- >
- <template #default="{ row }">
- <el-input v-model="row['实际投料']" />
- </template>
- </el-table-column>
- <el-table-column
- label="投料确认"
- prop="投料确认"
- width="200"
- />
- </el-table>
- </el-dialog>
- </template>
- <script>
- export default {
- name: 'Xzgdtl',
- }
- // 5.1修正工单实际投料-获取列表
- import service from '@/utils/request'
- const getOrderFeedList = (params) => {
- return service({
- url: '/mes_server/order_super_loss/getOrderFeedList',
- method: 'get',
- params
- })
- }
- // 5.2更新工单实际投料
- const updateOrderFeed = (data) => {
- return service({
- url: '/mes_server/order_super_loss/updateOrderFeed',
- method: 'post',
- data
- })
- }
- </script>
- <script setup>
- import { ElMessage, ElMessageBox } from 'element-plus'
- import { watch, ref, reactive, defineProps, defineEmits, onBeforeUnmount } from 'vue'
- const props = defineProps(['modelValue', 'gdbh','yjno'])
- const emits = defineEmits(['update:modelValue'])
- const tableData = ref([])
- const table = ref(null)
- const multipleSelection = ref([])
- const getTable = async() => {
- let params
- if (props?.['gdbh']) {
- const { gdbh,yjno } = props
- params = {
- workorder: gdbh,
- yjno: yjno,
- }
- } else {
- return
- }
- const res = await getOrderFeedList(params)
- if (res['code'] === 0) {
- const { data } = res
- tableData.value = data
- }
- }
- getTable()
- const handleSelectionChange = (val) => {
- multipleSelection.value = val
- }
- const handleSearch = () => {
- ElMessageBox.prompt('输入工单编号', '定位', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- })
- .then(({ value }) => {
- console.log(value)
- if (!value) {
- getTable()
- } else {
- tableData.value = tableData.value.filter(item => {
- return item['Gd_gdbh'] === value ?? item
- })
- }
- ElMessage({
- type: 'success',
- message: '定位',
- })
- })
- .catch(() => {
- ElMessage({
- type: 'info',
- message: '取消',
- })
- })
- }
- const handleUpdate = async() => {
- if (multipleSelection.value.length === 0) {
- console.log('未选择行')
- return
- }
- const params = multipleSelection.value.map(item => ({
- UniqId: item['UniqId'],
- number: item['实际投料'],
- }))
- const res = await updateOrderFeed(params)
- if (res['code'] === 0) {
- ElMessage({
- type: 'success',
- message: '更新成功',
- })
- }
- }
- </script>
- <style scoped>
- </style>
|