Browse Source

Merge remote-tracking branch 'origin/master_hella' into master_hella

master_hella_20240701
gaojs 6 months ago
parent
commit
0ef852896b
  1. 5
      .env.development
  2. 3
      .env.test
  3. 4
      .env.test-scp
  4. 7
      .env.wyf
  5. 71
      src/api/wms/containerMainRequest/index.ts
  6. 58
      src/api/wms/qadproductionplan/index.ts
  7. 15
      src/views/login/components/LoginForm.vue
  8. 15
      src/views/login/components/MobileForm.vue
  9. 16
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts
  10. 17
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue
  11. 16
      src/views/wms/inventoryjobManage/containermanage/containerRecordMain/containerRecordMain.data.ts
  12. 8
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue
  13. 16
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts
  14. 6
      src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue
  15. 16
      src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/scrapContainerMainRequest.data.ts
  16. 244
      src/views/wms/productionManage/productionplan/qadproductionplan/index.vue
  17. 119
      src/views/wms/productionManage/productionplan/qadproductionplan/qadProductionPlanMain.data.ts

5
.env.development

@ -34,4 +34,7 @@ VITE_OUT_DIR=dist
VITE_INTERFACE_URL='http://localhost:12080/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://localhost:12080'
VITE_JMREPORT_BASE_URL='http://localhost:12080'
# 租户配置
VITE_TENANT='["长春","成都"]'

3
.env.test

@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://dev.ccwin-in.com:25310/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'
# 租户配置
VITE_TENANT='["长春","成都"]'

4
.env.test-scp

@ -35,3 +35,7 @@ VITE_INTERFACE_URL='http://dev.ccwin-in.com:25311/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25311'
# 租户配置
VITE_TENANT='["长春","成都"]'

7
.env.wyf

@ -4,9 +4,9 @@ NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.113:12080'
VITE_BASE_URL='http://192.168.0.108:12080'
# 上传路径
VITE_UPLOAD_URL='http://192.168.0.113:12080/admin-api/infra/file/upload'
VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload'
# # 请求路径
# VITE_BASE_URL='http://dev.ccwin-in.com:25300/api'
@ -46,3 +46,6 @@ VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080'
# # 积木报表请求路径
# VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'
# 租户配置
VITE_TENANT='["长春","成都"]'

71
src/api/wms/containerMainRequest/index.ts

@ -14,7 +14,7 @@ export interface ContainerMainRequestVO {
export const getContainerMainRequestPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/senior', data })
} else {
return await request.get({ url: `/wms/container-main-request/page`, params })
@ -43,7 +43,74 @@ export const deleteContainerMainRequest = async (id: number) => {
// 导出器具管理申请主 Excel
export const exportContainerMainRequest = async (params) => {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
params.businessType = 'ContainerManage'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
}
// 导出初始化器具管理申请主 Excel
export const exportInitialContainerMainRequest = async (params) => {
params.businessType = 'InitialContainerManage'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
}
// 导出初始化器具管理申请主 Excel
export const exportScrapContainerMainRequest = async (params) => {
params.businessType = 'ScrapContainerManage'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
}
// 导出移动器具管理申请主 Excel
export const exportMoveContainerMainRequest = async (params) => {
params.businessType = 'MoveContainerManage'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
}
// 导出返回器具管理申请主 Excel
export const exportReturnContainerMainRequest = async (params) => {
params.businessType = 'ReturnContainerManage'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
}
// 导出发运器具管理申请主 Excel
export const exportDeliverContainerMainRequest = async (params) => {
params.businessType = 'DeliverContainerManage'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/container-main-request/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
}
// 下载用户导入模板

58
src/api/wms/qadproductionplan/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface QadProductionPlanMainVO {
displayOrder: number
workshop: string
productionLine: string
shift: string
team: string
planDate: Date
details: string
number: string
planType: string
businessType: string
remark: string
woNumber: string
woLine: string
}
// 查询QAD生产计划主列表
export const getQadProductionPlanMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/qad-production-plan-main/senior', data })
} else {
return await request.get({ url: `/wms/qad-production-plan-main/page`, params })
}
}
// 查询QAD生产计划主详情
export const getQadProductionPlanMain = async (id: number) => {
return await request.get({ url: `/wms/qad-production-plan-main/get?id=` + id })
}
// 新增QAD生产计划主
export const createQadProductionPlanMain = async (data: QadProductionPlanMainVO) => {
return await request.post({ url: `/wms/qad-production-plan-main/create`, data })
}
// 修改QAD生产计划主
export const updateQadProductionPlanMain = async (data: QadProductionPlanMainVO) => {
return await request.put({ url: `/wms/qad-production-plan-main/update`, data })
}
// 删除QAD生产计划主
export const deleteQadProductionPlanMain = async (id: number) => {
return await request.delete({ url: `/wms/qad-production-plan-main/delete?id=` + id })
}
// 导出QAD生产计划主 Excel
export const exportQadProductionPlanMain = async (params) => {
return await request.download({ url: `/wms/qad-production-plan-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/qad-production-plan-main/get-import-template' })
}

15
src/views/login/components/LoginForm.vue

@ -9,8 +9,16 @@
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
<el-input v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse" link type="primary" />
<!-- <el-input v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse" link type="primary" /> -->
<el-select v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')" :prefix-icon="iconHouse">
<el-option
v-for="item in tenantArray"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
@ -110,6 +118,7 @@
//
const captchaEnabled = ref(true);
const codeUrl = ref("");
const tenantArray = JSON.parse(import.meta.env.VITE_TENANT);
const LoginRules = {
tenantName: [required],
@ -121,7 +130,7 @@
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
loginForm: {
tenantName: '闻荫源码',
tenantName: tenantArray[0],
username: 'admin',
password: '123456',
captchaVerification: '',

15
src/views/login/components/MobileForm.vue

@ -18,13 +18,21 @@
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
<el-input
<!-- <el-input
v-model="loginData.loginForm.tenantName"
:placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse"
type="primary"
link
/>
/> -->
<el-select v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')" :prefix-icon="iconHouse">
<el-option
v-for="item in tenantArray"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<!-- 手机号 -->
@ -117,6 +125,7 @@ const iconCircleCheck = useIcon({ icon: 'ep:circle-check' })
const { validForm } = useFormValid(formSmsLogin)
const { handleBackLogin, getLoginState } = useLoginState()
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.MOBILE)
const tenantArray = JSON.parse(import.meta.env.VITE_TENANT);
const rules = {
tenantName: [required],
@ -132,7 +141,7 @@ const loginData = reactive({
},
loginForm: {
uuid: '',
tenantName: '闻荫源码',
tenantName: tenantArray[0],
mobileNumber: '',
code: ''
}

16
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts

@ -96,6 +96,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
isSearch: true,
isTable: false
},
{
label: '部门',
@ -219,9 +220,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable: false,
isForm: false,
},
{
@ -247,9 +246,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
isTable: false,
},
{
label: '操作',
@ -439,6 +436,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isTable: false
},
{
label: '创建时间',
@ -453,9 +451,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable: false,
isForm: false,
isTableForm: false
},
@ -495,6 +491,8 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作',
field: 'action',
isForm: false,
hiddenInMain:true,
isTableForm: false,
table: {
width: 150,
fixed: 'right'

17
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue

@ -298,7 +298,7 @@ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['ma
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:container-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:refused'}), //
@ -466,8 +466,19 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请主.xlsx')
if(routeName.value == 'ReturnContainerManageRequest'){
const data = await ContainerMainRequestApi.exportReturnContainerMainRequest(tableObject.params)
download.excel(data, '器具返回申请.xlsx')
}else if ( routeName.value == 'MoveContainerManageRequest') {
const data = await ContainerMainRequestApi.exportMoveContainerMainRequest(tableObject.params)
download.excel(data, '器具转移申请.xlsx')
}else if ( routeName.value == 'DeliverContainerManageRequest') {
const data = await ContainerMainRequestApi.exportDeliverContainerMainRequest(tableObject.params)
download.excel(data, '器具发运申请.xlsx')
}else{
const data = await ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请.xlsx')
}
} catch {
} finally {
exportLoading.value = false

16
src/views/wms/inventoryjobManage/containermanage/containerRecordMain/containerRecordMain.data.ts

@ -63,6 +63,7 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isTable: false
},
{
label: '部门',
@ -112,9 +113,7 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
isTable: false,
},
{
label: '创建时间',
@ -129,9 +128,7 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable: false,
isForm: false,
},
{
@ -220,6 +217,7 @@ export const ContainerRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isTable: false
},
{
label: '创建时间',
@ -234,9 +232,7 @@ export const ContainerRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable: false,
isForm: false,
isTableForm: false
},
@ -276,6 +272,8 @@ export const ContainerRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作',
field: 'action',
isForm: false,
hiddenInMain:true,
isTableForm: false,
table: {
width: 150,
fixed: 'right'

8
src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue

@ -250,7 +250,7 @@ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['ma
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:container-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:refused'}), //
@ -420,8 +420,8 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请主.xlsx')
const data = await ContainerMainRequestApi.exportInitialContainerMainRequest(tableObject.params)
download.excel(data, '初始化器具管理申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -436,7 +436,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'importFileName.xlsx'
templateTitle: importFileName.value + '.xlsx'
})
//
const importSuccess = () => {

16
src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts

@ -100,6 +100,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
isSearch: true,
isTable:false,
},
{
label: '部门',
@ -223,9 +224,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable:false,
isForm: false,
},
{
@ -251,9 +250,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
isTable:false,
},
{
label: '操作',
@ -410,6 +407,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isTable:false,
},
{
label: '创建时间',
@ -424,9 +422,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable:false,
isForm: false,
isTableForm: false
},
@ -466,6 +462,8 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作',
field: 'action',
isForm: false,
hiddenInMain:true,
isTableForm: false,
table: {
width: 200,
fixed: 'right'

6
src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue

@ -273,7 +273,7 @@ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['ma
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:container-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:refused'}), //
@ -446,8 +446,8 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请主.xlsx')
const data = await ContainerMainRequestApi.exportScrapContainerMainRequest(tableObject.params)
download.excel(data, '报废器具管理申请主.xlsx')
} catch {
} finally {
exportLoading.value = false

16
src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/scrapContainerMainRequest.data.ts

@ -96,6 +96,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
isSearch: true,
isTable: false
},
{
label: '部门',
@ -219,9 +220,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable: false,
isForm: false,
},
{
@ -247,9 +246,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
isTable: false,
},
{
label: '操作',
@ -437,6 +434,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isTable: false
},
{
label: '创建时间',
@ -451,9 +449,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isTable: false,
isForm: false,
isTableForm: false
},
@ -493,6 +489,8 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作',
field: 'action',
isForm: false,
hiddenInMain:true,
isTableForm: false,
table: {
width: 150,
fixed: 'right'

244
src/views/wms/productionManage/productionplan/qadproductionplan/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="QadProductionPlanMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="QadProductionPlanMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="QadProductionPlanMainRules"
:formAllSchemas="QadProductionPlanMain.allSchemas"
:apiUpdate="QadProductionPlanMainApi.updateQadProductionPlanMain"
:apiCreate="QadProductionPlanMainApi.createQadProductionPlanMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="QadProductionPlanMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/qad-production-plan-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { QadProductionPlanMain,QadProductionPlanMainRules } from './qadProductionPlanMain.data'
import * as QadProductionPlanMainApi from '@/api/wms/qadproductionplan'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'QadProductionPlanMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(QadProductionPlanMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: QadProductionPlanMainApi.getQadProductionPlanMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:qadProductionPlanMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:qadProductionPlanMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:qadProductionPlanMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:qadProductionPlanMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:qadProductionPlanMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =QadProductionPlanMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await QadProductionPlanMainApi.createQadProductionPlanMain(data)
message.success(t('common.createSuccess'))
} else {
await QadProductionPlanMainApi.updateQadProductionPlanMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicQadProductionPlanMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await QadProductionPlanMainApi.deleteQadProductionPlanMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await QadProductionPlanMainApi.exportQadProductionPlanMain(tableObject.params)
download.excel(data, 'QAD生产计划主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'QAD生产计划主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await QadProductionPlanMainApi.importTemplate()
})
</script>

119
src/views/wms/productionManage/productionplan/qadproductionplan/qadProductionPlanMain.data.ts

@ -0,0 +1,119 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const QadProductionPlanMainRules = reactive({
workshop: [required],
woNumber: [required],
woLine: [required],
})
export const QadProductionPlanMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '顺序',
field: 'displayOrder',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '车间',
field: 'workshop',
sort: 'custom',
isSearch: true,
},
{
label: '生产线',
field: 'productionLine',
sort: 'custom',
isSearch: true,
},
{
label: '班次',
field: 'shift',
sort: 'custom',
isSearch: true,
},
{
label: '班组',
field: 'team',
sort: 'custom',
},
{
label: '计划日期',
field: 'planDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '明细列表',
field: 'details',
sort: 'custom',
},
{
label: '计划类型',
field: 'planType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isForm: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isForm: false,
},
{
label: '订单号',
field: 'woNumber',
sort: 'custom',
},
{
label: '订单行',
field: 'woLine',
sort: 'custom',
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))
Loading…
Cancel
Save