diff --git a/src/api/production.ts b/src/api/production.ts
index 3a1f928..3709567 100644
--- a/src/api/production.ts
+++ b/src/api/production.ts
@@ -47,10 +47,19 @@ export function mytasks(params:any) {
}
//派工数据统计
-export function workload(params:any) {
+export function workload(params?:any) {
return request({
url: `/mes/dispatch/workload`,
method: 'get',
params
})
+}
+
+//报检
+export function inspectio(data:any) {
+ return request({
+ url: `/mes/dispatch/qc`,
+ method: 'put',
+ data
+ })
}
\ No newline at end of file
diff --git a/src/views/production/dispatchwork/index.vue b/src/views/production/dispatchwork/index.vue
index beb6320..b582682 100644
--- a/src/views/production/dispatchwork/index.vue
+++ b/src/views/production/dispatchwork/index.vue
@@ -115,7 +115,7 @@
-
+
-
+
-
+
-
-
+
+
-
+
-
+
@@ -194,8 +194,14 @@
:rules="reassrules"
label-placement="top"
label-width="80"
- class="modal-form"
>
+
+
+
+
+
+
+
@@ -211,7 +217,7 @@
:loading="reassLoading"
@click="reassSubmit"
:disabled="reassdisedbtn"
- >保存
+ >确定
@@ -229,9 +235,13 @@
:model="pauseform"
label-placement="top"
label-width="80"
- class="modal-form"
>
-
+
+
+
+
+
+
@@ -244,7 +254,7 @@
:loading="submitLoading"
@click="pauseSubmit"
:disabled="disedbtn"
- >保存
+ >确定
@@ -286,7 +296,7 @@ import {
editdiswor,
transfer,
pauseresume,
- workload
+ //workload
} from '@/api/production'
//const dialog = useDialog()
@@ -630,6 +640,8 @@ function handleSubmit() {
})
}
+let gxobg = reactive({})
+
//改派
let reassignmodal = ref(false)
@@ -650,6 +662,10 @@ let reassLoading = ref(false)
let reassdisedbtn = ref(false)
function handlreass(n:any) {
+
+ gxobg.name = n.processName
+ gxobg.id = n.processId
+
reassignmodal.value = true
reassLoading.value = false
reassdisedbtn.value = false
@@ -696,6 +712,10 @@ const pauseformRef = ref()
let pauseisedbtn = ref(false)
function handlpause(n:any) {
+
+ gxobg.name = n.processName
+ gxobg.id = n.processId
+
pausemodal.value = true
pauseLoading.value = false
pauseisedbtn.value = false
@@ -744,7 +764,7 @@ function pauseSubmit() {
onMounted(() => {
getlist()
- workload()
+ //workload()
})
diff --git a/src/views/production/myassigtask/index.vue b/src/views/production/myassigtask/index.vue
index 0122669..3b44275 100644
--- a/src/views/production/myassigtask/index.vue
+++ b/src/views/production/myassigtask/index.vue
@@ -15,9 +15,7 @@
-
-
-
+
@@ -112,109 +110,45 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取消
- 保存
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
- 取消
+ 取消
保存
+
@@ -224,7 +158,8 @@ import {
ref,
reactive,
h,
- onMounted,
+ onMounted,
+ watch,
} from 'vue'
@@ -234,11 +169,11 @@ import {
NSpace,
NPagination,
NGrid,
- NGi,
+ // NGi,
NTag,
useMessage,
//useDialog,
- type FormInst,
+ //type FormInst,
} from 'naive-ui'
import {
@@ -250,9 +185,7 @@ import { useUserStore } from '@/stores/user'
import {
mytasks,
- editdiswor,
- transfer,
- pauseresume
+ inspectio
} from '@/api/production'
//const dialog = useDialog()
@@ -269,9 +202,8 @@ const hasPermission = (permission: string) => userStore.hasPermission(permission
const searchForm = reactive({
page: 1,
pageSize: 20,
- // processId:'',
- // processName:'',
- // stringUserName:''
+ processId:'',
+ processName:'',
})
@@ -385,7 +317,7 @@ const columns = [
},
{
align:'center',
- title: '质检打回数里',
+ title: '质检打回数量',
key: 'qualityReturnNum',
minWidth: 150
},
@@ -444,79 +376,30 @@ const columns = [
align:'center',
title: '操作',
key: 'actions',
- width: 200,
+ width: 100,
fixed: 'right',
render(row:any) {
- const buttons:any = [
-
- // h(NButton, {
- // size: 'small',
- // type:'warning',
- // ghost:true,
- // onClick: () => handleEdit(row) },
- // //{ default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 暂停' ]}
- // { default: () => '暂停'}
- // )
- ]
+ const buttons:any = []
- // if(hasPermission('biz:assingWork:edit')){
- // buttons.push(h(NButton, {
- // size: 'small',
- // type:'primary',
- // ghost:true,
- // onClick: () => { handleEdit(row) } },
- // //{ default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑' ]}
- // { default: () => '编辑'}
- // ))
- // }
- // if(hasPermission('biz:assingWork:transfer')){
- // buttons.push(h(NButton, {
- // size: 'small',
- // type:'success',
- // ghost:true,
- // onClick: () => { handlreass(row) } },
- // { default: () => '改派'}
- // ))
- // }
- // if(hasPermission('biz:assingWork:pauseResume')){
- // buttons.push(h(NButton, {
- // size: 'small',
- // type:'warning',
- // ghost:true,
- // onClick:()=>{ handlpause(row) }
- // },
- // { default: () => '暂停'}
- // ))
- // }
- // buttons.push(
-
- // )
+ if(hasPermission('biz:assingWork:edit')){
+ buttons.push(h(NButton, {
+ size: 'small',
+ type:'primary',
+ ghost:true,
+ onClick: () => { handlpause(row) } },
+ //{ default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑' ]}
+ { default: () => '报检'}
+ ))
+ }
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
}
}
]
-// 编辑
-const editmodal = ref(false)
-const formRef = ref(null)
-const submitLoading = ref(false)
-const formData = reactive({
- id:'',
- processName:'', //工序名称
- userId:'', //工人id
- stringUserName:'', //工人名称
- quantity:'', //数里
- rework:'', //是否返工
- reworkNum:'', //返工次数
- completedQuantity:'', //完成数里
-})
-const rules = {
- processName: [{ required: true, message: '请输工序名称', trigger: 'blur' }],
- quantity: [{ required: true, message: '请输入数里', trigger: 'blur' }]
-}
+
//搜索数据
function search() {
@@ -530,7 +413,6 @@ function search() {
function reset() {
searchForm.processId =''
searchForm.processName = ''
- searchForm.stringUserName = ''
}
//获取列表数据
@@ -558,117 +440,46 @@ function handlePageSizeChange(pageSize: number) {
}
-//编辑工单
-let disedbtn = ref(false)
-function handleEdit(n:any) {
- editmodal.value = true
- submitLoading.value = false
- disedbtn.value = false
- formRef.value?.restoreValidation()
- formData.id = n.id
- formData.processName = n.processName
- // formData.userId = '' //工人id
- // formData.stringUserName = '' //工人名称
- // formData.quantity = '' //数里
- // formData.rework = '' //是否返工
- // formData.reworkNum = '' //返工次数
- // formData.completedQuantity = '' //完成数里
-}
-
-function handleSubmit() {
- formRef.value?.validate(v => {
- if(!v){
- submitLoading.value = true
- disedbtn.value = true
- editdiswor(formData).then(() => {
- message.success('保存成功!')
- setTimeout(()=> {
- editmodal.value = false
- submitLoading.value = false
- disedbtn.value = false
- getlist()
- },1000)
- }).catch(() => {
- disedbtn.value = false
- submitLoading.value = false
- })
- }
- })
-}
-
-//改派
-let reassignmodal = ref(false)
-
-const reassformRef = ref()
-
-let reassform = reactive({
- // userId:'', //工人id
- // stringUserName:'', //工人名称
-
- id:'', //派工id
- reason:'', //改派原因
- userid:456 //改派人Id
-})
- const reassrules = {
- userid: [{ required: true, message: '请选择员工', trigger: 'blur' }]
- }
-let reassLoading = ref(false)
-let reassdisedbtn = ref(false)
-
-function handlreass(n:any) {
- reassignmodal.value = true
- reassLoading.value = false
- reassdisedbtn.value = false
- reassformRef.value?.restoreValidation()
- reassform.id = n.id
- reassform.reason = ''
- reassform.userid = 456
-
-}
-
- function reassSubmit() {
- reassformRef.value?.validate((v:any) => {
- if(!v){
- reassLoading.value = true
- reassdisedbtn.value = true
- transfer(reassform).then(() => {
- message.success('操作成功!')
- setTimeout(()=> {
- reassignmodal.value = false
- reassLoading.value = false
- reassdisedbtn.value = false
- getlist()
- },1000)
- }).catch(() => {
- reassdisedbtn.value = false
- reassLoading.value = false
- })
- }
- })
-}
-
-
-//暂停/启用
+let gxobg = reactive({})
+//报检
let pausemodal = ref(false)
let pauseform = reactive({
id:'',
- status:'', //0启用1暂停2改派
- reason:'' //原因
+ qcNum:''
})
const pauseformRef = ref()
+const pauserules = {
+ qcNum: [
+ { required: true, message: '请输报检数量', trigger: 'blur' },
+ {
+ validator(value: number) {
+ return value > pauseform.qcNum
+ },
+ trigger: ['blur'],
+ message: `报检数量最大为${pauseform.qcNum}`
+ }
+ ]
+}
+
+watch(()=>pauseform.qcNum,v => {
+ pauseform.qcNum = v.replace(/[^\d]/g,'')
+})
+
let pauseLoading = ref(false)
let pauseisedbtn = ref(false)
function handlpause(n:any) {
+ gxobg.id = n.id
+ gxobg.name = n.name
+
pausemodal.value = true
pauseLoading.value = false
pauseisedbtn.value = false
pauseformRef.value?.restoreValidation()
pauseform.id = n.id
- pauseform.reason = ''
- pauseform.status = n.staus
+ pauseform.qcNum = `${n.quantity}`
}
@@ -677,7 +488,7 @@ function pauseSubmit() {
if(!v){
pauseLoading.value = true
pauseisedbtn.value = true
- pauseresume(pauseform).then(() => {
+ inspectio(Object.assign({},pauseform,{qcNum:pauseform.qcNum*1})).then(() => {
message.success('操作成功!')
setTimeout(()=> {
pausemodal.value = false