基础资料优化处理
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) {
|
||||
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,
|
||||
width: 150
|
||||
},
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
|
||||
const formRules = {
|
||||
name: [required('请输入名称')],
|
||||
type: [required('请输入类型')],
|
||||
appid: [required('请输入AppID')],
|
||||
secret: [required('请输入AppSecret')]
|
||||
phone: [required('请输入电话号码')],
|
||||
isFit: [required('请输入是否合适')],
|
||||
categoryId: [required('请选择员工分类')]
|
||||
}
|
||||
|
||||
const baseFormItems = reactive([
|
||||
|
|
|
@ -89,8 +89,13 @@
|
|||
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'">启用</a-tag>
|
||||
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'">停用</a-tag>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'type'">
|
||||
{{ $TOOL.dictTypeData('OFFICIAL_ACCOUNT_TYPE', record.type) }}
|
||||
<template v-if="column.dataIndex === 'isJoinGroup'">
|
||||
<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 v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
|
@ -146,9 +151,76 @@
|
|||
import employeeApi from '@/api/base/employee/employeeApi'
|
||||
import employeeCategoryApi from '@/api/base/employee/employeeCategoryApi'
|
||||
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'
|
||||
|
||||
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 dynamicTreeRef = ref(null)
|
||||
|
||||
|
|
|
@ -13,7 +13,13 @@
|
|||
ref="formRef1"
|
||||
>
|
||||
<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 #produceUnitNameSlot="{ model, item }">
|
||||
<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-table :dataSource="dataSource" :columns="columns" :pagination="false">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'index'">
|
||||
{{ index + 1 }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'isFit'">
|
||||
<a-select
|
||||
:disabled="route.query.type === 'SEARCH'"
|
||||
|
@ -65,7 +74,10 @@
|
|||
</template>
|
||||
|
||||
<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>
|
||||
</a-table>
|
||||
|
@ -92,7 +104,6 @@
|
|||
:user-page-api="selectorApiFunction.userPageApi"
|
||||
:checkedUserListApi="selectorApiFunction.userListByIdListApi"
|
||||
@onBack="userSelectorOnBack"
|
||||
:radioModel="true"
|
||||
></employee-selector-plus>
|
||||
|
||||
<personnel-form ref="personnelFormRef" @successful="successful"></personnel-form>
|
||||
|
@ -113,6 +124,7 @@
|
|||
import { required } from '@/utils/formRules'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { message } from 'ant-design-vue'
|
||||
import manualTaskDetailApi from "@/api/base/manual-task/manualTaskDetailApi";
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
|
@ -123,7 +135,8 @@
|
|||
type: 'a-input',
|
||||
attrs: {
|
||||
placeholder: '请输入单号',
|
||||
allowClear: true
|
||||
allowClear: true,
|
||||
disabled: route.query.type !== 'ADD'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -133,7 +146,8 @@
|
|||
attrs: {
|
||||
placeholder: '请输入开工日期',
|
||||
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,
|
||||
slotName: 'materialNameSlot',
|
||||
attrs: {
|
||||
placeholder: '请输入物料'
|
||||
placeholder: '请输入物料',
|
||||
disabled: route.query.type !== 'ADD'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -152,7 +167,7 @@
|
|||
type: 'a-input',
|
||||
attrs: {
|
||||
disabled: true,
|
||||
placeholder: '请输入基本单位'
|
||||
placeholder: '请输入基本单位',
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -163,7 +178,7 @@
|
|||
attrs: {
|
||||
placeholder: '请选择生产线',
|
||||
allowClear: true,
|
||||
disabled: route.query.type === 'SEARCH'
|
||||
disabled: route.query.type !== 'ADD'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -173,16 +188,16 @@
|
|||
span: 24,
|
||||
attrs: {
|
||||
placeholder: '请输入签名方式',
|
||||
allowClear: true
|
||||
allowClear: true,
|
||||
disabled: route.query.type !== 'ADD'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
const formRef1 = ref(null)
|
||||
const formRules = {
|
||||
name: [required('请输入名称')],
|
||||
type: [required('请输入类型')],
|
||||
appid: [required('请输入AppID')],
|
||||
secret: [required('请输入AppSecret')]
|
||||
materialName: [required('请输入物料')],
|
||||
productionLineName: [required('请输入生产线')]
|
||||
}
|
||||
let activeKey = ref('1')
|
||||
|
||||
|
@ -193,15 +208,38 @@
|
|||
})
|
||||
|
||||
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 })
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
formRefs.value = [formRef1.value]
|
||||
fetchData(route.query.type).then(async (res) => {
|
||||
if (res) {
|
||||
manualTaskApi.manualTaskDetailPage({
|
||||
formData.materialId = res.materialId // 物料id
|
||||
formData.materialNumber = res.materialNumber // 物料id
|
||||
// 选择物料自动带出基本单位和生产单位
|
||||
formData.baseUnitId = res.baseUnitId // 生产单位id
|
||||
|
||||
// 获取物料的生产价格
|
||||
materielMoney = res.producePrice
|
||||
|
||||
manualTaskDetailApi
|
||||
.manualTaskDetailPage({
|
||||
manualTaskId: res.id
|
||||
}).then(detailPage => {
|
||||
})
|
||||
.then((detailPage) => {
|
||||
dataSource.value = detailPage.records
|
||||
})
|
||||
}
|
||||
|
@ -264,7 +302,7 @@
|
|||
})
|
||||
},
|
||||
userPageApi: (param) => {
|
||||
return employeeApi.employeePage(param).then((data) => {
|
||||
return employeeApi.employeePage({ ...param, enabledState: 'ENABLE' }).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
@ -279,6 +317,10 @@
|
|||
const userSelectorOnBack = (data) => {
|
||||
if (data.length > 0) {
|
||||
data.forEach((i) => {
|
||||
// 检查是否已经存在相同的 employeeId
|
||||
const exists = dataSource.value.find((item) => item.employeeId === i.id)
|
||||
|
||||
if (!exists) {
|
||||
dataSource.value.push({
|
||||
employeeId: i.id,
|
||||
employeeName: i.name,
|
||||
|
@ -289,6 +331,9 @@
|
|||
amount: null,
|
||||
money: null
|
||||
})
|
||||
} else {
|
||||
message.warning(`员工 ${i.name} 已经存在,未重复添加。`)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -297,6 +342,12 @@
|
|||
* 人员列表
|
||||
* */
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
title: '员工姓名',
|
||||
dataIndex: 'employeeName',
|
||||
|
@ -305,19 +356,26 @@
|
|||
width: 200
|
||||
},
|
||||
{
|
||||
title: '员工身份证号',
|
||||
dataIndex: 'employeeIdNumber',
|
||||
title: '员工手机号',
|
||||
dataIndex: 'employeePhone',
|
||||
editable: true,
|
||||
align: 'center',
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: '员工编号',
|
||||
dataIndex: 'employeeNumber',
|
||||
title: '员工性别',
|
||||
dataIndex: 'employeeSex',
|
||||
editable: true,
|
||||
align: 'center',
|
||||
width: 200
|
||||
},
|
||||
// {
|
||||
// title: '员工编号',
|
||||
// dataIndex: 'employeeNumber',
|
||||
// editable: true,
|
||||
// align: 'center',
|
||||
// width: 200
|
||||
// },
|
||||
{
|
||||
title: '是否合适',
|
||||
dataIndex: 'isFit',
|
||||
|
@ -345,10 +403,31 @@
|
|||
editable: true,
|
||||
align: 'center',
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
editable: true,
|
||||
align: 'center',
|
||||
width: 100
|
||||
}
|
||||
]
|
||||
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) => {
|
||||
record.money = event * materielMoney
|
||||
|
@ -359,9 +438,19 @@
|
|||
* */
|
||||
const personnelFormRef = ref(null)
|
||||
const handleOpenAddUser = () => {
|
||||
if (materielMoney === 0) return message.error('请选择物料,当前生产价格为0')
|
||||
personnelFormRef.value.onOpen()
|
||||
}
|
||||
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({
|
||||
employeeId: data.id,
|
||||
employeeName: data.name,
|
||||
|
|
|
@ -62,6 +62,16 @@
|
|||
</a-tree-select>
|
||||
</a-form-item>
|
||||
</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-form>
|
||||
<template #footer>
|
||||
|
@ -82,7 +92,9 @@
|
|||
const visible = ref(false)
|
||||
const emit = defineEmits({ successful: null })
|
||||
const formRef = ref()
|
||||
const formData = ref({})
|
||||
const formData = ref({
|
||||
enabledState: 'ENABLE'
|
||||
})
|
||||
const submitLoading = ref(false)
|
||||
let pageType = ref('ADD')
|
||||
|
||||
|
@ -102,7 +114,10 @@
|
|||
}
|
||||
// 默认要校验的refresh
|
||||
const formRules = {
|
||||
name: [required('请输入姓名')]
|
||||
name: [required('请输入姓名')],
|
||||
isFit: [required('请选择是否合适')],
|
||||
categoryId: [required('请选择上级员工分类')],
|
||||
phone: [required('请输入手机号码')]
|
||||
}
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
|
|
|
@ -88,9 +88,8 @@
|
|||
<!-- 查看-->
|
||||
</a>
|
||||
</a-tooltip>
|
||||
|
||||
<!-- <a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
|
||||
<a-tooltip title="查看">
|
||||
<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
|
||||
<a-tooltip title="编辑">
|
||||
<a
|
||||
@click="
|
||||
navigateTo('/employee/personnelReport/detail', {
|
||||
|
@ -101,22 +100,24 @@
|
|||
v-if="hasPerm('customerEdit')"
|
||||
>
|
||||
<FormOutlined />
|
||||
<!– 编辑–>
|
||||
<!-- 编辑-->
|
||||
</a>
|
||||
</a-tooltip>
|
||||
|
||||
<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
|
||||
<a-popconfirm title="确定要删除吗?" @confirm="deleteRecord(record)">
|
||||
<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">
|
||||
<DeleteOutlined />
|
||||
<!– 删除–>
|
||||
</a-button>
|
||||
</a-popconfirm>-->
|
||||
<a-divider type="vertical"></a-divider>
|
||||
<a-tooltip title="添加标签">
|
||||
<a @click="handleOpenTag(record)" :style="{color: record.tagColor}">
|
||||
<TagFilled />
|
||||
<!-- 查看-->
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
|
||||
<tag-modal ref="tagModalRef" :saveTagApi="manualTaskApi.manualTaskSaveTag" />
|
||||
</template>
|
||||
|
||||
<script setup name="brand">
|
||||
|
@ -178,6 +179,12 @@
|
|||
}
|
||||
]
|
||||
|
||||
const tagModalRef = ref(null)
|
||||
|
||||
const handleOpenTag = (record) => {
|
||||
tagModalRef.value.openModal(record)
|
||||
}
|
||||
|
||||
const {
|
||||
searchFormState,
|
||||
tableRef,
|
||||
|
@ -185,7 +192,6 @@
|
|||
columns,
|
||||
loadData,
|
||||
reset,
|
||||
deleteRecord,
|
||||
deleteBatchRecords,
|
||||
options,
|
||||
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"
|
||||
>
|
||||
<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 #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 #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 #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>
|
||||
</DynamicForm>
|
||||
</a-card>
|
||||
|
@ -45,7 +67,7 @@
|
|||
/>
|
||||
<a-empty v-else />
|
||||
</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>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
@ -68,15 +90,17 @@
|
|||
const route = useRoute()
|
||||
|
||||
const formRules = {
|
||||
name: [required('请输入名称')],
|
||||
type: [required('请输入类型')],
|
||||
appid: [required('请输入AppID')],
|
||||
secret: [required('请输入AppSecret')]
|
||||
productName: [required('请选择产品')],
|
||||
produceType: [required('请选择生产类型')],
|
||||
producePlanDate: [required('请选择计划开工日期')],
|
||||
producePlanAmount: [required('请选择生产数量')],
|
||||
produceUnitName: [required('请选择生产单位')],
|
||||
baseUnitName: [required('请选择基本单位')],
|
||||
productionLineName: [required('请选择生产线')]
|
||||
}
|
||||
|
||||
const formRef1 = ref(null)
|
||||
let detailData = ref({})
|
||||
let activeKey = ref('1')
|
||||
let activeKey = ref('2')
|
||||
let extendData = ref([])
|
||||
|
||||
const { formData, formRefs, inform, extendFormData, onSubmit, handleBack, fetchData, getExtendField } =
|
||||
|
@ -89,7 +113,12 @@
|
|||
formRefs.value = [formRef1.value]
|
||||
fetchData(route.query.type).then((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) => {
|
||||
formData.productName = event.materielSelectedRows[0].name // 物料名称
|
||||
formData.productNumber = event.materielSelectedRows[0].number // 物料名称
|
||||
formData.productId = event.materielSelectedRows[0].id // 物料id
|
||||
// 选择物料自动带出基本单位和生产单位
|
||||
formData.produceUnitName = event.materielSelectedRows[0].produceUnitName // 生产单位
|
||||
|
|
|
@ -3,8 +3,8 @@ import { required } from '@/utils/formRules'
|
|||
|
||||
export const basicInfoFormItems = [
|
||||
{
|
||||
label: '单号:',
|
||||
name: 'number',
|
||||
label: '单据号:',
|
||||
name: 'billNumber',
|
||||
type: 'a-input',
|
||||
attrs: {
|
||||
placeholder: '请输入单号',
|
||||
|
@ -43,10 +43,10 @@ export const basicInfoFormItems = [
|
|||
},
|
||||
{
|
||||
label: '批次:',
|
||||
name: 'aesKey',
|
||||
name: 'batchNumber',
|
||||
type: 'a-input',
|
||||
attrs: {
|
||||
placeholder: '请输入签名方式',
|
||||
placeholder: '请输入批次',
|
||||
allowClear: true
|
||||
}
|
||||
},
|
||||
|
@ -55,7 +55,7 @@ export const basicInfoFormItems = [
|
|||
name: 'producePlanAmount',
|
||||
type: 'a-input-number',
|
||||
attrs: {
|
||||
placeholder: '请输入签名方式',
|
||||
placeholder: '请输入计划生产数量',
|
||||
allowClear: true
|
||||
}
|
||||
},
|
||||
|
@ -101,11 +101,11 @@ export const basicInfoFormItems = [
|
|||
},
|
||||
{
|
||||
label: '备注:',
|
||||
name: 'aesKey',
|
||||
name: 'remarks',
|
||||
type: 'a-textarea',
|
||||
span: 24,
|
||||
attrs: {
|
||||
placeholder: '请输入签名方式',
|
||||
placeholder: '请输入备注',
|
||||
allowClear: true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,15 +57,24 @@
|
|||
:selectedRowKeys="selectedRowKeys"
|
||||
@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>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'number'">
|
||||
<a href="#">{{ record.number }}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'enabledState'">
|
||||
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'">启用</a-tag>
|
||||
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'">停用</a-tag>
|
||||
<template v-if="column.dataIndex === 'state'">
|
||||
<a-tag :color="tagColorList[record.state - 1]">{{
|
||||
$TOOL.dictTypeData('PRODUCE_TASK_STATE', record.state || '')
|
||||
}}</a-tag>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-space>
|
||||
|
@ -117,11 +126,14 @@
|
|||
<script setup name="task">
|
||||
import produceTaskApi from '@/api/production/produceTask/produceTaskApi'
|
||||
import { useTableManagement } from '@/hook/useTableManagement'
|
||||
import { message } from 'ant-design-vue'
|
||||
|
||||
const tagColorList = ['warning', 'success', 'error', 'purple']
|
||||
|
||||
const publicAccountColumn = [
|
||||
{
|
||||
title: '单号',
|
||||
dataIndex: 'type',
|
||||
dataIndex: 'billNumber',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
|
@ -130,26 +142,26 @@
|
|||
sortDirections: ['descend', 'ascend']
|
||||
},
|
||||
{
|
||||
title: '计划开工日期',
|
||||
dataIndex: 'name',
|
||||
title: '状态',
|
||||
dataIndex: 'state',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '可用状态',
|
||||
dataIndex: 'enabledState',
|
||||
title: '计划开工日期',
|
||||
dataIndex: 'producePlanDate',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 100,
|
||||
ellipsis: true
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend']
|
||||
},
|
||||
{
|
||||
title: '生产类型',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
dataIndex: 'produceType',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
|
@ -157,9 +169,7 @@
|
|||
},
|
||||
{
|
||||
title: '产品名称',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
dataIndex: 'productName',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
|
@ -167,9 +177,7 @@
|
|||
},
|
||||
{
|
||||
title: '产品编码',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
dataIndex: 'productNumber',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
|
@ -177,19 +185,7 @@
|
|||
},
|
||||
{
|
||||
title: '生产线',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '生产编码',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
dataIndex: 'productionLineName',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
|
@ -197,7 +193,7 @@
|
|||
},
|
||||
{
|
||||
title: '计划生产数量',
|
||||
dataIndex: 'createTime',
|
||||
dataIndex: 'producePlanAmount',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
align: 'center',
|
||||
|
@ -206,10 +202,8 @@
|
|||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
sortDirections: ['descend', 'ascend'],
|
||||
title: '生产单位',
|
||||
dataIndex: 'produceUnitName',
|
||||
align: 'center',
|
||||
resizable: true,
|
||||
width: 300,
|
||||
|
@ -228,7 +222,6 @@
|
|||
deleteBatchRecords,
|
||||
options,
|
||||
searchFormRef,
|
||||
toolConfig,
|
||||
navigateTo
|
||||
} = useTableManagement(
|
||||
{
|
||||
|
@ -238,4 +231,42 @@
|
|||
publicAccountColumn,
|
||||
['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>
|
||||
|
|
Loading…
Reference in New Issue