基础资料优化处理
parent
df6a6b0a99
commit
6740a79d17
|
@ -0,0 +1,28 @@
|
||||||
|
import { baseRequest } from '@/utils/request'
|
||||||
|
|
||||||
|
const request = (url, ...arg) => baseRequest(`/produce/manualtaskdetail/` + url, ...arg)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手工任务单详情Api接口管理器
|
||||||
|
*
|
||||||
|
* @author Luck
|
||||||
|
* @date 2024/08/06 17:10
|
||||||
|
**/
|
||||||
|
export default {
|
||||||
|
// 获取手工任务单详情分页
|
||||||
|
manualTaskDetailPage(data) {
|
||||||
|
return request('page', data, 'get')
|
||||||
|
},
|
||||||
|
// 提交手工任务单详情表单 edit为true时为编辑,默认为新增
|
||||||
|
manualTaskDetailSubmitForm(data, edit = false) {
|
||||||
|
return request(edit ? 'edit' : 'add', data)
|
||||||
|
},
|
||||||
|
// 删除手工任务单详情
|
||||||
|
manualTaskDetailDelete(data) {
|
||||||
|
return request('delete', data)
|
||||||
|
},
|
||||||
|
// 获取手工任务单详情详情
|
||||||
|
manualTaskDetailDetail(data) {
|
||||||
|
return request('detail', data, 'get')
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { baseRequest } from '@/utils/request'
|
||||||
|
|
||||||
|
const request = (url, ...arg) => baseRequest(`/produce/tag/` + url, ...arg)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产标签Api接口管理器
|
||||||
|
*
|
||||||
|
* @author Luck
|
||||||
|
* @date 2024/08/08 20:15
|
||||||
|
**/
|
||||||
|
export default {
|
||||||
|
// 获取生产标签分页
|
||||||
|
produceTagPage(data) {
|
||||||
|
return request('page', data, 'get')
|
||||||
|
},
|
||||||
|
// 提交生产标签表单 edit为true时为编辑,默认为新增
|
||||||
|
produceTagSubmitForm(data, edit = false) {
|
||||||
|
return request(edit ? 'edit' : 'add', data)
|
||||||
|
},
|
||||||
|
// 删除生产标签
|
||||||
|
produceTagDelete(data) {
|
||||||
|
return request('delete', data)
|
||||||
|
},
|
||||||
|
// 获取生产标签详情
|
||||||
|
produceTagDetail(data) {
|
||||||
|
return request('detail', data, 'get')
|
||||||
|
},
|
||||||
|
// 获取生产标签详情
|
||||||
|
produceTagList(data) {
|
||||||
|
return request('list', data, 'get')
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,5 +24,13 @@ export default {
|
||||||
// 获取生产任务单详情
|
// 获取生产任务单详情
|
||||||
produceTaskDetail(data) {
|
produceTaskDetail(data) {
|
||||||
return request('detail', data, 'get')
|
return request('detail', data, 'get')
|
||||||
|
},
|
||||||
|
// 审核任务单
|
||||||
|
produceTaskAuditPass(data) {
|
||||||
|
return request('audit/pass', data, 'post')
|
||||||
|
},
|
||||||
|
// 回退任务单
|
||||||
|
produceTaskAudiTask(data) {
|
||||||
|
return request('audit/back', data, 'post')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
<template>
|
||||||
|
<a-modal v-model:open="modalValue" title="数据备注" @ok="handleOk">
|
||||||
|
<a-alert message="数据备注,为了方便快捷的筛选数据!" type="info" show-icon />
|
||||||
|
|
||||||
|
<a-radio-group class="mt-4" v-model:value="tagValue">
|
||||||
|
<a-radio v-for="item in tagList" :key="item.id" :value="item.id">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<span :style="{ color: item.color, fontSize: '26px' }"><TagFilled /> </span>
|
||||||
|
<span class="ml-2" style="font-size: 14px">{{item.name}}</span>
|
||||||
|
</div>
|
||||||
|
</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
|
||||||
|
<a-textarea class="mt-4" v-model:value="remarks"> </a-textarea>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
saveTagApi: {
|
||||||
|
type: Function,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// const emit = defineEmits()
|
||||||
|
|
||||||
|
// 生命周期钩子
|
||||||
|
|
||||||
|
import produceTagApi from '@/api/production/produce/produceTagApi'
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
console.log('Component mounted')
|
||||||
|
// TODO: Add your onMounted code here
|
||||||
|
})
|
||||||
|
|
||||||
|
onUpdated(() => {
|
||||||
|
console.log('Component updated')
|
||||||
|
// TODO: Add your onUpdated code here
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
console.log('Component unmounted')
|
||||||
|
// TODO: Add your onUnmounted code here
|
||||||
|
})
|
||||||
|
|
||||||
|
const modalValue = ref(false)
|
||||||
|
|
||||||
|
// 标签value
|
||||||
|
let tagValue = ref('')
|
||||||
|
let remarks = ref('')
|
||||||
|
|
||||||
|
// 标签列表
|
||||||
|
let tagList = ref([])
|
||||||
|
|
||||||
|
let params = reactive({})
|
||||||
|
|
||||||
|
// 打开对话框
|
||||||
|
const openModal = (record) => {
|
||||||
|
modalValue.value = true
|
||||||
|
|
||||||
|
params = record
|
||||||
|
|
||||||
|
produceTagApi.produceTagList().then((res) => {
|
||||||
|
tagList.value = res || []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认
|
||||||
|
const handleOk = () => {
|
||||||
|
props.saveTagApi({ id: params.id, tagId: tagValue.value }).then((res) => {
|
||||||
|
modalValue.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// watch(() => {}, () => {})
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
openModal
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -0,0 +1,80 @@
|
||||||
|
<template>
|
||||||
|
<xn-form-container
|
||||||
|
:title="formData.id ? '编辑生产标签' : '增加生产标签'"
|
||||||
|
:width="700"
|
||||||
|
:visible="visible"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
@close="onClose"
|
||||||
|
>
|
||||||
|
<a-form ref="formRef" :model="formData" :rules="formRules" layout="horizontal">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="名称:" name="name">
|
||||||
|
<a-input v-model:value="formData.name" placeholder="请输入名称" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="颜色:" name="color">
|
||||||
|
<color-picker v-model:value="formData.color" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
<template #footer>
|
||||||
|
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||||
|
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
|
||||||
|
</template>
|
||||||
|
</xn-form-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="produceTagForm">
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
import { required } from '@/utils/formRules'
|
||||||
|
import produceTagApi from '@/api/production/produce/produceTagApi'
|
||||||
|
import ColorPicker from "@/components/ColorPicker/index.vue";
|
||||||
|
// 抽屉状态
|
||||||
|
const visible = ref(false)
|
||||||
|
const emit = defineEmits({ successful: null })
|
||||||
|
const formRef = ref()
|
||||||
|
// 表单数据
|
||||||
|
const formData = ref({})
|
||||||
|
const submitLoading = ref(false)
|
||||||
|
|
||||||
|
// 打开抽屉
|
||||||
|
const onOpen = (record) => {
|
||||||
|
visible.value = true
|
||||||
|
if (record) {
|
||||||
|
let recordData = cloneDeep(record)
|
||||||
|
formData.value = Object.assign({}, recordData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 关闭抽屉
|
||||||
|
const onClose = () => {
|
||||||
|
formRef.value.resetFields()
|
||||||
|
formData.value = {}
|
||||||
|
visible.value = false
|
||||||
|
}
|
||||||
|
// 默认要校验的
|
||||||
|
const formRules = {
|
||||||
|
}
|
||||||
|
// 验证并提交数据
|
||||||
|
const onSubmit = () => {
|
||||||
|
formRef.value.validate().then(() => {
|
||||||
|
submitLoading.value = true
|
||||||
|
const formDataParam = cloneDeep(formData.value)
|
||||||
|
produceTagApi
|
||||||
|
.produceTagSubmitForm(formDataParam, formDataParam.id)
|
||||||
|
.then(() => {
|
||||||
|
onClose()
|
||||||
|
emit('successful')
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submitLoading.value = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 抛出函数
|
||||||
|
defineExpose({
|
||||||
|
onOpen
|
||||||
|
})
|
||||||
|
</script>
|
|
@ -0,0 +1,127 @@
|
||||||
|
<template>
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-form-item label="名称" name="name">
|
||||||
|
<a-input v-model:value="searchFormState.name" placeholder="请输入名称" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
||||||
|
<a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
<s-table
|
||||||
|
ref="tableRef"
|
||||||
|
:columns="columns"
|
||||||
|
:data="loadData"
|
||||||
|
:alert="options.alert.show"
|
||||||
|
bordered
|
||||||
|
:row-key="(record) => record.id"
|
||||||
|
:tool-config="toolConfig"
|
||||||
|
:row-selection="options.rowSelection"
|
||||||
|
>
|
||||||
|
<template #operator class="table-operator">
|
||||||
|
<a-space>
|
||||||
|
<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('produceTagAdd')">
|
||||||
|
<template #icon><plus-outlined /></template>
|
||||||
|
新增
|
||||||
|
</a-button>
|
||||||
|
<xn-batch-delete
|
||||||
|
v-if="hasPerm('produceTagBatchDelete')"
|
||||||
|
:selectedRowKeys="selectedRowKeys"
|
||||||
|
@batchDelete="deleteBatchProduceTag"
|
||||||
|
/>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.dataIndex === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="formRef.onOpen(record)" v-if="hasPerm('produceTagEdit')">编辑</a>
|
||||||
|
<a-divider type="vertical" v-if="hasPerm(['produceTagEdit', 'produceTagDelete'], 'and')" />
|
||||||
|
<a-popconfirm title="确定要删除吗?" @confirm="deleteProduceTag(record)">
|
||||||
|
<a-button type="link" danger size="small" v-if="hasPerm('produceTagDelete')">删除</a-button>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</s-table>
|
||||||
|
</a-card>
|
||||||
|
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="tag">
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
import Form from './form.vue'
|
||||||
|
import produceTagApi from '@/api/production/produce/produceTagApi'
|
||||||
|
const searchFormState = ref({})
|
||||||
|
const searchFormRef = ref()
|
||||||
|
const tableRef = ref()
|
||||||
|
const formRef = ref()
|
||||||
|
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '颜色',
|
||||||
|
dataIndex: 'color'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
// 操作栏通过权限判断是否显示
|
||||||
|
if (hasPerm(['produceTagEdit', 'produceTagDelete'])) {
|
||||||
|
columns.push({
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
align: 'center',
|
||||||
|
width: 150
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const selectedRowKeys = ref([])
|
||||||
|
// 列表选择配置
|
||||||
|
const options = {
|
||||||
|
// columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
||||||
|
alert: {
|
||||||
|
show: true,
|
||||||
|
clear: () => {
|
||||||
|
selectedRowKeys.value = ref([])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rowSelection: {
|
||||||
|
onChange: (selectedRowKey, selectedRows) => {
|
||||||
|
selectedRowKeys.value = selectedRowKey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const loadData = (parameter) => {
|
||||||
|
const searchFormParam = cloneDeep(searchFormState.value)
|
||||||
|
return produceTagApi.produceTagPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
||||||
|
return data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 重置
|
||||||
|
const reset = () => {
|
||||||
|
searchFormRef.value.resetFields()
|
||||||
|
tableRef.value.refresh(true)
|
||||||
|
}
|
||||||
|
// 删除
|
||||||
|
const deleteProduceTag = (record) => {
|
||||||
|
let params = [
|
||||||
|
{
|
||||||
|
id: record.id
|
||||||
|
}
|
||||||
|
]
|
||||||
|
produceTagApi.produceTagDelete(params).then(() => {
|
||||||
|
tableRef.value.refresh(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 批量删除
|
||||||
|
const deleteBatchProduceTag = (params) => {
|
||||||
|
produceTagApi.produceTagDelete(params).then(() => {
|
||||||
|
tableRef.value.clearRefreshSelected()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -79,7 +79,6 @@ export const materielColumn = [
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
|
|
|
@ -51,9 +51,9 @@
|
||||||
|
|
||||||
const formRules = {
|
const formRules = {
|
||||||
name: [required('请输入名称')],
|
name: [required('请输入名称')],
|
||||||
type: [required('请输入类型')],
|
phone: [required('请输入电话号码')],
|
||||||
appid: [required('请输入AppID')],
|
isFit: [required('请输入是否合适')],
|
||||||
secret: [required('请输入AppSecret')]
|
categoryId: [required('请选择员工分类')]
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseFormItems = reactive([
|
const baseFormItems = reactive([
|
||||||
|
|
|
@ -89,8 +89,13 @@
|
||||||
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'">启用</a-tag>
|
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'">启用</a-tag>
|
||||||
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'">停用</a-tag>
|
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'">停用</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'type'">
|
<template v-if="column.dataIndex === 'isJoinGroup'">
|
||||||
{{ $TOOL.dictTypeData('OFFICIAL_ACCOUNT_TYPE', record.type) }}
|
<span v-if="record.isJoinGroup">{{ $TOOL.dictTypeData('YES_NO', record.isJoinGroup || '') }}</span>
|
||||||
|
<span v-else></span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'isFit'">
|
||||||
|
<span v-if="record.isFit">{{ $TOOL.dictTypeData('FIT_STATE', record.isFit || '') }}</span>
|
||||||
|
<span v-else></span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
|
@ -146,9 +151,76 @@
|
||||||
import employeeApi from '@/api/base/employee/employeeApi'
|
import employeeApi from '@/api/base/employee/employeeApi'
|
||||||
import employeeCategoryApi from '@/api/base/employee/employeeCategoryApi'
|
import employeeCategoryApi from '@/api/base/employee/employeeCategoryApi'
|
||||||
import { useTableManagement } from '@/hook/useTableManagement'
|
import { useTableManagement } from '@/hook/useTableManagement'
|
||||||
import { materielColumn } from '@/views/productionBusiness/basicData/materiel/column/materiel-column'
|
|
||||||
import PersonnelCategoryForm from '@/views/productionBusiness/employee/personnel/detail/personnelCategoryForm.vue'
|
import PersonnelCategoryForm from '@/views/productionBusiness/employee/personnel/detail/personnelCategoryForm.vue'
|
||||||
|
|
||||||
|
const materielColumn = [
|
||||||
|
{
|
||||||
|
title: '编码',
|
||||||
|
dataIndex: 'number',
|
||||||
|
sorter: true,
|
||||||
|
sortDirections: ['descend', 'ascend'],
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '可用状态',
|
||||||
|
dataIndex: 'enabledState',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否合适',
|
||||||
|
dataIndex: 'isFit',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '入群',
|
||||||
|
dataIndex: 'isJoinGroup',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '性别',
|
||||||
|
dataIndex: 'gender',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '分类',
|
||||||
|
dataIndex: 'categoryName',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '电话号码',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
align: 'center',
|
||||||
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const personnelCategoryFormRef = ref(null)
|
const personnelCategoryFormRef = ref(null)
|
||||||
const dynamicTreeRef = ref(null)
|
const dynamicTreeRef = ref(null)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<a-page-header style="padding: 10px; font-size: 20px" @back="handleBack('/basicData/unit')">
|
<a-page-header style="padding: 10px; font-size: 20px" @back="handleBack('/basicData/unit')">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-button v-if="route.query.type === 'ADD' " type="primary" @click="onSubmitForm">保存</a-button>
|
<a-button v-if="route.query.type === 'ADD'" type="primary" @click="onSubmitForm">保存</a-button>
|
||||||
</template>
|
</template>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
<a-card :bordered="false" title="任务单信息">
|
<a-card :bordered="false" title="任务单信息">
|
||||||
|
@ -13,7 +13,13 @@
|
||||||
ref="formRef1"
|
ref="formRef1"
|
||||||
>
|
>
|
||||||
<template #materialNameSlot="{ model, item }">
|
<template #materialNameSlot="{ model, item }">
|
||||||
<a-input :disabled="route.query.type === 'SEARCH'" readonly v-bind="{ ...item.attrs }" v-model:value="model[item.name]" @click="openMateriel"></a-input>
|
<a-input
|
||||||
|
:disabled="route.query.type === 'SEARCH'"
|
||||||
|
readonly
|
||||||
|
v-bind="{ ...item.attrs }"
|
||||||
|
v-model:value="model[item.name]"
|
||||||
|
@click="openMateriel"
|
||||||
|
></a-input>
|
||||||
</template>
|
</template>
|
||||||
<template #produceUnitNameSlot="{ model, item }">
|
<template #produceUnitNameSlot="{ model, item }">
|
||||||
<a-select v-bind="{ ...item.attrs }" v-model:value="model[item.name]" :options="unitList"></a-select>
|
<a-select v-bind="{ ...item.attrs }" v-model:value="model[item.name]" :options="unitList"></a-select>
|
||||||
|
@ -32,6 +38,9 @@
|
||||||
<a-tab-pane key="1" tab="人员信息">
|
<a-tab-pane key="1" tab="人员信息">
|
||||||
<a-table :dataSource="dataSource" :columns="columns" :pagination="false">
|
<a-table :dataSource="dataSource" :columns="columns" :pagination="false">
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
|
<template v-if="column.dataIndex === 'index'">
|
||||||
|
{{ index + 1 }}
|
||||||
|
</template>
|
||||||
<template v-if="column.dataIndex === 'isFit'">
|
<template v-if="column.dataIndex === 'isFit'">
|
||||||
<a-select
|
<a-select
|
||||||
:disabled="route.query.type === 'SEARCH'"
|
:disabled="route.query.type === 'SEARCH'"
|
||||||
|
@ -65,7 +74,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'money'">
|
<template v-if="column.dataIndex === 'money'">
|
||||||
<a-input disabled v-model:value="record.money" :precision="2" />
|
<a-input-number disabled v-model:value="record.money" :precision="2" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'action'">
|
||||||
|
<a-button type="link" @click="handleDelete(record)">删除</a-button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
@ -92,7 +104,6 @@
|
||||||
:user-page-api="selectorApiFunction.userPageApi"
|
:user-page-api="selectorApiFunction.userPageApi"
|
||||||
:checkedUserListApi="selectorApiFunction.userListByIdListApi"
|
:checkedUserListApi="selectorApiFunction.userListByIdListApi"
|
||||||
@onBack="userSelectorOnBack"
|
@onBack="userSelectorOnBack"
|
||||||
:radioModel="true"
|
|
||||||
></employee-selector-plus>
|
></employee-selector-plus>
|
||||||
|
|
||||||
<personnel-form ref="personnelFormRef" @successful="successful"></personnel-form>
|
<personnel-form ref="personnelFormRef" @successful="successful"></personnel-form>
|
||||||
|
@ -113,6 +124,7 @@
|
||||||
import { required } from '@/utils/formRules'
|
import { required } from '@/utils/formRules'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
|
import manualTaskDetailApi from "@/api/base/manual-task/manualTaskDetailApi";
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
@ -123,7 +135,8 @@
|
||||||
type: 'a-input',
|
type: 'a-input',
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入单号',
|
placeholder: '请输入单号',
|
||||||
allowClear: true
|
allowClear: true,
|
||||||
|
disabled: route.query.type !== 'ADD'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -133,7 +146,8 @@
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入开工日期',
|
placeholder: '请输入开工日期',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
disabled: route.query.type !== 'ADD'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -143,7 +157,8 @@
|
||||||
isUseSlot: true,
|
isUseSlot: true,
|
||||||
slotName: 'materialNameSlot',
|
slotName: 'materialNameSlot',
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入物料'
|
placeholder: '请输入物料',
|
||||||
|
disabled: route.query.type !== 'ADD'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -152,7 +167,7 @@
|
||||||
type: 'a-input',
|
type: 'a-input',
|
||||||
attrs: {
|
attrs: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
placeholder: '请输入基本单位'
|
placeholder: '请输入基本单位',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -163,7 +178,7 @@
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请选择生产线',
|
placeholder: '请选择生产线',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
disabled: route.query.type === 'SEARCH'
|
disabled: route.query.type !== 'ADD'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -173,16 +188,16 @@
|
||||||
span: 24,
|
span: 24,
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入签名方式',
|
placeholder: '请输入签名方式',
|
||||||
allowClear: true
|
allowClear: true,
|
||||||
|
disabled: route.query.type !== 'ADD'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const formRef1 = ref(null)
|
||||||
const formRules = {
|
const formRules = {
|
||||||
name: [required('请输入名称')],
|
materialName: [required('请输入物料')],
|
||||||
type: [required('请输入类型')],
|
productionLineName: [required('请输入生产线')]
|
||||||
appid: [required('请输入AppID')],
|
|
||||||
secret: [required('请输入AppSecret')]
|
|
||||||
}
|
}
|
||||||
let activeKey = ref('1')
|
let activeKey = ref('1')
|
||||||
|
|
||||||
|
@ -193,17 +208,40 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
const onSubmitForm = () => {
|
const onSubmitForm = () => {
|
||||||
|
dataSource.value
|
||||||
|
for (let i = 0; i < dataSource.value.length; i++) {
|
||||||
|
if (
|
||||||
|
dataSource.value[i].isFit === null ||
|
||||||
|
dataSource.value[i].money === null ||
|
||||||
|
dataSource.value[i].amount === null ||
|
||||||
|
dataSource.value[i].payMode === null
|
||||||
|
) {
|
||||||
|
return message.error('请完善人员信息')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSubmit({ isDeep: true, ...formData, detailList: dataSource.value })
|
onSubmit({ isDeep: true, ...formData, detailList: dataSource.value })
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
formRefs.value = [formRef1.value]
|
||||||
fetchData(route.query.type).then(async (res) => {
|
fetchData(route.query.type).then(async (res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
manualTaskApi.manualTaskDetailPage({
|
formData.materialId = res.materialId // 物料id
|
||||||
manualTaskId: res.id
|
formData.materialNumber = res.materialNumber // 物料id
|
||||||
}).then(detailPage => {
|
// 选择物料自动带出基本单位和生产单位
|
||||||
dataSource.value = detailPage.records
|
formData.baseUnitId = res.baseUnitId // 生产单位id
|
||||||
})
|
|
||||||
|
// 获取物料的生产价格
|
||||||
|
materielMoney = res.producePrice
|
||||||
|
|
||||||
|
manualTaskDetailApi
|
||||||
|
.manualTaskDetailPage({
|
||||||
|
manualTaskId: res.id
|
||||||
|
})
|
||||||
|
.then((detailPage) => {
|
||||||
|
dataSource.value = detailPage.records
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -264,7 +302,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
userPageApi: (param) => {
|
userPageApi: (param) => {
|
||||||
return employeeApi.employeePage(param).then((data) => {
|
return employeeApi.employeePage({ ...param, enabledState: 'ENABLE' }).then((data) => {
|
||||||
return Promise.resolve(data)
|
return Promise.resolve(data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -279,16 +317,23 @@
|
||||||
const userSelectorOnBack = (data) => {
|
const userSelectorOnBack = (data) => {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
data.forEach((i) => {
|
data.forEach((i) => {
|
||||||
dataSource.value.push({
|
// 检查是否已经存在相同的 employeeId
|
||||||
employeeId: i.id,
|
const exists = dataSource.value.find((item) => item.employeeId === i.id)
|
||||||
employeeName: i.name,
|
|
||||||
employeeIdNumber: i.idNumber,
|
if (!exists) {
|
||||||
employeeNumber: i.number,
|
dataSource.value.push({
|
||||||
isFit: i.isFit,
|
employeeId: i.id,
|
||||||
payMode: null,
|
employeeName: i.name,
|
||||||
amount: null,
|
employeeIdNumber: i.idNumber,
|
||||||
money: null
|
employeeNumber: i.number,
|
||||||
})
|
isFit: i.isFit,
|
||||||
|
payMode: null,
|
||||||
|
amount: null,
|
||||||
|
money: null
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
message.warning(`员工 ${i.name} 已经存在,未重复添加。`)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -297,6 +342,12 @@
|
||||||
* 人员列表
|
* 人员列表
|
||||||
* */
|
* */
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'index',
|
||||||
|
align: 'center',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '员工姓名',
|
title: '员工姓名',
|
||||||
dataIndex: 'employeeName',
|
dataIndex: 'employeeName',
|
||||||
|
@ -305,19 +356,26 @@
|
||||||
width: 200
|
width: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '员工身份证号',
|
title: '员工手机号',
|
||||||
dataIndex: 'employeeIdNumber',
|
dataIndex: 'employeePhone',
|
||||||
editable: true,
|
editable: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 200
|
width: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '员工编号',
|
title: '员工性别',
|
||||||
dataIndex: 'employeeNumber',
|
dataIndex: 'employeeSex',
|
||||||
editable: true,
|
editable: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 200
|
width: 200
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '员工编号',
|
||||||
|
// dataIndex: 'employeeNumber',
|
||||||
|
// editable: true,
|
||||||
|
// align: 'center',
|
||||||
|
// width: 200
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '是否合适',
|
title: '是否合适',
|
||||||
dataIndex: 'isFit',
|
dataIndex: 'isFit',
|
||||||
|
@ -345,10 +403,31 @@
|
||||||
editable: true,
|
editable: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 200
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
editable: true,
|
||||||
|
align: 'center',
|
||||||
|
width: 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const dataSource = ref([])
|
const dataSource = ref([])
|
||||||
|
|
||||||
|
// 表格删除
|
||||||
|
const handleDelete = (record) => {
|
||||||
|
if(route.query.type === 'EDIT') {
|
||||||
|
manualTaskDetailApi.manualTaskDetailDelete({
|
||||||
|
manualTaskId: route.query.id,
|
||||||
|
detailIdParamList: [{id: record.id}]
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
dataSource.value = dataSource.value.filter((item) => item.employeeNumber !== record.employeeNumber)
|
||||||
|
}
|
||||||
|
|
||||||
// 计算每个人员的金额
|
// 计算每个人员的金额
|
||||||
const amountChange = (event, record) => {
|
const amountChange = (event, record) => {
|
||||||
record.money = event * materielMoney
|
record.money = event * materielMoney
|
||||||
|
@ -359,9 +438,19 @@
|
||||||
* */
|
* */
|
||||||
const personnelFormRef = ref(null)
|
const personnelFormRef = ref(null)
|
||||||
const handleOpenAddUser = () => {
|
const handleOpenAddUser = () => {
|
||||||
|
if (materielMoney === 0) return message.error('请选择物料,当前生产价格为0')
|
||||||
personnelFormRef.value.onOpen()
|
personnelFormRef.value.onOpen()
|
||||||
}
|
}
|
||||||
const successful = (data) => {
|
const successful = (data) => {
|
||||||
|
if(route.query.type === 'EDIT') {
|
||||||
|
// manualTaskDetailApi.manualTaskDetailSubmitForm({
|
||||||
|
// manualTaskId: route.query.id,
|
||||||
|
// detailIdParamList: [{id: record.id}]
|
||||||
|
// }).then(res => {
|
||||||
|
// console.log(res)
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
dataSource.value.push({
|
dataSource.value.push({
|
||||||
employeeId: data.id,
|
employeeId: data.id,
|
||||||
employeeName: data.name,
|
employeeName: data.name,
|
||||||
|
|
|
@ -62,6 +62,16 @@
|
||||||
</a-tree-select>
|
</a-tree-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="启用状态:" name="enabledState">
|
||||||
|
<a-select
|
||||||
|
:disabled="pageType === 'SEARCH'"
|
||||||
|
v-model:value="formData.enabledState"
|
||||||
|
placeholder="请选择启用状态"
|
||||||
|
:options="tool.dictList('COMMON_STATUS')"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -82,7 +92,9 @@
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const emit = defineEmits({ successful: null })
|
const emit = defineEmits({ successful: null })
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const formData = ref({})
|
const formData = ref({
|
||||||
|
enabledState: 'ENABLE'
|
||||||
|
})
|
||||||
const submitLoading = ref(false)
|
const submitLoading = ref(false)
|
||||||
let pageType = ref('ADD')
|
let pageType = ref('ADD')
|
||||||
|
|
||||||
|
@ -102,7 +114,10 @@
|
||||||
}
|
}
|
||||||
// 默认要校验的refresh
|
// 默认要校验的refresh
|
||||||
const formRules = {
|
const formRules = {
|
||||||
name: [required('请输入姓名')]
|
name: [required('请输入姓名')],
|
||||||
|
isFit: [required('请选择是否合适')],
|
||||||
|
categoryId: [required('请选择上级员工分类')],
|
||||||
|
phone: [required('请输入手机号码')]
|
||||||
}
|
}
|
||||||
// 验证并提交数据
|
// 验证并提交数据
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
|
|
|
@ -88,9 +88,8 @@
|
||||||
<!-- 查看-->
|
<!-- 查看-->
|
||||||
</a>
|
</a>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
|
||||||
<!-- <a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
|
<a-tooltip title="编辑">
|
||||||
<a-tooltip title="查看">
|
|
||||||
<a
|
<a
|
||||||
@click="
|
@click="
|
||||||
navigateTo('/employee/personnelReport/detail', {
|
navigateTo('/employee/personnelReport/detail', {
|
||||||
|
@ -101,22 +100,24 @@
|
||||||
v-if="hasPerm('customerEdit')"
|
v-if="hasPerm('customerEdit')"
|
||||||
>
|
>
|
||||||
<FormOutlined />
|
<FormOutlined />
|
||||||
<!– 编辑–>
|
<!-- 编辑-->
|
||||||
</a>
|
</a>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
|
<a-divider type="vertical"></a-divider>
|
||||||
<a-popconfirm title="确定要删除吗?" @confirm="deleteRecord(record)">
|
<a-tooltip title="添加标签">
|
||||||
<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">
|
<a @click="handleOpenTag(record)" :style="{color: record.tagColor}">
|
||||||
<DeleteOutlined />
|
<TagFilled />
|
||||||
<!– 删除–>
|
<!-- 查看-->
|
||||||
</a-button>
|
</a>
|
||||||
</a-popconfirm>-->
|
</a-tooltip>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</s-table>
|
</s-table>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
|
<tag-modal ref="tagModalRef" :saveTagApi="manualTaskApi.manualTaskSaveTag" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="brand">
|
<script setup name="brand">
|
||||||
|
@ -178,6 +179,12 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const tagModalRef = ref(null)
|
||||||
|
|
||||||
|
const handleOpenTag = (record) => {
|
||||||
|
tagModalRef.value.openModal(record)
|
||||||
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchFormState,
|
searchFormState,
|
||||||
tableRef,
|
tableRef,
|
||||||
|
@ -185,7 +192,6 @@
|
||||||
columns,
|
columns,
|
||||||
loadData,
|
loadData,
|
||||||
reset,
|
reset,
|
||||||
deleteRecord,
|
|
||||||
deleteBatchRecords,
|
deleteBatchRecords,
|
||||||
options,
|
options,
|
||||||
searchFormRef,
|
searchFormRef,
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<template></template>
|
||||||
|
|
||||||
|
<script setup></script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<template></template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -14,16 +14,38 @@
|
||||||
ref="formRef1"
|
ref="formRef1"
|
||||||
>
|
>
|
||||||
<template #productNameSlot="{ model, item }">
|
<template #productNameSlot="{ model, item }">
|
||||||
<a-input readonly v-bind="{ ...item.attrs }" v-model:value="model[item.name]" @click="openMateriel"></a-input>
|
<a-input
|
||||||
|
:disabled="route.query.type === 'SEARCH'"
|
||||||
|
readonly
|
||||||
|
v-bind="{ ...item.attrs }"
|
||||||
|
v-model:value="model[item.name]"
|
||||||
|
@click="openMateriel"
|
||||||
|
></a-input>
|
||||||
</template>
|
</template>
|
||||||
<template #produceUnitNameSlot="{ model, item }">
|
<template #produceUnitNameSlot="{ model, item }">
|
||||||
<a-select v-bind="{ ...item.attrs }" v-model:value="model[item.name]" :options="unitList"></a-select>
|
<a-select
|
||||||
|
:disabled="route.query.type === 'SEARCH'"
|
||||||
|
v-bind="{ ...item.attrs }"
|
||||||
|
v-model:value="model[item.name]"
|
||||||
|
:options="unitList"
|
||||||
|
></a-select>
|
||||||
</template>
|
</template>
|
||||||
<template #baseUnitNameSlot="{ model, item }">
|
<template #baseUnitNameSlot="{ model, item }">
|
||||||
<a-select v-bind="{ ...item.attrs }" v-model:value="model[item.name]" :options="unitList"></a-select>
|
<a-select
|
||||||
|
:disabled="route.query.type === 'SEARCH'"
|
||||||
|
v-bind="{ ...item.attrs }"
|
||||||
|
v-model:value="model[item.name]"
|
||||||
|
:options="unitList"
|
||||||
|
></a-select>
|
||||||
</template>
|
</template>
|
||||||
<template #productionLineNameSlot="{ model, item }">
|
<template #productionLineNameSlot="{ model, item }">
|
||||||
<a-input readonly v-bind="{ ...item.attrs }" v-model:value="model[item.name]" @click="openLine"></a-input>
|
<a-input
|
||||||
|
:disabled="route.query.type === 'SEARCH'"
|
||||||
|
readonly
|
||||||
|
v-bind="{ ...item.attrs }"
|
||||||
|
v-model:value="model[item.name]"
|
||||||
|
@click="openLine"
|
||||||
|
></a-input>
|
||||||
</template>
|
</template>
|
||||||
</DynamicForm>
|
</DynamicForm>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -45,7 +67,7 @@
|
||||||
/>
|
/>
|
||||||
<a-empty v-else />
|
<a-empty v-else />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="2" tab="操作信息" v-if="route.query.type !== 'ADD'">
|
<a-tab-pane key="2" tab="操作信息" v-if="route.query.type !== 'ADD'" forceRender>
|
||||||
<OperationalInformation :detailData="inform" :colSpan="6"></OperationalInformation>
|
<OperationalInformation :detailData="inform" :colSpan="6"></OperationalInformation>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
|
@ -68,15 +90,17 @@
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const formRules = {
|
const formRules = {
|
||||||
name: [required('请输入名称')],
|
productName: [required('请选择产品')],
|
||||||
type: [required('请输入类型')],
|
produceType: [required('请选择生产类型')],
|
||||||
appid: [required('请输入AppID')],
|
producePlanDate: [required('请选择计划开工日期')],
|
||||||
secret: [required('请输入AppSecret')]
|
producePlanAmount: [required('请选择生产数量')],
|
||||||
|
produceUnitName: [required('请选择生产单位')],
|
||||||
|
baseUnitName: [required('请选择基本单位')],
|
||||||
|
productionLineName: [required('请选择生产线')]
|
||||||
}
|
}
|
||||||
|
|
||||||
const formRef1 = ref(null)
|
const formRef1 = ref(null)
|
||||||
let detailData = ref({})
|
let activeKey = ref('2')
|
||||||
let activeKey = ref('1')
|
|
||||||
let extendData = ref([])
|
let extendData = ref([])
|
||||||
|
|
||||||
const { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } =
|
const { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } =
|
||||||
|
@ -89,7 +113,12 @@
|
||||||
formRefs.value = [formRef1.value]
|
formRefs.value = [formRef1.value]
|
||||||
fetchData(route.query.type).then((res) => {
|
fetchData(route.query.type).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
detailData.value = res
|
formData.productNumber = res.productNumber // 物料名称
|
||||||
|
formData.productId = res.productId // 物料id
|
||||||
|
formData.produceUnitId = res.produceUnitId // 生产单位id
|
||||||
|
formData.baseUnitId = res.baseUnitId // 生产单位id
|
||||||
|
formData.productionLineNumber = res.productionLineNumber
|
||||||
|
formData.productionLineId = res.productionLineId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -112,6 +141,7 @@
|
||||||
// 物料选择器返回操作
|
// 物料选择器返回操作
|
||||||
const materielBackOk = (event) => {
|
const materielBackOk = (event) => {
|
||||||
formData.productName = event.materielSelectedRows[0].name // 物料名称
|
formData.productName = event.materielSelectedRows[0].name // 物料名称
|
||||||
|
formData.productNumber = event.materielSelectedRows[0].number // 物料名称
|
||||||
formData.productId = event.materielSelectedRows[0].id // 物料id
|
formData.productId = event.materielSelectedRows[0].id // 物料id
|
||||||
// 选择物料自动带出基本单位和生产单位
|
// 选择物料自动带出基本单位和生产单位
|
||||||
formData.produceUnitName = event.materielSelectedRows[0].produceUnitName // 生产单位
|
formData.produceUnitName = event.materielSelectedRows[0].produceUnitName // 生产单位
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { required } from '@/utils/formRules'
|
||||||
|
|
||||||
export const basicInfoFormItems = [
|
export const basicInfoFormItems = [
|
||||||
{
|
{
|
||||||
label: '单号:',
|
label: '单据号:',
|
||||||
name: 'number',
|
name: 'billNumber',
|
||||||
type: 'a-input',
|
type: 'a-input',
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入单号',
|
placeholder: '请输入单号',
|
||||||
|
@ -43,10 +43,10 @@ export const basicInfoFormItems = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '批次:',
|
label: '批次:',
|
||||||
name: 'aesKey',
|
name: 'batchNumber',
|
||||||
type: 'a-input',
|
type: 'a-input',
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入签名方式',
|
placeholder: '请输入批次',
|
||||||
allowClear: true
|
allowClear: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -55,7 +55,7 @@ export const basicInfoFormItems = [
|
||||||
name: 'producePlanAmount',
|
name: 'producePlanAmount',
|
||||||
type: 'a-input-number',
|
type: 'a-input-number',
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入签名方式',
|
placeholder: '请输入计划生产数量',
|
||||||
allowClear: true
|
allowClear: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -101,11 +101,11 @@ export const basicInfoFormItems = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '备注:',
|
label: '备注:',
|
||||||
name: 'aesKey',
|
name: 'remarks',
|
||||||
type: 'a-textarea',
|
type: 'a-textarea',
|
||||||
span: 24,
|
span: 24,
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请输入签名方式',
|
placeholder: '请输入备注',
|
||||||
allowClear: true
|
allowClear: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,15 +57,24 @@
|
||||||
:selectedRowKeys="selectedRowKeys"
|
:selectedRowKeys="selectedRowKeys"
|
||||||
@batchDelete="deleteBatchRecords"
|
@batchDelete="deleteBatchRecords"
|
||||||
/>
|
/>
|
||||||
|
<a-button type="primary" @click="handleExamine">
|
||||||
|
<template #icon><plus-outlined /></template>
|
||||||
|
审核
|
||||||
|
</a-button>
|
||||||
|
<a-button type="primary" @click="handleReject">
|
||||||
|
<template #icon><plus-outlined /></template>
|
||||||
|
反审核
|
||||||
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'number'">
|
<template v-if="column.dataIndex === 'number'">
|
||||||
<a href="#">{{ record.number }}</a>
|
<a href="#">{{ record.number }}</a>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'enabledState'">
|
<template v-if="column.dataIndex === 'state'">
|
||||||
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'">启用</a-tag>
|
<a-tag :color="tagColorList[record.state - 1]">{{
|
||||||
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'">停用</a-tag>
|
$TOOL.dictTypeData('PRODUCE_TASK_STATE', record.state || '')
|
||||||
|
}}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
|
@ -117,11 +126,14 @@
|
||||||
<script setup name="task">
|
<script setup name="task">
|
||||||
import produceTaskApi from '@/api/production/produceTask/produceTaskApi'
|
import produceTaskApi from '@/api/production/produceTask/produceTaskApi'
|
||||||
import { useTableManagement } from '@/hook/useTableManagement'
|
import { useTableManagement } from '@/hook/useTableManagement'
|
||||||
|
import { message } from 'ant-design-vue'
|
||||||
|
|
||||||
|
const tagColorList = ['warning', 'success', 'error', 'purple']
|
||||||
|
|
||||||
const publicAccountColumn = [
|
const publicAccountColumn = [
|
||||||
{
|
{
|
||||||
title: '单号',
|
title: '单号',
|
||||||
dataIndex: 'type',
|
dataIndex: 'billNumber',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -130,26 +142,26 @@
|
||||||
sortDirections: ['descend', 'ascend']
|
sortDirections: ['descend', 'ascend']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '计划开工日期',
|
title: '状态',
|
||||||
dataIndex: 'name',
|
dataIndex: 'state',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '可用状态',
|
title: '计划开工日期',
|
||||||
dataIndex: 'enabledState',
|
dataIndex: 'producePlanDate',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 100,
|
width: 300,
|
||||||
ellipsis: true
|
ellipsis: true,
|
||||||
|
sorter: true,
|
||||||
|
sortDirections: ['descend', 'ascend']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '生产类型',
|
title: '生产类型',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'produceType',
|
||||||
sorter: true,
|
|
||||||
sortDirections: ['descend', 'ascend'],
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -157,9 +169,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '产品名称',
|
title: '产品名称',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'productName',
|
||||||
sorter: true,
|
|
||||||
sortDirections: ['descend', 'ascend'],
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -167,9 +177,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '产品编码',
|
title: '产品编码',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'productNumber',
|
||||||
sorter: true,
|
|
||||||
sortDirections: ['descend', 'ascend'],
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -177,19 +185,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '生产线',
|
title: '生产线',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'productionLineName',
|
||||||
sorter: true,
|
|
||||||
sortDirections: ['descend', 'ascend'],
|
|
||||||
align: 'center',
|
|
||||||
resizable: true,
|
|
||||||
width: 300,
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '生产编码',
|
|
||||||
dataIndex: 'createTime',
|
|
||||||
sorter: true,
|
|
||||||
sortDirections: ['descend', 'ascend'],
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -197,7 +193,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '计划生产数量',
|
title: '计划生产数量',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'producePlanAmount',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
sortDirections: ['descend', 'ascend'],
|
sortDirections: ['descend', 'ascend'],
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -206,10 +202,8 @@
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '单位',
|
title: '生产单位',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'produceUnitName',
|
||||||
sorter: true,
|
|
||||||
sortDirections: ['descend', 'ascend'],
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -228,7 +222,6 @@
|
||||||
deleteBatchRecords,
|
deleteBatchRecords,
|
||||||
options,
|
options,
|
||||||
searchFormRef,
|
searchFormRef,
|
||||||
toolConfig,
|
|
||||||
navigateTo
|
navigateTo
|
||||||
} = useTableManagement(
|
} = useTableManagement(
|
||||||
{
|
{
|
||||||
|
@ -238,4 +231,42 @@
|
||||||
publicAccountColumn,
|
publicAccountColumn,
|
||||||
['officialAccountEdit', 'officialAccountDelete']
|
['officialAccountEdit', 'officialAccountDelete']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 审核
|
||||||
|
const handleExamine = () => {
|
||||||
|
if (selectedRowKeys.value.length === 0) return message.error('请选择审核数据!')
|
||||||
|
produceTaskApi
|
||||||
|
.produceTaskAuditPass(
|
||||||
|
selectedRowKeys.value.map((item) => {
|
||||||
|
return {
|
||||||
|
id: item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
message.success('审核成功!')
|
||||||
|
|
||||||
|
tableRef.value.refresh()
|
||||||
|
tableRef.value.clearRefreshSelected()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 反审核
|
||||||
|
const handleReject = () => {
|
||||||
|
if (selectedRowKeys.value.length === 0) return message.error('请选择反审核数据!')
|
||||||
|
produceTaskApi
|
||||||
|
.produceTaskAudiTask(
|
||||||
|
selectedRowKeys.value.map((item) => {
|
||||||
|
return {
|
||||||
|
id: item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
message.success('审核成功!')
|
||||||
|
|
||||||
|
tableRef.value.refresh()
|
||||||
|
tableRef.value.clearRefreshSelected()
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue