|
|
@@ -0,0 +1,269 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ :model-value="modelValue"
|
|
|
+ :title="`修正工单类型`"
|
|
|
+ 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="success"
|
|
|
+ style="width:80px; height: 40px;margin-bottom: 20px"
|
|
|
+ @click="handlecreate"
|
|
|
+ >新增</el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ style="width:80px; height: 40px;margin-bottom: 20px"
|
|
|
+ @click="oncreate"
|
|
|
+ >保存</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="Yj_gdbh"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="印件号"
|
|
|
+ prop="yj_Yjno"
|
|
|
+ width="73"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="印件代号"
|
|
|
+ prop="yj_Yjdh"
|
|
|
+ width="140"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="印件名称"
|
|
|
+ prop="yj_yjmc"
|
|
|
+ width="300"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="工单类型"
|
|
|
+ prop="工单类型"
|
|
|
+ width="150"
|
|
|
+>
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-select v-model="row['工单类型']">
|
|
|
+ <el-option label="国外" value="国外" />
|
|
|
+ <el-option label="国内" value="国内" />
|
|
|
+ <el-option label="不结算" value="不结算" />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+</el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'Xzgdtl',
|
|
|
+}
|
|
|
+import service from '@/utils/request'
|
|
|
+
|
|
|
+// 获取工单类型
|
|
|
+const getWorkorderStatus = (params) => {
|
|
|
+ return service({
|
|
|
+ url: '/mes_server/order_super_loss/getWorkorderStatus',
|
|
|
+ method: 'get',
|
|
|
+ params
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 修改工单类型
|
|
|
+const updateWorkorderStatus = (params) => {
|
|
|
+ return service({
|
|
|
+ url: '/mes_server/order_super_loss/updateWorkorderStatus',
|
|
|
+ method: 'get',
|
|
|
+ params
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import { watch, ref, reactive, defineProps, defineEmits, onBeforeUnmount } from 'vue'
|
|
|
+import { useUserStore } from '@/pinia/modules/user'
|
|
|
+const userStore = useUserStore()
|
|
|
+const sys_id='['+userStore.userInfo.userName+'/'+userStore.userInfo.nickName+']'
|
|
|
+
|
|
|
+const props = defineProps(['modelValue', 'gdbh','yjno'])
|
|
|
+const emits = defineEmits(['update:modelValue','update-data'])
|
|
|
+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 getWorkorderStatus(params)
|
|
|
+ if (res.code === 0) {
|
|
|
+ tableData.value = [res.data]
|
|
|
+ }
|
|
|
+ console.log(tableData.value)
|
|
|
+}
|
|
|
+getTable()
|
|
|
+
|
|
|
+const handleSelectionChange = (val) => {
|
|
|
+ multipleSelection.value = val
|
|
|
+ console.log(multipleSelection.value)
|
|
|
+}
|
|
|
+
|
|
|
+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() => {
|
|
|
+ console.log(multipleSelection.value)
|
|
|
+ if (multipleSelection.value.length === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '未选择行',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = ({
|
|
|
+ workorder: multipleSelection.value[0]['Yj_gdbh'],
|
|
|
+ yjno: multipleSelection.value[0]['yj_Yjno'],
|
|
|
+ status: multipleSelection.value[0]['工单类型'],
|
|
|
+ })
|
|
|
+ console.log(params)
|
|
|
+ const res = await updateWorkorderStatus(params)
|
|
|
+ if (res['code'] === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '更新成功',
|
|
|
+ })
|
|
|
+ emits('update-data', false);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// const Iscreate = ref(false)
|
|
|
+// const handlecreate = async() => {
|
|
|
+// console.log(tableData.value.length)
|
|
|
+// if (tableData.value.length != 0) {
|
|
|
+// ElMessage({
|
|
|
+// type: 'error',
|
|
|
+// message: '已有投料记录,无法新增',
|
|
|
+// })
|
|
|
+// return
|
|
|
+// }else{
|
|
|
+// const res = await getFeedList({
|
|
|
+// workorder: props?.['gdbh'],
|
|
|
+// yjno: props?.['yjno'],
|
|
|
+// })
|
|
|
+// if (res.code === 0) {
|
|
|
+// tableData.value = res.data.map(item => ({
|
|
|
+// ...item,
|
|
|
+// 单位: item.BOM_投料单位 || '张' // 设置默认值
|
|
|
+// }))
|
|
|
+// }
|
|
|
+// Iscreate.value = true
|
|
|
+// }
|
|
|
+// }
|
|
|
+// const oncreate = async() => {
|
|
|
+// if(!Iscreate.value){
|
|
|
+// ElMessage({
|
|
|
+// type: 'error',
|
|
|
+// message: '请先新增投料记录',
|
|
|
+// })
|
|
|
+// return
|
|
|
+// }
|
|
|
+// if (tableData.value[0]['实际投料'] === undefined) {
|
|
|
+// ElMessage({
|
|
|
+// type: 'error',
|
|
|
+// message: '未输入投料数量',
|
|
|
+// })
|
|
|
+// return
|
|
|
+// }else{const params = {
|
|
|
+// st_gdbh: tableData.value[0]['Gd_gdbh'],
|
|
|
+// st_wlbh: tableData.value[0]['yj_zzdh'],
|
|
|
+// st_sl: tableData.value[0]['实际投料'],
|
|
|
+// st_dw:tableData.value[0]['单位'],
|
|
|
+// sys_id:userStore.userInfo.nickName,
|
|
|
+// cpdh:tableData.value[0]['yj_yjdh'],
|
|
|
+// }
|
|
|
+// console.log(params)
|
|
|
+// const res = await feedAdd(params)
|
|
|
+// if (res['code'] === 0) {
|
|
|
+// ElMessage({
|
|
|
+// type: 'success',
|
|
|
+// message: '新增成功',
|
|
|
+// })
|
|
|
+// emits('update-data', false);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|