数据流转调整
This commit is contained in:
parent
b965314304
commit
bf4c9901bb
@ -5,7 +5,7 @@ VITE_APP_TITLE = 伊特机械MES
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API = 'http://192.168.5.230/api'
|
VITE_APP_BASE_API = 'http://192.168.12.230:8888/api'
|
||||||
#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway'
|
#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway'
|
||||||
#VITE_APP_BASE_API = '/dev-api'
|
#VITE_APP_BASE_API = '/dev-api'
|
||||||
|
|
||||||
|
|||||||
@ -5,22 +5,30 @@ export interface FlowingAround {
|
|||||||
id?: number
|
id?: number
|
||||||
|
|
||||||
currentlyPrefaceId?: number
|
currentlyPrefaceId?: number
|
||||||
|
currentlyPrefaceName?: string
|
||||||
|
|
||||||
nextPrefaceId?: number
|
nextPrefaceId?: number
|
||||||
|
nextPrefaceName?: string
|
||||||
|
|
||||||
businessId?: number
|
businessId?: number
|
||||||
|
|
||||||
businessCode?: string
|
businessCode?: string
|
||||||
|
businessName?: string
|
||||||
|
|
||||||
|
flowingAroundType?: number
|
||||||
quantity?: number
|
quantity?: number
|
||||||
|
|
||||||
confirmUserId?: number
|
confirmUserId?: number
|
||||||
|
confirmUserName?: string
|
||||||
|
|
||||||
confirmTime?: string
|
confirmTime?: string
|
||||||
|
confirmResult?: string
|
||||||
|
|
||||||
submitter?: number
|
submitter?: number
|
||||||
|
submitterName?: string
|
||||||
|
|
||||||
submitTime?: string
|
submitTime?: string
|
||||||
|
reason?: string
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,3 +63,12 @@ export function inspectio(data:any) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//派工数据详情
|
||||||
|
export function info(id:number) {
|
||||||
|
return request({
|
||||||
|
url: `/mes/dispatch/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
50
src/views/biz/flowingAround/assingWork.vue
Normal file
50
src/views/biz/flowingAround/assingWork.vue
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<n-form ref="pauseformRef" :model="pauseform" label-placement="left" label-width="80" >
|
||||||
|
<n-form-item label="派工编号">
|
||||||
|
<n-input v-model:value="pauseform.assingCode" disabled />
|
||||||
|
</n-form-item>
|
||||||
|
<n-form-item label="工序名称">
|
||||||
|
<n-input v-model:value="pauseform.processName" disabled />
|
||||||
|
</n-form-item>
|
||||||
|
<n-form-item label="报检数量" path="qcNum">
|
||||||
|
<n-input v-model:value="pauseform.qcNum" disabled />
|
||||||
|
</n-form-item>
|
||||||
|
</n-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import { ref, reactive, h, defineProps, onMounted, watch} from 'vue';
|
||||||
|
import { info } from '@/api/production'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
id: number;
|
||||||
|
num: number
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits(['updateWidth'])
|
||||||
|
|
||||||
|
let pauseform = reactive<any>({
|
||||||
|
id:'',
|
||||||
|
processName:'',
|
||||||
|
qcNum:''
|
||||||
|
})
|
||||||
|
|
||||||
|
async function loadData(){
|
||||||
|
info(props.id).then((rps:any) => {
|
||||||
|
Object.assign(pauseform, rps)
|
||||||
|
pauseform.qcNum = props.num
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(() => props.id, (val: number)=>{
|
||||||
|
loadData();
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
emit('updateWidth', "width:20%");
|
||||||
|
loadData()
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 工具栏 -->
|
<!-- 工具栏 -->
|
||||||
<div class="table-toolbar">
|
<!-- <div class="table-toolbar">
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-button type="primary" @click="handleAdd">
|
<n-button type="primary" @click="handleAdd">
|
||||||
<template #icon><n-icon><AddOutline /></n-icon></template>
|
<template #icon><n-icon><AddOutline /></n-icon></template>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
删除
|
删除
|
||||||
</n-button>
|
</n-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<n-data-table
|
<n-data-table
|
||||||
@ -58,33 +58,33 @@
|
|||||||
<!-- 新增/编辑弹窗 -->
|
<!-- 新增/编辑弹窗 -->
|
||||||
<n-modal v-model:show="modalVisible" preset="card" :title="modalTitle" style="width: 600px">
|
<n-modal v-model:show="modalVisible" preset="card" :title="modalTitle" style="width: 600px">
|
||||||
<n-form ref="formRef" :model="formData" :rules="formRules" label-placement="left" label-width="100px">
|
<n-form ref="formRef" :model="formData" :rules="formRules" label-placement="left" label-width="100px">
|
||||||
<n-form-item label="当前序ID" path="currentlyPrefaceId">
|
<n-form-item label="当前序" path="currentlyPrefaceName">
|
||||||
<n-select v-model:value="formData.currentlyPrefaceId" placeholder="请选择当前序ID" :options="[]" />
|
<n-input v-model:value="formData.currentlyPrefaceName" disabled />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="下一序ID" path="nextPrefaceId">
|
<n-form-item label="下一序" path="nextPrefaceName">
|
||||||
<n-select v-model:value="formData.nextPrefaceId" placeholder="请选择下一序ID" :options="[]" />
|
<n-input v-model:value="formData.nextPrefaceName" disabled/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="业务ID" path="businessId">
|
<n-form-item label="所属业务" path="businessName">
|
||||||
<n-input v-model:value="formData.businessId" placeholder="请输入业务ID" />
|
<n-input v-model:value="formData.businessName" disabled/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="业务code" path="businessCode">
|
<n-form-item label="流转类型" path="flowingAroundType">
|
||||||
<n-input v-model:value="formData.businessCode" placeholder="请输入业务code" />
|
<n-select v-model:value="formData.flowingAroundType" :options="flowingAroundTypeOptions" disabled />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="流转数量" path="quantity">
|
<n-form-item label="流转数量" path="quantity">
|
||||||
<n-input v-model:value="formData.quantity" placeholder="请输入流转数量" />
|
<n-input v-model:value="formData.quantity" placeholder="请输入流转数量" disabled />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="确认人ID" path="confirmUserId">
|
<n-form-item label="确认结果" path="confirmResult">
|
||||||
<n-input v-model:value="formData.confirmUserId" placeholder="请输入确认人ID" />
|
<n-select v-model:value="formData.confirmResult" placeholder="请选择确认结果" :options="confirmResultOptions" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="确认时间" path="confirmTime">
|
<n-form-item label="原因" path="reason">
|
||||||
<n-date-picker v-model:value="formData.confirmTime" type="datetime" clearable style="width: 100%" />
|
<n-input
|
||||||
</n-form-item>
|
v-model:value="formData.reason"
|
||||||
<n-form-item label="提交人id" path="submitter">
|
type="textarea"
|
||||||
<n-input v-model:value="formData.submitter" placeholder="请输入提交人id" />
|
placeholder="拒绝时必须填写原因"
|
||||||
</n-form-item>
|
:autosize= "{ minRows: 2, maxRows: 5 }"
|
||||||
<n-form-item label="提交时间" path="submitTime">
|
/>
|
||||||
<n-date-picker v-model:value="formData.submitTime" type="datetime" clearable style="width: 100%" />
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
</n-form>
|
</n-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<n-space justify="end">
|
<n-space justify="end">
|
||||||
@ -94,44 +94,21 @@
|
|||||||
</template>
|
</template>
|
||||||
</n-modal>
|
</n-modal>
|
||||||
|
|
||||||
<!-- 导入弹窗 -->
|
<n-modal v-model:show="modalCheckVisible" preset="card" :title="modalCheckTitle" :style="parentWidth" >
|
||||||
<n-modal v-model:show="importModalVisible" preset="card" title="导入流转记录表" style="width: 500px">
|
<AssingWorkVue v-if="modalCheckData?.businessCode === 'mes_assing_work'" :id="modalCheckData.businessId" :num="modalCheckData.quantity" @updateWidth="handleUpdateWidth"/>
|
||||||
<n-space vertical>
|
|
||||||
<n-alert type="info">
|
|
||||||
<template #header>导入说明</template>
|
|
||||||
<ul style="margin: 0; padding-left: 16px; line-height: 1.8">
|
|
||||||
<li>请先下载导入模板,按模板格式填写数据</li>
|
|
||||||
<li>支持 .xlsx 或 .xls 格式</li>
|
|
||||||
</ul>
|
|
||||||
</n-alert>
|
|
||||||
<n-space>
|
|
||||||
<n-button type="primary" @click="handleDownloadTemplate">
|
|
||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
|
||||||
下载模板
|
|
||||||
</n-button>
|
|
||||||
</n-space>
|
|
||||||
<n-upload :max="1" accept=".xlsx,.xls" :show-file-list="true" :custom-request="handleImportUpload">
|
|
||||||
<n-upload-dragger>
|
|
||||||
<div style="margin-bottom: 12px">
|
|
||||||
<n-icon size="48" :depth="3"><CloudUploadOutline /></n-icon>
|
|
||||||
</div>
|
|
||||||
<n-text style="font-size: 16px">点击或拖拽文件到此处上传</n-text>
|
|
||||||
<n-p depth="3" style="margin: 8px 0 0 0">支持 .xlsx 或 .xls 格式</n-p>
|
|
||||||
</n-upload-dragger>
|
|
||||||
</n-upload>
|
|
||||||
</n-space>
|
|
||||||
<template #footer>
|
|
||||||
<n-button @click="importModalVisible = false">关闭</n-button>
|
|
||||||
</template>
|
|
||||||
</n-modal>
|
</n-modal>
|
||||||
|
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, h, onMounted } from 'vue'
|
import { ref, reactive, h, onMounted } from 'vue'
|
||||||
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
||||||
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
|
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, EyeOutline, DownloadOutline } from '@vicons/ionicons5'
|
||||||
import { flowingAroundApi, type FlowingAround } from '@/api/flowingAround'
|
import { flowingAroundApi, type FlowingAround } from '@/api/flowingAround'
|
||||||
|
import { dictDataApi } from '@/api/org'
|
||||||
|
import AssingWorkVue from '@/views/biz/flowingAround/assingWork.vue'
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const dialog = useDialog()
|
const dialog = useDialog()
|
||||||
@ -174,20 +151,50 @@ const formData = reactive<FlowingAround>({ ...defaultFormData })
|
|||||||
|
|
||||||
// 表单校验规则
|
// 表单校验规则
|
||||||
const formRules = {
|
const formRules = {
|
||||||
|
reason: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '拒绝时必须填写原因',
|
||||||
|
trigger: ['blur', 'change'],
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 拿到表单整体数据,判断审核结果
|
||||||
|
if (formData.confirmResult === '拒绝' && (!value || !String(value).trim())) {
|
||||||
|
callback(new Error('拒绝时原因不能为空'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格列
|
// 表格列
|
||||||
const columns: DataTableColumns<FlowingAround> = [
|
const columns: DataTableColumns<FlowingAround> = [
|
||||||
{ type: 'selection' },
|
{ type: 'selection' },
|
||||||
{ title: '当前序ID', key: 'currentlyPrefaceId' },
|
{ title: '当前序ID', key: 'currentlyPrefaceName' },
|
||||||
{ title: '下一序ID', key: 'nextPrefaceId' },
|
{ title: '下一序ID', key: 'nextPrefaceName' },
|
||||||
{ title: '业务ID', key: 'businessId' },
|
{ title: '业务来源', key: 'businessName' },
|
||||||
{ title: '业务code', key: 'businessCode' },
|
|
||||||
{ title: '流转数量', key: 'quantity' },
|
{ title: '流转数量', key: 'quantity' },
|
||||||
{ title: '确认人ID', key: 'confirmUserId' },
|
{ title: '流转来源', key: 'flowingAroundType', render(row){
|
||||||
{ title: '确认时间', key: 'confirmTime' },
|
const val = row.flowingAroundType
|
||||||
{ title: '提交人id', key: 'submitter' },
|
const opt = flowingAroundTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
|
||||||
|
return opt ? opt.label : (val ?? '-')
|
||||||
|
} },
|
||||||
|
{ title: '提交人', key: 'submitterName' },
|
||||||
{ title: '提交时间', key: 'submitTime' },
|
{ title: '提交时间', key: 'submitTime' },
|
||||||
|
{ title: '提交信息', key: 'info' ,
|
||||||
|
render(row) {
|
||||||
|
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
||||||
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleView(row) }, {
|
||||||
|
default: () => [h(NIcon, null, { default: () => h(EyeOutline) }), ' 查看']
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ title: '确认人', key: 'confirmUserName' },
|
||||||
|
{ title: '确认时间', key: 'confirmTime' },
|
||||||
|
{ title: '确认结果', key: 'confirmResult' },
|
||||||
|
{ title: '原因', key: 'reason' },
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
@ -195,11 +202,8 @@ const columns: DataTableColumns<FlowingAround> = [
|
|||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
render(row) {
|
render(row) {
|
||||||
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
||||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row), disabled: row.confirmResult !== '待确认' }, {
|
||||||
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 流转确认']
|
||||||
}),
|
|
||||||
h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
|
||||||
default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
@ -221,6 +225,14 @@ async function loadData() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let parentWidth = ref('width: 40%;')
|
||||||
|
|
||||||
|
|
||||||
|
function handleUpdateWidth(width:string){
|
||||||
|
parentWidth.value =width;
|
||||||
|
}
|
||||||
|
|
||||||
// 搜索
|
// 搜索
|
||||||
function handleSearch() {
|
function handleSearch() {
|
||||||
pagination.page = 1
|
pagination.page = 1
|
||||||
@ -256,9 +268,19 @@ function handleAdd() {
|
|||||||
modalVisible.value = true
|
modalVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const modalCheckVisible = ref(false)
|
||||||
|
const modalCheckData = ref<FlowingAround>()
|
||||||
|
const modalCheckTitle = ref('')
|
||||||
|
//查看提交数据
|
||||||
|
function handleView(row: FlowingAround){
|
||||||
|
modalCheckTitle.value = '提交详情'
|
||||||
|
modalCheckData.value = row
|
||||||
|
modalCheckVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
function handleEdit(row: FlowingAround) {
|
function handleEdit(row: FlowingAround) {
|
||||||
modalTitle.value = '编辑流转记录表'
|
modalTitle.value = '流转确认审核'
|
||||||
Object.assign(formData, row)
|
Object.assign(formData, row)
|
||||||
if (formData.confirmTime && typeof formData.confirmTime === 'string') {
|
if (formData.confirmTime && typeof formData.confirmTime === 'string') {
|
||||||
formData.confirmTime = new Date(formData.confirmTime.replace(' ', 'T')).getTime()
|
formData.confirmTime = new Date(formData.confirmTime.replace(' ', 'T')).getTime()
|
||||||
@ -386,8 +408,19 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const flowingAroundTypeOptions = ref<{ label: string; value: any }[]>([])
|
||||||
|
const confirmResultOptions = ref<{ label: string; value: any }[]>([
|
||||||
|
{label: "待确认", value: "待确认"},
|
||||||
|
{label: "同意", value: "同意"},
|
||||||
|
{label: "拒绝", value: "拒绝"},
|
||||||
|
])
|
||||||
|
|
||||||
// 加载字典选项
|
// 加载字典选项
|
||||||
async function loadDictOptions() {
|
async function loadDictOptions() {
|
||||||
|
try {
|
||||||
|
const data = await dictDataApi.listByType('flowing_around_type')
|
||||||
|
flowingAroundTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
|
||||||
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@ -525,9 +525,9 @@ const pauserules = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(()=>pauseform.qcNum,v => {
|
// watch(()=>pauseform.qcNum,v => {
|
||||||
pauseform.qcNum = v.replace(/[^\d]/g,'')
|
// pauseform.qcNum = v.replace(/[^\d]/g,'')
|
||||||
})
|
// })
|
||||||
|
|
||||||
let pauseLoading = ref(false)
|
let pauseLoading = ref(false)
|
||||||
let pauseisedbtn = ref(false)
|
let pauseisedbtn = ref(false)
|
||||||
@ -541,8 +541,8 @@ function handlpause(n:any) {
|
|||||||
pauseisedbtn.value = false
|
pauseisedbtn.value = false
|
||||||
pauseformRef.value?.restoreValidation()
|
pauseformRef.value?.restoreValidation()
|
||||||
pauseform.id = n.id
|
pauseform.id = n.id
|
||||||
pauseform.qcNum = `${n.quantity}`
|
//pauseform.qcNum = `${n.quantity}`
|
||||||
|
pauseform.qcNum = n.quantity-(n.completedQuantity ?? 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function pauseSubmit() {
|
function pauseSubmit() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user