Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20240829
chenfang 3 months ago
parent
commit
3ae6b3f84a
  1. 7
      src/api/wms/purchaseMain/index.ts
  2. 5
      src/views/login/login.vue
  3. 190
      src/views/qms/aql/index.vue
  4. 124
      src/views/qms/counter/index.vue
  5. 203
      src/views/qms/dynamicRule/index.vue
  6. 2
      src/views/qms/inspectionJob/index.vue
  7. 163
      src/views/qms/inspectionMethod/index.vue
  8. 174
      src/views/qms/inspectionQ1/index.vue
  9. 198
      src/views/qms/inspectionQ2/index.vue
  10. 174
      src/views/qms/inspectionQ3/index.vue
  11. 10
      src/views/qms/inspectionRecordFirst/addForm.vue
  12. 4
      src/views/qms/inspectionRecordFirst/detail.vue
  13. 2
      src/views/qms/inspectionRecordFirst/index.vue
  14. 775
      src/views/qms/inspectionRequest/index.vue
  15. 148
      src/views/qms/inspectionScheme/index.vue
  16. 117
      src/views/qms/inspectionStage/index.vue
  17. 132
      src/views/qms/inspectionTemplate/index.vue
  18. 2
      src/views/qms/qualityNotice/index.vue
  19. 155
      src/views/qms/sampleCode/index.vue
  20. 239
      src/views/qms/samplingProcess/index.vue
  21. 134
      src/views/qms/samplingScheme/index.vue
  22. 114
      src/views/qms/selectedProject/index.vue
  23. 211
      src/views/qms/selectedSet/index.vue
  24. 2
      src/views/wms/basicDataManage/documentSetting/businesstype/businesstype.data.ts
  25. 5
      src/views/wms/deliversettlementManage/customerreturn/customerreturnJobMain/customerreturnJobMain.data.ts
  26. 5
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/customerreturnRecordMain.data.ts
  27. 5
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts
  28. 960
      src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts
  29. 556
      src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts
  30. 762
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts
  31. 644
      src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts
  32. 916
      src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts
  33. 6
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue
  34. 71
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/productreceiptscrapRequestMain.data.ts
  35. 7
      src/views/wms/productionManage/productredress/productredressJobMain/productredressJobMain.data.ts
  36. 3
      src/views/wms/productionManage/productredress/productredressRecordMain/productredressRecordMain.data.ts
  37. 944
      src/views/wms/productionManage/productscrap/productscrapJobMain/productscrapJobMain.data.ts
  38. 681
      src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts
  39. 1043
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts
  40. 1157
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnJobMain/purchasereturnJobMain.data.ts
  41. 780
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/purchasereturnRecordMain.data.ts
  42. 1207
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts
  43. 3
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  44. 108
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

7
src/api/wms/purchaseMain/index.ts

@ -72,7 +72,12 @@ export const witPurchaseMain = async (id: number) => {
} }
// 导出采购订单主 Excel // 导出采购订单主 Excel
export const exportPurchaseMain = async (params) => { export const exportPurchaseMain = async (params) => {
return await request.download({ url: `/wms/purchase-main/export-excel`, params }) if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchase-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/purchase-main/export-excel`, params })
}
} }
// 下载用户导入模板 // 下载用户导入模板

5
src/views/login/login.vue

@ -9,7 +9,7 @@
> >
<!-- 左上角的 logo + 系统标题 --> <!-- 左上角的 logo + 系统标题 -->
<div class="relative flex items-center "> <div class="relative flex items-center ">
<img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white_blue.png" /> <img alt="" class="mr-10px w-36px h-36px" src="@/assets/imgs/logo_white.png" />
<span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span> <span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span>
</div> </div>
<!-- 左边的背景图 + 欢迎语 --> <!-- 左边的背景图 + 欢迎语 -->
@ -33,7 +33,7 @@
class="flex items-center justify-between at-2xl:justify-end at-xl:justify-end" class="flex items-center justify-between at-2xl:justify-end at-xl:justify-end"
> >
<div class="flex items-center at-2xl:hidden at-xl:hidden"> <div class="flex items-center at-2xl:hidden at-xl:hidden">
<img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white_blue.png" /> <img alt="" class="mr-10px w-36px h-36px" src="@/assets/imgs/logo_white.png" />
<span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span> <span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span>
</div> </div>
<div class="flex items-center justify-end space-x-10px"> <div class="flex items-center justify-end space-x-10px">
@ -94,6 +94,7 @@ $prefix-cls: #{$namespace}-login;
z-index: -1; z-index: -1;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-size: cover;
// background-image: url('@/assets/svgs/login-bg.svg'); // background-image: url('@/assets/svgs/login-bg.svg');
background-image: url('@/assets/imgs/login-bg.png'); background-image: url('@/assets/imgs/login-bg.png');
background-position: center; background-position: center;

190
src/views/qms/aql/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="Aql.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="Aql.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Aql.allSchemas" :allSchemas="Aql.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -55,12 +63,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Aql.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Aql.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/aql/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/qms/aql/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Aql,AqlRules } from './aql.data' import { Aql, AqlRules } from './aql.data'
import * as AqlApi from '@/api/qms/aql' import * as AqlApi from '@/api/qms/aql'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -100,12 +113,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:aql:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:aql:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:aql:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:aql:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:aql:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:aql:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -118,21 +131,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -142,23 +161,31 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:aql:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:aql:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:aql:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:aql:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:aql:delete'}), // hasPermi: 'qms:aql:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:aql:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:aql:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
}else if (val == 'delete') { // } else if (val == 'delete') {
    handleDelete(row.id) //
  } handleDelete(row.id)
}
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -168,27 +195,33 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =Aql.allSchemas.formSchema.some(function (item) { try {
return item.field === 'activeTime' || item.field === 'expireTime'; var isHave = Aql.allSchemas.formSchema.some(function (item) {
}); return item.field === 'activeTime' || item.field === 'expireTime'
if(isHave){ })
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (isHave) {
message.error('失效时间要大于生效时间') if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
return; message.error('失效时间要大于生效时间')
return
}
} }
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
basicFormRef.value.formLoading = true
if (formType === 'create') {
await AqlApi.createAql(data)
message.success(t('common.createSuccess'))
} else {
await AqlApi.updateAql(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await AqlApi.createAql(data)
message.success(t('common.createSuccess'))
} else {
await AqlApi.updateAql(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -268,51 +301,50 @@ const searchFormClick = (searchData) => {
const onChange = async (field, value, formRef) => { const onChange = async (field, value, formRef) => {
// "a" // "a"
if (field.startsWith("a") || field.startsWith("r")) { if (field.startsWith('a') || field.startsWith('r')) {
// "a" // "a"
const suffix = field.slice(1); const suffix = field.slice(1)
// "r" // "r"
const correspondingField = field.startsWith("a") ? "r" + suffix : "a" + suffix ; const correspondingField = field.startsWith('a') ? 'r' + suffix : 'a' + suffix
// "r" // "r"
if (value) { if (value) {
// "r" // "r"
Aql.allSchemas.formSchema.forEach(item => { Aql.allSchemas.formSchema.forEach((item) => {
if (item.field === correspondingField) { if (item.field === correspondingField) {
const setV = {}; const setV = {}
if(correspondingField.startsWith("r")){ if (correspondingField.startsWith('r')) {
setV[correspondingField] = parseInt(value) + 1; setV[correspondingField] = parseInt(value) + 1
}else { } else {
setV[correspondingField] = parseInt(value) - 1; setV[correspondingField] = parseInt(value) - 1
} }
item.componentProps.disabled = true; item.componentProps.disabled = true
// 使 Vue nextTick DOM // 使 Vue nextTick DOM
nextTick(() => { nextTick(() => {
formRef.value.setValues(setV); formRef.value.setValues(setV)
}); })
} }
}); })
}else{ } else {
Aql.allSchemas.formSchema.forEach(item => { Aql.allSchemas.formSchema.forEach((item) => {
if (item.field === correspondingField || item.field === field) { if (item.field === correspondingField || item.field === field) {
item.componentProps.disabled = false; item.componentProps.disabled = false
const setV = {}; const setV = {}
setV[correspondingField] = '' setV[correspondingField] = ''
nextTick(() => { nextTick(() => {
formRef.value.setValues(setV); formRef.value.setValues(setV)
}); })
} }
}); })
} }
} }
}; }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await AqlApi.importTemplate() importTemplateData.templateUrl = await AqlApi.importTemplate()
}) })
</script> </script>

124
src/views/qms/counter/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="Counter.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="Counter.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Counter.allSchemas" :allSchemas="Counter.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,13 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +59,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Counter.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Counter.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/counter/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/qms/counter/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Counter,CounterRules } from './counter.data' import { Counter, CounterRules } from './counter.data'
import * as CounterApi from '@/api/qms/counter' import * as CounterApi from '@/api/qms/counter'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -100,11 +110,11 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'qms:counter:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'qms:counter:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'qms:counter:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'qms:counter:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:counter:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:counter:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -115,34 +125,41 @@ const HeadButttondata = [
// }, // },
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'qms:counter:update'}), // defaultButtons.mainListEditBtn({ hasPermi: 'qms:counter:update' }) //
// defaultButtons.mainListDeleteBtn({hasPermi:'qms:counter:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'qms:counter:delete'}), //
] ]
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -162,27 +179,33 @@ const openForm = async (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =Counter.allSchemas.formSchema.some(function (item) { try {
return item.field === 'activeTime' || item.field === 'expireTime'; var isHave = Counter.allSchemas.formSchema.some(function (item) {
}); return item.field === 'activeTime' || item.field === 'expireTime'
if(isHave){ })
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (isHave) {
message.error('失效时间要大于生效时间') if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
return; message.error('失效时间要大于生效时间')
return
}
} }
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
basicFormRef.value.formLoading = true
if (formType === 'create') {
await CounterApi.createCounter(data)
message.success(t('common.createSuccess'))
} else {
await CounterApi.updateCounter(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await CounterApi.createCounter(data)
message.success(t('common.createSuccess'))
} else {
await CounterApi.updateCounter(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -246,11 +269,10 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await CounterApi.importTemplate() importTemplateData.templateUrl = await CounterApi.importTemplate()
}) })
</script> </script>

203
src/views/qms/dynamicRule/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="DynamicRule.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="DynamicRule.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="DynamicRule.allSchemas" :allSchemas="DynamicRule.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -92,15 +100,15 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { DynamicRule,DynamicRuleRules } from './dynamicRule.data' import { DynamicRule, DynamicRuleRules } from './dynamicRule.data'
import { InspectionStage,InspectionStageRules } from '../inspectionStage/inspectionStage.data' import { InspectionStage, InspectionStageRules } from '../inspectionStage/inspectionStage.data'
import * as DynamicRuleApi from '@/api/qms/dynamicRule' import * as DynamicRuleApi from '@/api/qms/dynamicRule'
import * as InspectionStageApi from '@/api/qms/inspectionStage' import * as InspectionStageApi from '@/api/qms/inspectionStage'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import UploadFile from '@/components/UploadFile/src/UploadFile.vue' import UploadFile from '@/components/UploadFile/src/UploadFile.vue'
import { checkPermi } from '@/utils/permission' import { checkPermi } from '@/utils/permission'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue"; import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue' // import Detail from '@/components/Detail/src/Detail.vue'
@ -141,12 +149,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:dynamic-rule:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:dynamic-rule:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:dynamic-rule:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:dynamic-rule:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:dynamic-rule:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:dynamic-rule:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -159,21 +167,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -183,22 +197,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:dynamic-rule:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:dynamic-rule:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:dynamic-rule:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:dynamic-rule:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:dynamic-rule:delete'}), // hasPermi: 'qms:dynamic-rule:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:dynamic-rule:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:dynamic-rule:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
editForm('update', row) editForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
} }
} }
@ -212,33 +234,39 @@ const openForm = async (type: string, row?: any) => {
const editForm = async (type: string, row?: any) => { const editForm = async (type: string, row?: any) => {
tableData.value = [] tableData.value = []
detailMasterId.value = row.id detailMasterId.value = row.id
InspectionStageApi.getInspectionStageNoPage({masterId:row.id}).then(res=>{ InspectionStageApi.getInspectionStageNoPage({ masterId: row.id }).then((res) => {
tableData.value = res tableData.value = res
}) })
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =DynamicRule.allSchemas.formSchema.some(function (item) { try {
return item.field === 'activeTime' || item.field === 'expireTime'; var isHave = DynamicRule.allSchemas.formSchema.some(function (item) {
}); return item.field === 'activeTime' || item.field === 'expireTime'
if(isHave){ })
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (isHave) {
message.error('失效时间要大于生效时间') if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
return; message.error('失效时间要大于生效时间')
return
}
} }
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
basicFormRef.value.formLoading = true
if (formType === 'create') {
await DynamicRuleApi.createDynamicRule(data)
message.success(t('common.createSuccess'))
} else {
await DynamicRuleApi.updateDynamicRule(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} catch {
basicFormRef.value.formLoading = false
} }
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await DynamicRuleApi.createDynamicRule(data)
message.success(t('common.createSuccess'))
} else {
await DynamicRuleApi.updateDynamicRule(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -331,23 +359,23 @@ const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
const flag = validateNotRepetition(tableData.value); const flag = validateNotRepetition(tableData.value)
const emptyFlag = validateDetailEmpty(tableData.value); const emptyFlag = validateDetailEmpty(tableData.value)
if(!emptyFlag){ if (!emptyFlag) {
message.alertWarning('明细不能为空') message.alertWarning('明细不能为空')
basicFormRef.value.formLoading = false basicFormRef.value.formLoading = false
return return
} }
if(!flag){ if (!flag) {
message.alertWarning('动态规则阶段不能重复') message.alertWarning('动态规则阶段不能重复')
basicFormRef.value.formLoading = false basicFormRef.value.formLoading = false
return return
} }
data.inspectionStageDOList = tableData.value// data.inspectionStageDOList = tableData.value //
try { try {
basicFormRef.value.formLoading = true
if (formType === 'create') { if (formType === 'create') {
await DynamicRuleApi.createDynamicRule(data) await DynamicRuleApi.createDynamicRule(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -356,6 +384,7 @@ const submitForm = async (formType, data) => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
// //
getList() getList()
} finally { } finally {
@ -363,9 +392,9 @@ const submitForm = async (formType, data) => {
} }
} }
const detailValidate = (type,data) => { const detailValidate = (type, data) => {
let tag = true; let tag = true
if(!validateIfRepeat(type,data)){ if (!validateIfRepeat(type, data)) {
tag = false tag = false
message.alertWarning('动态规则阶段不能重复') message.alertWarning('动态规则阶段不能重复')
} }
@ -374,49 +403,49 @@ const detailValidate = (type,data) => {
const detailOpenForm = (type, row, masterParmas) => { const detailOpenForm = (type, row, masterParmas) => {
detailMasterId.value = masterParmas.masterId detailMasterId.value = masterParmas.masterId
InspectionStageApi.getInspectionStageNoPage({masterId:masterParmas.masterId}).then(res=>{ InspectionStageApi.getInspectionStageNoPage({ masterId: masterParmas.masterId }).then((res) => {
detailList.value = res detailList.value = res
}) })
} }
const validateIfRepeat = (type,data) => { const validateIfRepeat = (type, data) => {
let mergedArray: any[] = []; let mergedArray: any[] = []
if(type == 'create'){ if (type == 'create') {
mergedArray = [data, ...detailList.value]; mergedArray = [data, ...detailList.value]
}if(type == 'update'){ }
detailList.value = detailList.value.filter(item => item.id !== data.id); if (type == 'update') {
mergedArray = [data, ...detailList.value]; detailList.value = detailList.value.filter((item) => item.id !== data.id)
mergedArray = [data, ...detailList.value]
} }
const stageSet = new Set(mergedArray.map(item => item.stage)); const stageSet = new Set(mergedArray.map((item) => item.stage))
return stageSet.size === mergedArray.length; return stageSet.size === mergedArray.length
} }
const validateDetailEmpty = (data) => { const validateDetailEmpty = (data) => {
const codes = data.map(item => item.stage); const codes = data.map((item) => item.stage)
if(codes.length == 0){ if (codes.length == 0) {
return false; return false
} }
return true; return true
} }
const validateNotRepetition = (data) => { const validateNotRepetition = (data) => {
// dictionaryTypeAndCode // dictionaryTypeAndCode
const codes = data.map(item => item.stage); const codes = data.map((item) => item.stage)
// Set dictionaryTypeAndCode // Set dictionaryTypeAndCode
const uniqueCodes = new Set(codes); const uniqueCodes = new Set(codes)
// Set // Set
if (codes.length > uniqueCodes.size) { if (codes.length > uniqueCodes.size) {
return false; // false return false // false
} }
return true; // true return true // true
}; }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await DynamicRuleApi.importTemplate() importTemplateData.templateUrl = await DynamicRuleApi.importTemplate()
}) })
</script> </script>

2
src/views/qms/inspectionJob/index.vue

@ -389,6 +389,7 @@ const tableData = ref([])
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
// return // return
try { try {
formRef.value.formLoading = true
if (formType === 'create') { if (formType === 'create') {
await InspectionJobMainApi.createInspectionJobMain(data) await InspectionJobMainApi.createInspectionJobMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -397,6 +398,7 @@ const submitForm = async (formType, data) => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false formRef.value.dialogVisible = false
formRef.value.formLoading = false
// //
getList() getList()
} finally { } finally {

163
src/views/qms/inspectionMethod/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionMethod.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="InspectionMethod.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="InspectionMethod.allSchemas" :allSchemas="InspectionMethod.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -42,12 +50,14 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:sumFormDataByForm ="(formRef,formModel)=>{ :sumFormDataByForm="
const {videoAddress} = formModel (formRef, formModel) => {
formRef.value.setValues({ const { videoAddress } = formModel
installPackageUrl:videoAddress formRef.value.setValues({
}) installPackageUrl: videoAddress
}" })
}
"
:rules="InspectionMethodRules" :rules="InspectionMethodRules"
:formAllSchemas="InspectionMethod.allSchemas" :formAllSchemas="InspectionMethod.allSchemas"
:apiUpdate="InspectionMethodApi.updateInspectionMethod" :apiUpdate="InspectionMethodApi.updateInspectionMethod"
@ -73,7 +83,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionMethod,InspectionMethodRules } from './inspectionMethod.data' import { InspectionMethod, InspectionMethodRules } from './inspectionMethod.data'
import * as InspectionMethodApi from '@/api/qms/inspectionMethod' import * as InspectionMethodApi from '@/api/qms/inspectionMethod'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -113,12 +123,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:inspection-method:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:inspection-method:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:inspection-method:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:inspection-method:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:inspection-method:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-method:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -131,21 +141,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -155,22 +171,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:inspection-method:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:inspection-method:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:inspection-method:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:inspection-method:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:inspection-method:delete'}), // hasPermi: 'qms:inspection-method:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:inspection-method:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:inspection-method:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
} }
} }
@ -178,7 +202,7 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
if(row && row.videoAddress?.trim()){ if (row && row.videoAddress?.trim()) {
row.filePathList = row.videoAddress.split(',') row.filePathList = row.videoAddress.split(',')
} }
@ -190,39 +214,47 @@ const openForm = (type: string, row?: any) => {
} }
}) })
} }
if(type=='create'){ if (type == 'create') {
const currentTime = new Date().getTime() const currentTime = new Date().getTime()
const fileId = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='fileId') const fileId = InspectionMethod.allSchemas.formSchema.find((item) => item.field == 'fileId')
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress') const uploadFile = InspectionMethod.allSchemas.formSchema.find(
if(fileId){ (item) => item.field == 'videoAddress'
)
if (fileId) {
fileId['value'] = currentTime fileId['value'] = currentTime
} }
if(uploadFile){ if (uploadFile) {
uploadFile['componentProps']['upData']['tableId'] = currentTime uploadFile['componentProps']['upData']['tableId'] = currentTime
uploadFile['componentProps']['modelValue']= [] uploadFile['componentProps']['modelValue'] = []
} }
}else if(type=='update'){ } else if (type == 'update') {
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress') const uploadFile = InspectionMethod.allSchemas.formSchema.find(
uploadFile['componentProps']['modelValue']= row.filePathListView (item) => item.field == 'videoAddress'
)
uploadFile['componentProps']['modelValue'] = row.filePathListView
} }
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
if (formType === 'create') { try {
basicFormRef.value.formLoading = true
delete data['uploadFile'] if (formType === 'create') {
await InspectionMethodApi.createInspectionMethod(data) delete data['uploadFile']
message.success(t('common.createSuccess')) await InspectionMethodApi.createInspectionMethod(data)
} else { message.success(t('common.createSuccess'))
// debugger } else {
await InspectionMethodApi.updateInspectionMethod(data) // debugger
message.success(t('common.updateSuccess')) await InspectionMethodApi.updateInspectionMethod(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -302,11 +334,10 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await InspectionMethodApi.importTemplate() importTemplateData.templateUrl = await InspectionMethodApi.importTemplate()
}) })
</script> </script>

174
src/views/qms/inspectionQ1/index.vue

@ -1,18 +1,22 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="Q1.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="Q1.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Q1.allSchemas" :allSchemas="Q1.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #number="{row}"> <template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> <el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +61,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q1.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Q1.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/Q1/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/basic/Q1/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Q1,Q1Rules } from './inspectionQ1.data' import { Q1, Q1Rules } from './inspectionQ1.data'
import * as Q1Api from '@/api/qms/inspectionQ1' import * as Q1Api from '@/api/qms/inspectionQ1'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -81,19 +93,17 @@ const tableColumns = ref(Q1.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
if(formField == 'customerCode'){ if (formField == 'customerCode') {
setV['itemCode'] = ''; setV['itemCode'] = ''
} }
if(formField == 'itemCode'){ if (formField == 'itemCode') {
setV['uom'] = val[0]['customerUom'] setV['uom'] = val[0]['customerUom']
} }
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
// //
@ -110,12 +120,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:Q1:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q1:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q1:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q1:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q1:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q1:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -128,21 +138,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
@ -153,19 +169,31 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:update'}), // defaultButtons.mainListEditBtn({
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:delete'}), // hide: isShowMainButton(row, ['0']),
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:finish'}), // hasPermi: 'qms:Q1:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q1:delete'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q1:finish'
}) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'finish') { // } else if (val == 'finish') {
//
handleFinish(row.id) handleFinish(row.id)
} }
} }
@ -183,49 +211,54 @@ const handleFinish = async (id: number) => {
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
if (type=='create') { if (type == 'create') {
nextTick(() => { nextTick(() => {
    basicFormRef.value.formRef.setValues({ basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(), handleTime: new Date().getTime(),
claimTime: new Date().getTime(), claimTime: new Date().getTime(),
priority: '3', priority: '3'
    }) })
  }) })
} }
 
} }
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id data.responUser = userStore.getUser.id
var isHave =Q1.allSchemas.formSchema.some(function (item) { var isHave = Q1.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if (data.qty==0) { if (data.qty == 0) {
message.error('数量不能为0') message.error('数量不能为0')
return; return
} }
if (data.claimAmount==0) { if (data.claimAmount == 0) {
message.error('索赔金额不能为0') message.error('索赔金额不能为0')
return; return
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { try {
await Q1Api.createQ1(data) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await Q1Api.createQ1(data)
await Q1Api.updateQ1(data) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await Q1Api.updateQ1(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -292,5 +325,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await Q1Api.importTemplate() importTemplateData.templateUrl = await Q1Api.importTemplate()
}) })
</script> </script>

198
src/views/qms/inspectionQ2/index.vue

@ -1,18 +1,22 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="Q2.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="Q2.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Q2.allSchemas" :allSchemas="Q2.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #number="{row}"> <template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> <el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +61,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q2.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Q2.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/Q2/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/basic/Q2/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Q2,Q2Rules } from './inspectionQ2.data' import { Q2, Q2Rules } from './inspectionQ2.data'
import * as Q2Api from '@/api/qms/inspectionQ2' import * as Q2Api from '@/api/qms/inspectionQ2'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -81,34 +93,34 @@ const tableColumns = ref(Q2.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
if(formField == 'supplierCode'){ if (formField == 'supplierCode') {
setV['itemCode'] = ''; setV['itemCode'] = ''
} }
if(formField == 'itemCode'){ if (formField == 'itemCode') {
setV['uom'] = val[0]['supplierUom'] setV['uom'] = val[0]['supplierUom']
} }
// if (formField == 'q1Number') { // if (formField == 'q1Number') {
// console.log(123) // console.log(123)
// setV['q1Number'] = val[0]['number'] // setV['q1Number'] = val[0]['number']
// } // }
if (formField == 'purchaseReceiptNumber') { if (formField == 'purchaseReceiptNumber') {
setV['wmsQty'] = val[0]['qty'] setV['wmsQty'] = val[0]['qty']
} }
if(formField == 'q1Number'){ if (formField == 'q1Number') {
//Q1 //Q1
let list = [] let list = []
val.forEach(item=>{ val.forEach((item) => {
list.push(item[searchField]) list.push(item[searchField])
}) })
setV[formField] = list.join(',') setV[formField] = list.join(',')
formRef.setValues(setV) formRef.setValues(setV)
}else{ } else {
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
} }
// //
@ -125,12 +137,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:Q2:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q2:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q2:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q2:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q2:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q2:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -143,21 +155,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
@ -168,19 +186,31 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:update'}), // defaultButtons.mainListEditBtn({
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:delete'}), // hide: isShowMainButton(row, ['0']),
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:finish'}), // hasPermi: 'qms:Q2:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q2:delete'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q2:finish'
}) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'finish') { // } else if (val == 'finish') {
//
handleFinish(row.id) handleFinish(row.id)
} }
} }
@ -198,52 +228,59 @@ const handleFinish = async (id: number) => {
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
if (type=='create') { if (type == 'create') {
nextTick(() => { nextTick(() => {
    basicFormRef.value.formRef.setValues({ basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(), handleTime: new Date().getTime(),
claimTime: new Date().getTime(), claimTime: new Date().getTime(),
priority: '3', priority: '3'
    }) })
  }) })
} }
} }
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id data.responUser = userStore.getUser.id
var isHave =Q2.allSchemas.formSchema.some(function (item) { var isHave = Q2.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if (data.qty>data.wmsQty) { if (data.qty > data.wmsQty) {
message.error('数量不能大于记录中的收货数量') message.error('数量不能大于记录中的收货数量')
return; return
} }
if (data.qty==0) { if (data.qty == 0) {
message.error('数量不能为0') message.error('数量不能为0')
return; return
} }
if (data.claimAmount==0) { if (data.claimAmount == 0) {
message.error('索赔金额不能为0') message.error('索赔金额不能为0')
return; return
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await Q2Api.createQ2(data) try {
message.success(t('common.createSuccess')) basicFormRef.value.formLoading = true
} else { if (formType === 'create') {
await Q2Api.updateQ2(data) await Q2Api.createQ2(data)
message.success(t('common.updateSuccess')) message.success(t('common.createSuccess'))
} else {
await Q2Api.updateQ2(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -310,5 +347,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await Q2Api.importTemplate() importTemplateData.templateUrl = await Q2Api.importTemplate()
}) })
</script> </script>

174
src/views/qms/inspectionQ3/index.vue

@ -1,18 +1,22 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="Q3.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="Q3.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Q3.allSchemas" :allSchemas="Q3.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #number="{row}"> <template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> <el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +61,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q3.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Q3.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/Q3/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/basic/Q3/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Q3,Q3Rules } from './inspectionQ3.data' import { Q3, Q3Rules } from './inspectionQ3.data'
import * as Q3Api from '@/api/qms/inspectionQ3' import * as Q3Api from '@/api/qms/inspectionQ3'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -81,25 +93,25 @@ const tableColumns = ref(Q3.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
if(formField == 'itemCode'){ if (formField == 'itemCode') {
console.log(val); console.log(val)
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
} }
if(formField == 'q1Number'){ if (formField == 'q1Number') {
//Q1 //Q1
let list = [] let list = []
val.forEach(item=>{ val.forEach((item) => {
list.push(item[searchField]) list.push(item[searchField])
}) })
setV[formField] = list.join(',') setV[formField] = list.join(',')
formRef.setValues(setV) formRef.setValues(setV)
}else{ } else {
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
} }
// //
@ -116,12 +128,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:Q3:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q3:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q3:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q3:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q3:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q3:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -134,21 +146,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
@ -159,19 +177,31 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:update'}), // defaultButtons.mainListEditBtn({
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:delete'}), // hide: isShowMainButton(row, ['0']),
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:finish'}), // hasPermi: 'qms:Q3:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:delete'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:finish'
}) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'finish') { // } else if (val == 'finish') {
//
handleFinish(row.id) handleFinish(row.id)
} }
} }
@ -189,47 +219,54 @@ const handleFinish = async (id: number) => {
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
if (type=='create') { if (type == 'create') {
nextTick(() => { nextTick(() => {
    basicFormRef.value.formRef.setValues({ basicFormRef.value.formRef.setValues({
handleTime: new Date().getTime(), handleTime: new Date().getTime(),
priority: '3', priority: '3'
    }) })
  }) })
} }
} }
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id data.responUser = userStore.getUser.id
var isHave =Q3.allSchemas.formSchema.some(function (item) { var isHave = Q3.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if (data.qty==0) { if (data.qty == 0) {
message.error('数量不能为0') message.error('数量不能为0')
return; return
} }
if (data.amount==0) { if (data.amount == 0) {
message.error('金额不能为0') message.error('金额不能为0')
return; return
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await Q3Api.createQ3(data) try {
message.success(t('common.createSuccess')) basicFormRef.value.formLoading = true
} else { if (formType === 'create') {
await Q3Api.updateQ3(data) await Q3Api.createQ3(data)
message.success(t('common.updateSuccess')) message.success(t('common.createSuccess'))
} else {
await Q3Api.updateQ3(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -296,5 +333,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await Q3Api.importTemplate() importTemplateData.templateUrl = await Q3Api.importTemplate()
}) })
</script> </script>

10
src/views/qms/inspectionRecordFirst/addForm.vue

@ -1081,6 +1081,11 @@ const opensearchItemsTable = () => {
column: 'type', column: 'type',
action: 'in', action: 'in',
value: 'BCP,CCP' value: 'BCP,CCP'
},
{
column: 'status',
action: 'in',
value: 'ENABLE'
} }
) )
// //
@ -1523,6 +1528,11 @@ const onItemBlur = async (field, pageApi) => {
column: 'code', column: 'code',
action: '==', action: '==',
value: data.value[field]?.trim() value: data.value[field]?.trim()
},
{
column: 'status',
action: 'in',
value: 'ENABLE'
} }
) )
// //

4
src/views/qms/inspectionRecordFirst/detail.vue

@ -290,13 +290,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" > <!-- <el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" >
<el-form-item label="缺陷级别"> <el-form-item label="缺陷级别">
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> <el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="cur.remark" placeholder="" type="number" disabled/> <el-input v-model="cur.remark" placeholder="" type="number" disabled/>

2
src/views/qms/inspectionRecordFirst/index.vue

@ -244,6 +244,7 @@ const handleMainExport = async (row: any) => {
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
// data.subList = tableData.value // // data.subList = tableData.value //
try { try {
basicFormRef.value.formLoading = true
if (formType === 'create') { if (formType === 'create') {
await InspectionRecordMainApi.createInspectionRecordMain(data) await InspectionRecordMainApi.createInspectionRecordMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -252,6 +253,7 @@ const handleMainExport = async (row: any) => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
// //
getList() getList()
} finally { } finally {

775
src/views/qms/inspectionRequest/index.vue

@ -1,375 +1,456 @@
<template> <template>
<div> <div>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
</ContentWrap> :schema="InspectionMain.allSchemas.searchSchema"
@search="setSearchParams"
<!-- 列表头部 --> @reset="setSearchParams"
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" />
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" </ContentWrap>
:allSchemas="InspectionMain.allSchemas" />
<!-- 列表头部 -->
<!-- 列表 --> <TableHead
<ContentWrap> :HeadButttondata="HeadButttondata"
<Table v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ @button-base-click="buttonBaseClick"
total: tableObject.total :routeName="routeName"
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" @updataTableColumns="updataTableColumns"
v-model:sort="tableObject.sort"> @searchFormClick="searchFormClick"
<template #number="{row}"> :allSchemas="InspectionMain.allSchemas"
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> />
<span>{{ row.number }}</span>
</el-button> <!-- 列表 -->
</template> <ContentWrap>
<template #action="{ row }"> <Table
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> v-clientTable
</template> :columns="tableColumns"
</Table> :data="tableObject.tableList"
</ContentWrap> :loading="tableObject.loading"
:pagination="{
<!-- 表单弹窗添加/修改 --> total: tableObject.total
<BasicForm }"
ref="formRef" v-model:pageSize="tableObject.pageSize"
@submitForm="submitForm" v-model:currentPage="tableObject.currentPage"
basicFormWidth="60" v-model:sort="tableObject.sort"
:rules="InspectionMainRules" >
:formAllSchemas="InspectionMain.allSchemas" <template #number="{ row }">
:tableAllSchemas="InspectionRequestPackage.allSchemas" <el-button type="primary" link @click="openDetail(row, '代码', row.number)">
:tableFormRules="InspectionRequestPackageRules" <span>{{ row.number }}</span>
:apiUpdate="InspectionMainApi.updateInspectionMain" </el-button>
:apiCreate="InspectionMainApi.createInspectionMain" </template>
:isBusiness="true" <template #action="{ row }">
:tableData="tableData" <ButtonBase
@handleAddTable="handleAddTable" :Butttondata="butttondata(row)"
@handleDeleteTable="handleDeleteTable" @button-base-click="buttonTableClick($event, row)"
@searchTableSuccess="searchTableSuccess" />
/> </template>
</Table>
<!-- 详情 --> </ContentWrap>
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" />
<!-- 表单弹窗添加/修改 -->
<BasicForm
<!-- 导入 --> ref="formRef"
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData" @submitForm="submitForm"
@success="importSuccess" /> basicFormWidth="60"
<!-- 包装信息 --> :rules="InspectionMainRules"
<ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionMain.allSchemas" :formAllSchemas="InspectionMain.allSchemas"
:detailAllSchemas="InspectionRequestPackage.allSchemas" :detailAllSchemasRules="InspectionRequestPackageRules" :tableAllSchemas="InspectionRequestPackage.allSchemas"
:list="list" @ListTableSubmit='ListTableSubmit'/> :tableFormRules="InspectionRequestPackageRules"
:apiUpdate="InspectionMainApi.updateInspectionMain"
:apiCreate="InspectionMainApi.createInspectionMain"
:isBusiness="true"
:tableData="tableData"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" />
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/request/inspection-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<!-- 包装信息 -->
<ListTable
ref="listTableRef"
titleName="包装信息"
:allSchemas="InspectionMain.allSchemas"
:detailAllSchemas="InspectionRequestPackage.allSchemas"
:detailAllSchemasRules="InspectionRequestPackageRules"
:list="list"
@ListTableSubmit="ListTableSubmit"
/>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionMain, InspectionMainRules,InspectionRequestPackage,InspectionRequestPackageRules } from './inspectionRequestMain.data' import {
import * as InspectionMainApi from '@/api/qms/inspectionRequest' InspectionMain,
import * as InspectionRequestPackageApi from '@/api/qms/inspectionRequest/InspectionRequestPackage' InspectionMainRules,
import * as defaultButtons from '@/utils/disposition/defaultButtons' InspectionRequestPackage,
import ListTable from '@/components/ListTable/src/ListTable.vue' InspectionRequestPackageRules
import TableHead from '@/components/TableHead/src/TableHead.vue' } from './inspectionRequestMain.data'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import * as InspectionMainApi from '@/api/qms/inspectionRequest'
// import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data' import * as InspectionRequestPackageApi from '@/api/qms/inspectionRequest/InspectionRequestPackage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'InspectionMain' }) import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
const message = useMessage() // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
const { t } = useI18n() // // import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data'
const route = useRoute() // defineOptions({ name: 'InspectionMain' })
const routeName = ref()
routeName.value = route.name const message = useMessage() //
const tableColumns = ref(InspectionMain.allSchemas.tableColumns) const { t } = useI18n() //
// const route = useRoute() //
const searchTableSuccess = (formField, searchField, val, formRef) => { const routeName = ref()
console.log(formField) routeName.value = route.name
console.log(searchField) const tableColumns = ref(InspectionMain.allSchemas.tableColumns)
console.log(val)
nextTick(() => { //
const setV = {} const searchTableSuccess = (formField, searchField, val, formRef) => {
setV[formField] = val[0][searchField] console.log(formField)
if(formField == 'itemCode'){ console.log(searchField)
setV['itemName'] = val[0].name console.log(val)
}else if(formField == 'supplierCode'){ nextTick(() => {
setV['supplierName'] = val[0].name const setV = {}
} setV[formField] = val[0][searchField]
if (formField == 'itemCode') {
formRef.setValues(setV) setV['itemName'] = val[0].name
}) } else if (formField == 'supplierCode') {
} setV['supplierName'] = val[0].name
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({ formRef.setValues(setV)
getListApi: InspectionMainApi.getInspectionMainPage //
}) })
}
// //
const { getList, setSearchParams } = tableMethods const updataTableColumns = (val) => {
tableColumns.value = val
}
// const { tableObject, tableMethods } = useTable({
const HeadButttondata = [ getListApi: InspectionMainApi.getInspectionMainPage //
defaultButtons.defaultAddBtn({hasPermi: 'qms:inspection-request-main:create' }), // })
// defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionMain:import' }), //
// defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
// //
const buttonBaseClick = (val, item) => { const { getList, setSearchParams } = tableMethods
if (val == 'add') { //
openForm('create') //
} else if (val == 'import') { // const HeadButttondata = [
handleImport() defaultButtons.defaultAddBtn({ hasPermi: 'qms:inspection-request-main:create' }), //
} else if (val == 'export') { // // defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionMain:import' }), //
handleExport() // defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), //
} else if (val == 'refresh') { // defaultButtons.defaultFreshBtn(null), //
tableObject.params.isSearch = false defaultButtons.defaultFilterBtn(null), //
tableObject.params.filters = '' defaultButtons.defaultSetBtn(null) //
getList() // {
} else if (val == 'filtrate') { // // label: '',
} else { // // name: 'zdy',
console.log('其他按钮', item) // 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') {
//
tableObject.params.isSearch = false
tableObject.params.filters = ''
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
} }
}
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
return true return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), hasPermi: 'qms:inspection-request-main:close' }), //
// defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['5']), hasPermi: 'qms:inspection-request-main:reAdd' }), //
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-request-main:submit' }), //
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:refused' }), //
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:agree' }), //
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']), hasPermi: 'qms:inspection-request-main:handle' }), //
defaultButtons.mainListPackageBtn(null), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-request-main:edit'}), //
]
} }
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']),
hasPermi: 'qms:inspection-request-main:close'
}), //
// defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['5']), hasPermi: 'qms:inspection-request-main:reAdd' }), //
defaultButtons.mainListSubmitBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-request-main:submit'
}), //
defaultButtons.mainListTurnDownBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-request-main:refused'
}), //
defaultButtons.mainListApproveBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'qms:inspection-request-main:agree'
}), //
defaultButtons.mainListHandleBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: 'qms:inspection-request-main:handle'
}), //
defaultButtons.mainListPackageBtn(null), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-request-main:edit'
}) //
]
}
const listTableRef = ref() const listTableRef = ref()
const list = ref([]) const list = ref([])
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainClose') {
handleClose(row.id) //
} else if (val == 'mainReAdd') { // handleClose(row.id)
handleReAdd(row.id) } else if (val == 'mainReAdd') {
} else if (val == 'mainSubmit') { // //
handleSubmit(row.id) handleReAdd(row.id)
} else if (val == 'mainTurnDown') { // } else if (val == 'mainSubmit') {
handleRefused(row.id) //
} else if (val == 'mainApprove') { // handleSubmit(row.id)
handleAgree(row.id) } else if (val == 'mainTurnDown') {
} else if (val == 'mainHandle') { // //
handleHandle(row.id) handleRefused(row.id)
} else if (val == 'edit') { // } else if (val == 'mainApprove') {
openForm('update', row) //
}else if (val == 'mainPackage') { // handleAgree(row.id)
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(row.id) } else if (val == 'mainHandle') {
// row.status = '1' //
listTableRef.value.openPackage(row,'包装信息',InspectionRequestPackage.allSchemas.tableColumns) handleHandle(row.id)
} } else if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'mainPackage') {
//
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(row.id)
// row.status = '1'
listTableRef.value.openPackage(
row,
'包装信息',
InspectionRequestPackage.allSchemas.tableColumns
)
} }
}
/** 关闭按钮操作 */ /** 关闭按钮操作 */
const handleClose = async (id : number) => { const handleClose = async (id: number) => {
try{ try {
await message.confirm(t('common.confirmColse')) await message.confirm(t('common.confirmColse'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.closeInspectRequestMain(id) await InspectionMainApi.closeInspectRequestMain(id)
message.success(t('common.closeSuccess')) message.success(t('common.closeSuccess'))
await getList() await getList()
}catch{}finally{ } catch {
tableObject.loading = false } finally {
} tableObject.loading = false
} }
}
/** 重新添加按钮操作 */ /** 重新添加按钮操作 */
const handleReAdd = async (id : number) => { const handleReAdd = async (id: number) => {
try{ try {
await message.confirm(t('common.confirmReAdd')) await message.confirm(t('common.confirmReAdd'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.reAddInspectRequestMain(id) await InspectionMainApi.reAddInspectRequestMain(id)
message.success(t('common.reAddSuccess')) message.success(t('common.reAddSuccess'))
await getList() await getList()
}catch{}finally{ } catch {
tableObject.loading = false } finally {
} tableObject.loading = false
} }
}
/** 审批通过按钮操作 */ /** 审批通过按钮操作 */
const handleAgree = async (id : number) => { const handleAgree = async (id: number) => {
try{ try {
await message.confirm(t('common.confirmAgree')) await message.confirm(t('common.confirmAgree'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.agreeInspectRequestMain(id) await InspectionMainApi.agreeInspectRequestMain(id)
message.success(t('common.agreeSuccess')) message.success(t('common.agreeSuccess'))
await getList() await getList()
}catch{}finally{ } catch {
tableObject.loading = false } finally {
} tableObject.loading = false
} }
}
/** 审批驳回按钮操作 */ /** 审批驳回按钮操作 */
const handleRefused = async (id : number) => { const handleRefused = async (id: number) => {
try{ try {
await message.confirm(t('common.confirmRefused')) await message.confirm(t('common.confirmRefused'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.refusedInspectRequestMain(id) await InspectionMainApi.refusedInspectRequestMain(id)
message.success(t('common.refusedSuccess')) message.success(t('common.refusedSuccess'))
await getList() await getList()
}catch{}finally{ } catch {
tableObject.loading = false } finally {
} tableObject.loading = false
} }
}
/** 处理按钮操作 */ /** 处理按钮操作 */
const handleHandle = async (id : number) => { const handleHandle = async (id: number) => {
try{ try {
await message.confirm(t('common.confirmHandle')) await message.confirm(t('common.confirmHandle'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.handleInspectRequestMain(id) await InspectionMainApi.handleInspectRequestMain(id)
message.success(t('common.dealwithSuccess')) message.success(t('common.dealwithSuccess'))
await getList() await getList()
}catch{}finally{ } catch {
tableObject.loading = false } finally {
} tableObject.loading = false
} }
}
/** 提交按钮操作 */ /** 提交按钮操作 */
const handleSubmit = async (id : number) => { const handleSubmit = async (id: number) => {
try{ try {
await message.confirm(t('common.confirmSubmit')) await message.confirm(t('common.confirmSubmit'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.submitInspectRequestMain(id) await InspectionMainApi.submitInspectRequestMain(id)
message.success(t('common.submitSuccess')) message.success(t('common.submitSuccess'))
await getList() await getList()
}catch{}finally{ } catch {
tableObject.loading = false } finally {
} tableObject.loading = false
} }
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type : string, row ?: number) => { const openForm = async (type: string, row?: number) => {
tableData.value = [] // tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
} }
// form // form
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
var isHave = InspectionMain.allSchemas.formSchema.some(function (item) { var isHave = InspectionMain.allSchemas.formSchema.some(function (item) {
return item.field === 'requestStartTime' || item.field === 'requestEndTime'; return item.field === 'requestStartTime' || item.field === 'requestEndTime'
}); })
if (isHave){ if (isHave) {
if (data.requestStartTime && data.requestEndTime && data.requestStartTime >= data.requestEndTime) { if (
message.error('要求结束时间要大于要求开始时间') data.requestStartTime &&
return; data.requestEndTime &&
} data.requestStartTime >= data.requestEndTime
) {
message.error('要求结束时间要大于要求开始时间')
return
} }
if (data.requestStartTime == 0) data.requestStartTime = null; }
if (data.requestEndTime == 0) data.requestEndTime = null; if (data.requestStartTime == 0) data.requestStartTime = null
data.inspectionRequestPackageCreateReqVO = tableData.value // if (data.requestEndTime == 0) data.requestEndTime = null
try{ data.inspectionRequestPackageCreateReqVO = tableData.value //
if (formType === 'create') { try {
formRef.value.formLoading = true
if (formType === 'create') {
await InspectionMainApi.createInspectionMain(data) await InspectionMainApi.createInspectionMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await InspectionMainApi.updateInspectionMain(data) await InspectionMainApi.updateInspectionMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
getList()
}finally{
formRef.value.formLoading = false
} }
formRef.value.dialogVisible = false
formRef.value.formLoading = false
getList()
} finally {
formRef.value.formLoading = false
} }
}
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id : number) => { const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
// //
await InspectionMainApi.deleteInspectionMain(id) await InspectionMainApi.deleteInspectionMain(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch { } } catch {}
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) // const exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await InspectionMainApi.exportInspectionMain(tableObject.params) const data = await InspectionMainApi.exportInspectionMain(tableObject.params)
download.excel(data, '检验申请.xlsx') download.excel(data, '检验申请.xlsx')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
}
} }
}
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()
const handleImport = () => { const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '检验申请导入模版.xlsx' templateTitle: '检验申请导入模版.xlsx'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
getList() getList()
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
}
getList() //
} }
getList() //
}
/** /**
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
InspectionRequestPackage.allSchemas.tableFormColumns.forEach(item => { InspectionRequestPackage.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([])
@ -382,26 +463,26 @@ const handleAddTable = () => {
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
const ListTableSubmit =async (formType,data)=>{ const ListTableSubmit = async (formType, data) => {
console.log(formType,data) console.log(formType, data)
if (formType === 'create') { if (formType === 'create') {
await InspectionRequestPackageApi.createInspectionRequestPackage(data) await InspectionRequestPackageApi.createInspectionRequestPackage(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else if(formType === 'updete') { } else if (formType === 'updete') {
await InspectionRequestPackageApi.updateInspectionRequestPackage(data) await InspectionRequestPackageApi.updateInspectionRequestPackage(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
}else { } else {
await InspectionRequestPackageApi.deleteInspectionRequestPackage(data.id) await InspectionRequestPackageApi.deleteInspectionRequestPackage(data.id)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(data.masterId) list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(data.masterId)
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await InspectionMainApi.importTemplate() importTemplateData.templateUrl = await InspectionMainApi.importTemplate()
}) })
</script> </script>

148
src/views/qms/inspectionScheme/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionSchemeMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="InspectionSchemeMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="InspectionSchemeMain.allSchemas" :allSchemas="InspectionSchemeMain.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #reqCode="{row}"> <template #reqCode="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)"> <el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)">
<span>{{ row.reqCode }}</span> <span>{{ row.reqCode }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -60,16 +68,21 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import {InspectionSchemeMain } from './inspectionScheme.data' import { InspectionSchemeMain } from './inspectionScheme.data'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../inspectionTemplate/inspectionTemplate.data' import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from '../inspectionTemplate/inspectionTemplate.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import * as InspectionSchemeApi from '@/api/qms/inspectionScheme' import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue"; import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
import * as SampleCodeApi from "@/api/qms/sampleCode"; import * as SampleCodeApi from '@/api/qms/sampleCode'
defineOptions({ name: 'InspectionScheme' }) defineOptions({ name: 'InspectionScheme' })
@ -95,12 +108,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:inspection-scheme:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:inspection-scheme:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:inspection-scheme:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:inspection-scheme:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:inspection-scheme:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-scheme:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -113,21 +126,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -137,25 +156,33 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:inspection-scheme:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:inspection-scheme:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:inspection-scheme:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:inspection-scheme:disable'}), hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:inspection-scheme:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:inspection-scheme:disable'
}),
defaultButtons.mainCopyBtn({ hasPermi: 'qms:programme-template:copy' }), defaultButtons.mainCopyBtn({ hasPermi: 'qms:programme-template:copy' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:inspection-scheme:delete'}), // defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:inspection-scheme:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
}else if (val == 'copy') { } else if (val == 'copy') {
openForm('create', row) openForm('create', row)
} }
} }
@ -170,19 +197,19 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const submitForm = async (formType,data) => { const submitForm = async (formType, data) => {
var isHave =InspectionSchemeMain.allSchemas.formSchema.some(function (item) { var isHave = InspectionSchemeMain.allSchemas.formSchema.some(function (item) {
return item.field === 'effectiveDate' || item.field === 'expirationDate'; return item.field === 'effectiveDate' || item.field === 'expirationDate'
}); })
if(isHave){ if (isHave) {
if(data.effectiveDate && data.expirationDate && data.effectiveDate >=data.expirationDate){ if (data.effectiveDate && data.expirationDate && data.effectiveDate >= data.expirationDate) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
const data1 = { const data1 = {
id: data.id, id: data.id,
dynamicUpdateCode:data.dynamicUpdateCode, dynamicUpdateCode: data.dynamicUpdateCode,
code: data.code, code: data.code,
description: data.description, description: data.description,
itemCode: data.itemCode, itemCode: data.itemCode,
@ -197,17 +224,23 @@ const submitForm = async (formType,data) => {
samplePieceSize: data.samplePieceSize, samplePieceSize: data.samplePieceSize,
uom: data.uom, uom: data.uom,
available: data.available, available: data.available,
content:JSON.stringify(data.process) content: JSON.stringify(data.process)
} }
if (formType === 'create') { try {
await InspectionSchemeApi.InspectionSchemeCreat(data1) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await InspectionSchemeApi.InspectionSchemeCreat(data1)
await InspectionSchemeApi.InspectionSchemeUpdate(data1) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await InspectionSchemeApi.InspectionSchemeUpdate(data1)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -287,11 +320,10 @@ const importSuccess = () => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await InspectionSchemeApi.importTemplate() importTemplateData.templateUrl = await InspectionSchemeApi.importTemplate()
}) })
</script> </script>

117
src/views/qms/inspectionStage/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionStage.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="InspectionStage.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="InspectionStage.allSchemas" :allSchemas="InspectionStage.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,13 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +59,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionStage.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionStage.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/inspection-stage/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/qms/inspection-stage/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionStage,InspectionStageRules } from './inspectionStage.data' import { InspectionStage, InspectionStageRules } from './inspectionStage.data'
import * as InspectionStageApi from '@/api/qms/inspectionStage' import * as InspectionStageApi from '@/api/qms/inspectionStage'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -99,12 +109,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:inspectionStage:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'wms:inspectionStage:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'wms:inspectionStage:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionStage:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'wms:inspectionStage:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionStage:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -117,31 +127,39 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:inspectionStage:update'}), // defaultButtons.mainListEditBtn({ hasPermi: 'wms:inspectionStage:update' }), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inspectionStage:delete'}), // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:inspectionStage:delete' }) //
] ]
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -153,27 +171,33 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =InspectionStage.allSchemas.formSchema.some(function (item) { var isHave = InspectionStage.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { try {
await InspectionStageApi.createInspectionStage(data) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await InspectionStageApi.createInspectionStage(data)
await InspectionStageApi.updateInspectionStage(data) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await InspectionStageApi.updateInspectionStage(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -240,5 +264,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await InspectionStageApi.importTemplate() importTemplateData.templateUrl = await InspectionStageApi.importTemplate()
}) })
</script> </script>

132
src/views/qms/inspectionTemplate/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionTemplateMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="InspectionTemplateMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="InspectionTemplateMain.allSchemas" :allSchemas="InspectionTemplateMain.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #reqCode="{row}"> <template #reqCode="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)"> <el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)">
<span>{{ row.reqCode }}</span> <span>{{ row.reqCode }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -49,11 +57,7 @@
@submitForm="submitForm" @submitForm="submitForm"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionTemplateMain.allSchemas" />
ref="detailRef"
:isBasic="true"
:allSchemas="InspectionTemplateMain.allSchemas"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
@ -69,7 +73,12 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from './inspectionTemplate.data' import {
InspectionTemplateMain,
InspectionTemplateProcess,
InspectionTemplateFeatures,
InspectionTemplateRules
} from './inspectionTemplate.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -101,12 +110,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:programme-template:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:programme-template:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:programme-template:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:programme-template:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:programme-template:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:programme-template:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -119,16 +128,22 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
@ -149,7 +164,7 @@ const handleExport = async () => {
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -159,25 +174,33 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:programme-template:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:programme-template:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:programme-template:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:programme-template:disable'}), hide: isShowMainButton(row, ['FALSE']),
hasPermi: 'qms:programme-template:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:programme-template:disable'
}),
defaultButtons.mainCopyBtn({ hasPermi: 'qms:programme-template:copy' }), defaultButtons.mainCopyBtn({ hasPermi: 'qms:programme-template:copy' }),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:programme-template:delete'}), // defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:programme-template:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
}else if (val == 'copy') { } else if (val == 'copy') {
openForm('create', row) openForm('create', row)
} }
} }
@ -189,16 +212,22 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const submitForm = async (formType,data) => { const submitForm = async (formType, data) => {
if (formType === 'create') { try {
await InspectionProcessPageApi.inspectionTemplateCreat(data.value) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await InspectionProcessPageApi.inspectionTemplateCreat(data.value)
await InspectionProcessPageApi.inspectionTemplateUpdate(data.value) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await InspectionProcessPageApi.inspectionTemplateUpdate(data.value)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -263,11 +292,10 @@ const importSuccess = () => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await InspectionProcessPageApi.importTemplate() importTemplateData.templateUrl = await InspectionProcessPageApi.importTemplate()
}) })
</script> </script>

2
src/views/qms/qualityNotice/index.vue

@ -184,6 +184,7 @@
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
try { try {
formRef.value.formLoading = true
if (formType === 'create') { if (formType === 'create') {
await qualityNoticeApi.qualityNoticeCreat(data) await qualityNoticeApi.qualityNoticeCreat(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -192,6 +193,7 @@
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false formRef.value.dialogVisible = false
formRef.value.formLoading = false
// //
getList() getList()
} finally { } finally {

155
src/views/qms/sampleCode/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SampleCode.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="SampleCode.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="SampleCode.allSchemas" :allSchemas="SampleCode.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -55,12 +63,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SampleCode.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="SampleCode.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/sample-code/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/qms/sample-code/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { SampleCode,SampleCodeRules } from './sampleCode.data' import { SampleCode, SampleCodeRules } from './sampleCode.data'
import * as SampleCodeApi from '@/api/qms/sampleCode' import * as SampleCodeApi from '@/api/qms/sampleCode'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -100,12 +113,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:sample-code:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:sample-code:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:sample-code:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:sample-code:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:sample-code:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:sample-code:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -118,27 +131,33 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
tableObject.params.isSearch = false tableObject.params.isSearch = false
tableObject.params.filters = '' tableObject.params.filters = ''
// tableObject.params = { // tableObject.params = {
// isSearch: true, // isSearch: true,
// filters: searchData.filters // filters: searchData.filters
// } // }
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -148,23 +167,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:sample-code:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:sample-code:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sample-code:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:sample-code:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sample-code:delete'}), // hasPermi: 'qms:sample-code:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:sample-code:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:sample-code:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
} }
} }
@ -176,32 +202,38 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
if(data.batchLowLimiting >= data.batchUpperLimiting){ if (data.batchLowLimiting >= data.batchUpperLimiting) {
message.alertWarning('批量上限须大于批量下限') message.alertWarning('批量上限须大于批量下限')
basicFormRef.value.formLoading = false basicFormRef.value.formLoading = false
return return
} }
var isHave =SampleCode.allSchemas.formSchema.some(function (item) { var isHave = SampleCode.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { try {
await SampleCodeApi.createSampleCode(data) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await SampleCodeApi.createSampleCode(data)
await SampleCodeApi.updateSampleCode(data) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await SampleCodeApi.updateSampleCode(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -279,21 +311,20 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const onChange = async (field, value, formRef) => { const onChange = async (field, value, formRef) => {
if(field == "batchLowLimiting" || field == "batchUpperLimiting"){ if (field == 'batchLowLimiting' || field == 'batchUpperLimiting') {
var upperLimit = formRef.value.formModel.batchUpperLimiting var upperLimit = formRef.value.formModel.batchUpperLimiting
var lowLimit = formRef.value.formModel.batchLowLimiting var lowLimit = formRef.value.formModel.batchLowLimiting
if(parseInt(upperLimit) <= parseInt(lowLimit)){ if (parseInt(upperLimit) <= parseInt(lowLimit)) {
message.warning("批量上限须大于批量下限") message.warning('批量上限须大于批量下限')
} }
} }
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
tableObject.params = { tableObject.params = {
available: true available: true
} }
getList() getList()
importTemplateData.templateUrl = await SampleCodeApi.importTemplate() importTemplateData.templateUrl = await SampleCodeApi.importTemplate()
}) })
</script> </script>

239
src/views/qms/samplingProcess/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SamplingProcess.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="SamplingProcess.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="SamplingProcess.allSchemas" :allSchemas="SamplingProcess.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -68,13 +76,13 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { SamplingProcess,SamplingProcessRules } from './samplingProcess.data' import { SamplingProcess, SamplingProcessRules } from './samplingProcess.data'
import * as SamplingProcessApi from '@/api/qms/samplingProcess' import * as SamplingProcessApi from '@/api/qms/samplingProcess'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import {validatePercent, validateInteger, validateTwoNum } from '@/utils/validator' import { validatePercent, validateInteger, validateTwoNum } from '@/utils/validator'
defineOptions({ name: 'SamplingProcess' }) defineOptions({ name: 'SamplingProcess' })
@ -109,12 +117,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:sampling-process:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:sampling-process:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:sampling-process:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:sampling-process:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:sampling-process:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:sampling-process:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -127,21 +135,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -151,22 +165,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:sampling-process:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:sampling-process:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sampling-process:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:sampling-process:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sampling-process:delete'}), // hasPermi: 'qms:sampling-process:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:sampling-process:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:sampling-process:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
} }
} }
@ -175,27 +197,34 @@ const buttonTableClick = async (val, row) => {
const basicFormRef = ref() const basicFormRef = ref()
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =SamplingProcess.allSchemas.formSchema.some(function (item) { var isHave = SamplingProcess.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await SamplingProcessApi.createSamplingProcess(data) try {
message.success(t('common.createSuccess')) basicFormRef.value.formLoading = true
} else { if (formType === 'create') {
await SamplingProcessApi.updateSamplingProcess(data) await SamplingProcessApi.createSamplingProcess(data)
message.success(t('common.updateSuccess')) message.success(t('common.createSuccess'))
} else {
await SamplingProcessApi.updateSamplingProcess(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -265,74 +294,85 @@ const importSuccess = () => {
} }
const updateFormFields = (sampleType, formRef) => { const updateFormFields = (sampleType, formRef) => {
let sampleQtyLabel = ''; let sampleQtyLabel = ''
let sampleQtyDisabled = false; let sampleQtyDisabled = false
let sampleProgCodeDisabled = true; let sampleProgCodeDisabled = true
let sampleQtyRequired = false; let sampleQtyRequired = false
let sampleProgCodeRequired = false; let sampleProgCodeRequired = false
switch (sampleType) { switch (sampleType) {
case '1': case '1':
sampleQtyLabel = '样品份数'; sampleQtyLabel = '样品份数'
sampleQtyDisabled = true; sampleQtyDisabled = true
sampleQtyRequired = false; sampleQtyRequired = false
SamplingProcessRules.sampleQty = [{ required: false, message: '该项为必填项', trigger: 'blur'}] SamplingProcessRules.sampleQty = [
break; { required: false, message: '该项为必填项', trigger: 'blur' }
]
break
case '2': case '2':
sampleQtyLabel = '样品份数(%)'; sampleQtyLabel = '样品份数(%)'
sampleQtyDisabled = false; sampleQtyDisabled = false
sampleQtyRequired = true; sampleQtyRequired = true
SamplingProcessRules.sampleQty = [{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur'},{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}] SamplingProcessRules.sampleQty = [
{ required: true, message: '该项为必填项', trigger: 'blur' },
break; { validator: validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur' },
{ validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' }
]
break
case '3': case '3':
sampleQtyLabel = '样品份数'; sampleQtyLabel = '样品份数'
sampleQtyDisabled = false; sampleQtyDisabled = false
sampleQtyRequired = true; sampleQtyRequired = true
SamplingProcessRules.sampleQty = [{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateInteger, message: '样品份数必须为正整数', trigger: 'blur'}] SamplingProcessRules.sampleQty = [
{ required: true, message: '该项为必填项', trigger: 'blur' },
break; { validator: validateInteger, message: '样品份数必须为正整数', trigger: 'blur' }
]
break
case '4': case '4':
sampleQtyLabel = '样品份数'; sampleQtyLabel = '样品份数'
sampleQtyDisabled = true; sampleQtyDisabled = true
sampleQtyRequired = false; sampleQtyRequired = false
sampleProgCodeDisabled = false; sampleProgCodeDisabled = false
sampleProgCodeRequired = true; sampleProgCodeRequired = true
SamplingProcessRules.sampleQty = [{ required: false, message: '该项为必填项', trigger: 'blur'}] SamplingProcessRules.sampleQty = [
break; { required: false, message: '该项为必填项', trigger: 'blur' }
]
break
default: default:
break; break
} }
SamplingProcess.allSchemas.formSchema.forEach(item => { SamplingProcess.allSchemas.formSchema.forEach((item) => {
if (item.field === 'sampleQty') { if (item.field === 'sampleQty') {
item.label = sampleQtyLabel; item.label = sampleQtyLabel
item.componentProps.disabled = sampleQtyDisabled; item.componentProps.disabled = sampleQtyDisabled
} }
if (item.field === 'sampleProgCode') { if (item.field === 'sampleProgCode') {
item.componentProps.disabled = sampleProgCodeDisabled; item.componentProps.disabled = sampleProgCodeDisabled
} }
}); })
SamplingProcessRules.sampleQty[0].required = sampleQtyRequired; SamplingProcessRules.sampleQty[0].required = sampleQtyRequired
SamplingProcessRules.sampleProgCode[0].required = sampleProgCodeRequired; SamplingProcessRules.sampleProgCode[0].required = sampleProgCodeRequired
formRef.value.setValues({ formRef.value.setValues({
sampleQty: '', sampleQty: '',
sampleProgCode: '', sampleProgCode: ''
}); })
}; }
const openForm = async (type, row) => { const openForm = async (type, row) => {
basicFormRef.value.open(type, row); basicFormRef.value.open(type, row)
updateFormFields(row.sampleType, basicFormRef); updateFormFields(row.sampleType, basicFormRef)
}; }
const onChange = async (field, value, formRef) => { const onChange = async (field, value, formRef) => {
if (field === 'sampleType') { if (field === 'sampleType') {
updateFormFields(value, formRef); updateFormFields(value, formRef)
} }
}; }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
@ -345,11 +385,10 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await SamplingProcessApi.importTemplate() importTemplateData.templateUrl = await SamplingProcessApi.importTemplate()
}) })
</script> </script>

134
src/views/qms/samplingScheme/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SamplingScheme.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="SamplingScheme.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="SamplingScheme.allSchemas" :allSchemas="SamplingScheme.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +62,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SamplingScheme.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="SamplingScheme.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/sampling-scheme/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/qms/sampling-scheme/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { SamplingScheme,SamplingSchemeRules } from './samplingScheme.data' import { SamplingScheme, SamplingSchemeRules } from './samplingScheme.data'
import * as SamplingSchemeApi from '@/api/qms/samplingScheme' import * as SamplingSchemeApi from '@/api/qms/samplingScheme'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -99,12 +112,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:sampling-scheme:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:sampling-scheme:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:sampling-scheme:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:sampling-scheme:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:sampling-scheme:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:sampling-scheme:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -117,21 +130,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -141,22 +160,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:sampling-scheme:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:sampling-scheme:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sampling-scheme:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:sampling-scheme:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sampling-scheme:delete'}), // hasPermi: 'qms:sampling-scheme:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:sampling-scheme:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:sampling-scheme:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -168,27 +195,33 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =SamplingScheme.allSchemas.formSchema.some(function (item) { var isHave = SamplingScheme.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { try {
await SamplingSchemeApi.createSamplingScheme(data) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await SamplingSchemeApi.createSamplingScheme(data)
await SamplingSchemeApi.updateSamplingScheme(data) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await SamplingSchemeApi.updateSamplingScheme(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -275,5 +308,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await SamplingSchemeApi.importTemplate() importTemplateData.templateUrl = await SamplingSchemeApi.importTemplate()
}) })
</script> </script>

114
src/views/qms/selectedProject/index.vue

@ -1,18 +1,22 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SelectedProject.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="SelectedProject.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="SelectedProject.allSchemas" :allSchemas="SelectedProject.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
@ -27,13 +31,13 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -54,12 +58,17 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SelectedProject.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="SelectedProject.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/selected-project/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/qms/selected-project/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { SelectedProject,SelectedProjectRules } from './selectedProject.data' import { SelectedProject, SelectedProjectRules } from './selectedProject.data'
import * as SelectedProjectApi from '@/api/qms/selectedProject' import * as SelectedProjectApi from '@/api/qms/selectedProject'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -99,12 +108,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:selectedProject:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:selectedProject:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:selectedProject:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:selectedProject:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:selectedProject:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:selectedProject:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -117,31 +126,39 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'qms:selectedProject:update'}), // defaultButtons.mainListEditBtn({ hasPermi: 'qms:selectedProject:update' }), //
defaultButtons.mainListDeleteBtn({hasPermi:'qms:selectedProject:delete'}), // defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:selectedProject:delete' }) //
] ]
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -153,27 +170,33 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =SelectedProject.allSchemas.formSchema.some(function (item) { var isHave = SelectedProject.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { try {
await SelectedProjectApi.createSelectedProject(data) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await SelectedProjectApi.createSelectedProject(data)
await SelectedProjectApi.updateSelectedProject(data) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await SelectedProjectApi.updateSelectedProject(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -240,5 +263,4 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await SelectedProjectApi.importTemplate() importTemplateData.templateUrl = await SelectedProjectApi.importTemplate()
}) })
</script> </script>

211
src/views/qms/selectedSet/index.vue

@ -1,22 +1,27 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SelectedSet.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="SelectedSet.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="SelectedSet.allSchemas" :allSchemas="SelectedSet.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,13 +32,16 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -77,7 +85,7 @@
:detailButtonIsShowDelete="checkPermi(['qms:selected-project:delete'])" :detailButtonIsShowDelete="checkPermi(['qms:selected-project:delete'])"
@detailOpenForm="detailOpenForm" @detailOpenForm="detailOpenForm"
@detailBasicFormOnChange="detailBasiFormOnChange" @detailBasicFormOnChange="detailBasiFormOnChange"
:detailButtonIsShowFilter="false" :detailButtonIsShowFilter="false"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -94,16 +102,16 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { SelectedSet,SelectedSetRules } from './selectedSet.data' import { SelectedSet, SelectedSetRules } from './selectedSet.data'
import * as SelectedSetApi from '@/api/qms/selectedSet' import * as SelectedSetApi from '@/api/qms/selectedSet'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { SelectedProject,SelectedProjectRules } from '../selectedProject/selectedProject.data' import { SelectedProject, SelectedProjectRules } from '../selectedProject/selectedProject.data'
import * as SelectedProjectApi from '@/api/qms/selectedProject' import * as SelectedProjectApi from '@/api/qms/selectedProject'
import * as DictDataApi from '@/api/system/dict/dict.data' import * as DictDataApi from '@/api/system/dict/dict.data'
import component from 'virtual:svg-icons-register' import component from 'virtual:svg-icons-register'
import * as DictTypeApi from '@/api/system/dict/dict.type' import * as DictTypeApi from '@/api/system/dict/dict.type'
import { checkPermi } from '@/utils/permission' import { checkPermi } from '@/utils/permission'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue"; import ImportForm from '../../../components/ImportForm/src/ImportForm.vue'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue' // import Detail from '@/components/Detail/src/Detail.vue'
@ -145,12 +153,12 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:selected-set:query'}), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:selected-set:query' }), //
defaultButtons.defaultImportBtn({hasPermi:'qms:selected-set:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'qms:selected-set:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'qms:selected-set:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:selected-set:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -163,21 +171,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
@ -187,22 +201,30 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi: 'qms:selected-set:update'}), defaultButtons.mainListEditBtn({ hasPermi: 'qms:selected-set:update' }),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:selected-set:enable'}), defaultButtons.mainListEnableBtn({
defaultButtons.mainListDisableBtn({ hide: isShowMainButton(row, ['TRUE']), hasPermi: 'qms:selected-set:disable' }), hide: isShowMainButton(row, ['FALSE']),
defaultButtons.mainListDeleteBtn({hasPermi:'qms:selected-set:delete'}), // hasPermi: 'qms:selected-set:enable'
}),
defaultButtons.mainListDisableBtn({
hide: isShowMainButton(row, ['TRUE']),
hasPermi: 'qms:selected-set:disable'
}),
defaultButtons.mainListDeleteBtn({ hasPermi: 'qms:selected-set:delete' }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
//
editForm('update', row) editForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'enable') { } else if (val == 'enable') {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { } else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
} }
} }
@ -215,34 +237,40 @@ const openForm = (type: string, row?: any) => {
} }
const editForm = async (type: string, row?: any) => { const editForm = async (type: string, row?: any) => {
tableData.value = [] tableData.value = []
SelectedProjectApi.getSelectedProjectNoPage({masterId:row.id}).then(res=>{ SelectedProjectApi.getSelectedProjectNoPage({ masterId: row.id }).then((res) => {
tableData.value = res tableData.value = res
}) })
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =SelectedSet.allSchemas.formSchema.some(function (item) { var isHave = SelectedSet.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime'
}); })
if(isHave){ if (isHave) {
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if(data.expireTime==0)data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') { try {
await SelectedSetApi.createSelectedSet(data) basicFormRef.value.formLoading = true
message.success(t('common.createSuccess')) if (formType === 'create') {
} else { await SelectedSetApi.createSelectedSet(data)
await SelectedSetApi.updateSelectedSet(data) message.success(t('common.createSuccess'))
message.success(t('common.updateSuccess')) } else {
await SelectedSetApi.updateSelectedSet(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
getList()
} finally {
basicFormRef.value.formLoading = false
} }
basicFormRef.value.dialogVisible = false
getList()
} }
/** 详情操作 */ /** 详情操作 */
@ -320,7 +348,6 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const tableFormKeys = {} const tableFormKeys = {}
SelectedProject.allSchemas.tableFormColumns.forEach((item) => { SelectedProject.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
@ -335,21 +362,20 @@ const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
const emptyFlag = validateDetailEmpty(tableData.value); const emptyFlag = validateDetailEmpty(tableData.value)
if(!emptyFlag){ if (!emptyFlag) {
message.alertWarning('明细不能为空') message.alertWarning('明细不能为空')
basicFormRef.value.formLoading = false basicFormRef.value.formLoading = false
return return
} }
if(!validateNotRepetition(tableData.value)){ if (!validateNotRepetition(tableData.value)) {
message.alertWarning('选定集字典及字典项不能重复') message.alertWarning('选定集字典及字典项不能重复')
basicFormRef.value.formLoading = false basicFormRef.value.formLoading = false
return return
} }
data.selectedProjectDOList = tableData.value// data.selectedProjectDOList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {
await SelectedSetApi.createSelectedSet(data) await SelectedSetApi.createSelectedSet(data)
@ -366,35 +392,34 @@ const submitForm = async (formType, data) => {
} }
} }
const validateDetailEmpty = (data) => { const validateDetailEmpty = (data) => {
const codes = data.map(item => item.stage); const codes = data.map((item) => item.stage)
if(codes.length == 0){ if (codes.length == 0) {
return false; return false
} }
return true; return true
} }
const validateNotRepetition = (data) => { const validateNotRepetition = (data) => {
// dictionaryTypeAndCode // dictionaryTypeAndCode
const codes = data.map(item => item.dictionaryValue); const codes = data.map((item) => item.dictionaryValue)
// Set dictionaryTypeAndCode // Set dictionaryTypeAndCode
const uniqueCodes = new Set(codes); const uniqueCodes = new Set(codes)
// Set // Set
if (codes.length > uniqueCodes.size) { if (codes.length > uniqueCodes.size) {
return false; // false return false // false
} }
return true; // true return true // true
}; }
const detailValidate = (formType,data) => { const detailValidate = (formType, data) => {
let tag = true; let tag = true
existValue.value.forEach(item=>{ existValue.value.forEach((item) => {
if(data.dictionaryValue == item.dictionaryValue){ if (data.dictionaryValue == item.dictionaryValue) {
message.warning("选定集字典项不能重复!") message.warning('选定集字典项不能重复!')
tag = false; tag = false
} }
}) })
return tag return tag
@ -402,43 +427,35 @@ const detailValidate = (formType,data) => {
const detailOpenForm = (type, row, masterParmas) => { const detailOpenForm = (type, row, masterParmas) => {
let param = { let param = {
masterId : masterParmas.masterId masterId: masterParmas.masterId
} }
if(type == 'create'){ if (type == 'create') {
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => { SelectedProjectApi.getSelectedProjectNoPage(param).then((res) => {
if(res.length > 0){ if (res.length > 0) {
existValue.value = res existValue.value = res
} }
}) })
}else if('update'){ } else if ('update') {
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => { SelectedProjectApi.getSelectedProjectNoPage(param).then((res) => {
if(res.length > 0){ if (res.length > 0) {
existValue.value = res.filter(item=>{ existValue.value = res.filter((item) => {
return item?.id != row.id return item?.id != row.id
}) })
} }
}) })
} }
} }
const detailBasiFormOnChange = (field, val, detailFormRef) => {}
const formSelectChange = (a, b, c, d) => {}
const detailBasiFormOnChange = (field,val,detailFormRef) => {
}
const formSelectChange = (a,b,c,d) => {
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
  tableObject.params = { tableObject.params = {
    available: true available: true
  } }
getList() getList()
importTemplateData.templateUrl = await SelectedSetApi.importTemplate() importTemplateData.templateUrl = await SelectedSetApi.importTemplate()
}) })
</script> </script>

2
src/views/wms/basicDataManage/documentSetting/businesstype/businesstype.data.ts

@ -119,6 +119,7 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
multiple: true,
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区代码', // 输入框占位文本 searchListPlaceholder: '请选择库区代码', // 输入框占位文本
@ -147,6 +148,7 @@ export const Businesstype = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
multiple: true,
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区代码', // 输入框占位文本 searchListPlaceholder: '请选择库区代码', // 输入框占位文本

5
src/views/wms/deliversettlementManage/customerreturn/customerreturnJobMain/customerreturnJobMain.data.ts

@ -88,6 +88,11 @@ export const CustomerreturnJobMain = useCrudSchemas(
key: 'status', key: 'status',
value: '0', value: '0',
isMainValue: false isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
} }
], ],
verificationParams: [ verificationParams: [

5
src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/customerreturnRecordMain.data.ts

@ -99,6 +99,11 @@ export const CustomerreturnRecordMain = useCrudSchemas(
key: 'status', key: 'status',
value: '0', value: '0',
isMainValue: false isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
} }
], ],
verificationParams: [ verificationParams: [

5
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts

@ -226,6 +226,11 @@ export const CustomerreturnRequestMain = useCrudSchemas(
key: 'status', key: 'status',
value: '0', value: '0',
isMainValue: false isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
} }
], ],
verificationParams: [ verificationParams: [

960
src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts

File diff suppressed because it is too large

556
src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts

@ -1,288 +1,338 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import { TableColumn } from '@/types/table' import { TableColumn } from '@/types/table'
import * as InspectionQ3Api from '@/api/qms/inspectionQ3'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data'
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ScrapRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ScrapRecordMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '单据号', {
field: 'number', label: '单据号',
sort: 'custom', field: 'number',
table: { sort: 'custom',
width: 180, table: {
fixed: 'left' width: 180,
}, fixed: 'left'
isSearch: true },
}, isSearch: true
{ },
label: '申请单号', {
field: 'requestNumber', label: '申请单号',
sort: 'custom', field: 'requestNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isSearch: true },
}, isSearch: true
{ },
label: '任务单号', {
field: 'jobNumber', label: '任务单号',
sort: 'custom', field: 'jobNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isSearch: true },
}, isSearch: true
{ },
label: '申请时间', {
field: 'requestTime', label: 'Q3通知单号',
formatter: dateFormatter, field: 'q3Number',
detail: { sort: 'custom',
dateFormat: 'YYYY-MM-DD HH:mm:ss' isSearch: false,
}, isDetail: true,
sort: 'custom', table: {
table: { width: 150
width: 180 },
}, form: {
form: { // labelMessage: '信息提示说明!!!',
component: 'DatePicker', componentProps: {
componentProps: { enterSearch: true,
type: 'datetime', // multiple: true,
dateFormat: 'YYYY-MM-DD HH:mm:ss', isSearchList: true, // 开启查询弹窗
valueFormat: 'x', searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: 'Q3通知单号', // 查询弹窗标题
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'status',
value: '0',
isMainValue: false
}
],
verificationParams: [
{
key: 'number',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
} }
}, },
}, {
{ label: '申请时间',
label: '截止时间', field: 'requestTime',
field: 'dueTime', formatter: dateFormatter,
formatter: dateFormatter, detail: {
detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
}, sort: 'custom',
sort: 'custom', table: {
table: { width: 180
width: 180 },
}, form: {
form: { component: 'DatePicker',
component: 'DatePicker', componentProps: {
componentProps: { type: 'datetime',
type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss',
dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x'
valueFormat: 'x', }
} }
}, },
}, {
{ label: '截止时间',
label: '执行时间', field: 'dueTime',
field: 'executeTime', formatter: dateFormatter,
formatter: dateFormatter, detail: {
detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
}, sort: 'custom',
sort: 'custom', table: {
table: { width: 180
width: 180 },
}, form: {
form: { component: 'DatePicker',
component: 'DatePicker', componentProps: {
componentProps: { type: 'datetime',
type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss',
dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x'
valueFormat: 'x', }
} }
}, },
}, {
{ label: '执行时间',
label: '生效日期', field: 'executeTime',
field: 'activeDate', formatter: dateFormatter,
formatter: dateFormatter2, detail: {
detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
dateFormat: 'YYYY-MM-DD' },
}, sort: 'custom',
sort: 'custom', table: {
table: { width: 180
width: 180 },
}, form: {
form: { component: 'DatePicker',
component: 'DatePicker', componentProps: {
componentProps: { type: 'datetime',
style: {width: '100%'}, dateFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'date', valueFormat: 'x'
dateFormat: 'YYYY-MM-DD', }
valueFormat: 'x',
} }
}, },
}, {
{ label: '生效日期',
label: '从仓库代码', field: 'activeDate',
field: 'fromWarehouseCode', formatter: dateFormatter2,
sort: 'custom', detail: {
table: { dateFormat: 'YYYY-MM-DD'
width: 150 },
}, sort: 'custom',
}, table: {
{ width: 180
label: '从库区类型范围', },
field: 'fromAreaTypes', form: {
dictType: DICT_TYPE.AREA_TYPE, component: 'DatePicker',
dictClass: 'string', componentProps: {
isTable: true, style: { width: '100%' },
sort: 'custom', type: 'date',
table: { dateFormat: 'YYYY-MM-DD',
width: 150 valueFormat: 'x'
}
}
}, },
}, {
{ label: '从仓库代码',
label: '从库区代码范围', field: 'fromWarehouseCode',
field: 'fromAreaCodes', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 }
}, },
}, {
{ label: '从库区类型范围',
label: '出库事务类型', field: 'fromAreaTypes',
field: 'outTransactionType', dictType: DICT_TYPE.AREA_TYPE,
sort: 'custom', dictClass: 'string',
table: { isTable: true,
width: 150 sort: 'custom',
table: {
width: 150
}
}, },
}, {
{ label: '从库区代码范围',
label: '入库事务类型', field: 'fromAreaCodes',
field: 'inTransactionType', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 }
}, },
}, {
{ label: '出库事务类型',
label: '业务类型', field: 'outTransactionType',
field: 'businessType', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 }
}, },
}, {
{ label: '入库事务类型',
label: '部门', field: 'inTransactionType',
field: 'departmentCode', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 }
}, },
}, {
{ label: '业务类型',
label: '接口类型', field: 'businessType',
field: 'interfaceType', sort: 'custom',
dictType: DICT_TYPE.INTERFACE_TYPE, table: {
dictClass: 'string', width: 150
isTable: true, }
sort: 'custom',
table: {
width: 150
}, },
}, {
{ label: '部门',
label: '备注', field: 'departmentCode',
field: 'remark', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 }
}, },
}, {
{ label: '接口类型',
label: '创建时间', field: 'interfaceType',
field: 'createTime', dictType: DICT_TYPE.INTERFACE_TYPE,
formatter: dateFormatter, dictClass: 'string',
detail: { isTable: true,
dateFormat: 'YYYY-MM-DD HH:mm:ss' sort: 'custom',
table: {
width: 150
}
}, },
sort: 'custom', {
table: { label: '备注',
width: 180 field: 'remark',
sort: 'custom',
table: {
width: 150
}
}, },
isTable: false, {
form: { label: '创建时间',
component: 'DatePicker', field: 'createTime',
componentProps: { formatter: dateFormatter,
type: 'datetime', detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss'
valueFormat: 'x', },
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
}, {
{ label: '创建者',
label: '创建者', field: 'creator',
field: 'creator', sort: 'custom',
sort: 'custom', isTable: false,
isTable: false, table: {
table: { width: 150
width: 150 }
}, },
},
{ {
label: '最后更新时间', label: '最后更新时间',
field: 'updateTime', field: 'updateTime',
sort: 'custom', sort: 'custom',
isDetail: true, isDetail: true,
isForm: false, isForm: false,
isTable: false, isTable: false,
formatter: dateFormatter, formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
table: { {
width: 180 label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
}, },
form: { // {
component: 'DatePicker', // label: '代码',
componentProps: { // field: 'code',
style: {width:'100%'}, // sort: 'custom',
type: 'datetime', // table: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', // width: 150
valueFormat: 'x', // },
// },
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
} }
} }
}, ])
{ )
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
]))
//表单校验 //表单校验
export const ScrapRecordMainRules = reactive({ export const ScrapRecordMainRules = reactive({

762
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts

@ -1,398 +1,456 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as BalanceApi from '@/api/wms/balance' import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data"; import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as WarehouseApi from "@/api/wms/warehouse"; import * as WarehouseApi from '@/api/wms/warehouse'
import * as InspectionQ3Api from '@/api/qms/inspectionQ3'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { const queryParams = {
pageSize:10, pageSize: 10,
pageNo:1, pageNo: 1,
code:'ScrapRequest' code: 'ScrapRequest'
} }
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{} const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table' import { TableColumn } from '@/types/table'
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到 // id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString() userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept] const userDeptArray: any = [userDept]
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ScrapRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ScrapRequestMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '单据号', {
field: 'number', label: '单据号',
sort: 'custom', field: 'number',
table: { sort: 'custom',
width: 180, table: {
fixed: 'left' width: 180,
}, fixed: 'left'
isForm: false, },
isSearch: true, isForm: false,
}, isSearch: true
{ },
label: '状态', {
field: 'status', label: 'Q3通知单号',
dictType: DICT_TYPE.REQUEST_STATUS, field: 'q3Number',
dictClass: 'string', sort: 'custom',
isSearch: true, isSearch: false,
isForm: false, isDetail: true,
isTable: true, table: {
sort: 'custom', width: 150
table: { },
width: 150 form: {
}, // labelMessage: '信息提示说明!!!',
form: { componentProps: {
value: '1', enterSearch: true,
componentProps: { // multiple: true,
disabled: true isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: 'Q3通知单号', // 查询弹窗标题
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'status',
value: '0',
isMainValue: false
}
],
verificationParams: [
{
key: 'number',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
} }
}
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
}, },
form: { {
component: 'DatePicker', label: '状态',
componentProps: { field: 'status',
style: {width: '100%'}, dictType: DICT_TYPE.REQUEST_STATUS,
type: 'datetime', dictClass: 'string',
dateFormat: 'YYYY-MM-DD HH:mm:ss', isSearch: true,
valueFormat: 'x', isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
} }
}, },
isForm: false, {
}, label: '申请时间',
{ field: 'requestTime',
label: '截止时间', formatter: dateFormatter,
field: 'dueTime', detail: {
formatter: dateFormatter, dateFormat: 'YYYY-MM-DD HH:mm:ss'
detail: { },
dateFormat: 'YYYY-MM-DD HH:mm:ss' sort: 'custom',
}, table: {
sort: 'custom', width: 180
table: { },
width: 180 form: {
}, component: 'DatePicker',
form: { componentProps: {
component: 'DatePicker', style: { width: '100%' },
componentProps: { type: 'datetime',
style: {width: '100%'}, dateFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'datetime', valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss', }
valueFormat: 'x', },
isForm: false
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
}, {
{ label: '从仓库代码',
label: '从仓库代码', field: 'fromWarehouseCode',
field: 'fromWarehouseCode', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 },
}, isSearch: true,
isSearch: true, tableForm: {
tableForm: {
enterSearch: true,
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本 searchListPlaceholder: '请选择仓库代码',
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code',
searchTitle: '仓库信息', // 查询弹窗标题 searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类 searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法 searchPage: WarehouseApi.getWarehousePage,
searchCondition: [{ searchCondition: [
key: 'available', {
value: 'TRUE', key: 'available',
isMainValue: false value: 'TRUE',
}], isMainValue: false
verificationParams: [{ }
key: 'code', ],
action: '==', verificationParams: [
value: '', {
isMainValue: false, key: 'code',
isSearch: true, action: '==',
isFormModel: true, value: '',
}], // 失去焦点校验参数 isMainValue: false,
} isSearch: true,
} isFormModel: true
}, }
{ ] // 失去焦点校验参数
label: '从库区类型范围', },
field: 'fromAreaTypes', form: {
dictType: DICT_TYPE.AREA_TYPE, // labelMessage: '信息提示说明!!!',
dictClass: 'string', componentProps: {
isTable: true, enterSearch: true,
sort: 'custom', isSearchList: true, // 开启查询弹窗
table: { searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
width: 150 searchField: 'code', // 查询弹窗赋值字段
}, searchTitle: '仓库信息', // 查询弹窗标题
isSearch: true, searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
isForm: false, searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
}, searchCondition: [
{ {
label: '从库区代码范围', key: 'available',
field: 'fromAreaCodes', value: 'TRUE',
sort: 'custom', isMainValue: false
table: { }
width: 150 ],
}, verificationParams: [
isForm: false, {
}, key: 'code',
{ action: '==',
label: '业务类型', value: '',
field: 'businessType', isMainValue: false,
sort: 'custom', isSearch: true,
table: { isFormModel: true
width: 150 }
}, ] // 失去焦点校验参数
form: { }
value: 'Scrap',
componentProps: {
disabled: true
} }
}, },
isForm: false, {
}, label: '从库区类型范围',
{ field: 'fromAreaTypes',
label: '部门', dictType: DICT_TYPE.AREA_TYPE,
field: 'departmentCode', dictClass: 'string',
sort: 'custom', isTable: true,
isForm: false, sort: 'custom',
isTable:false, table: {
table: { width: 150
width: 150 },
}, isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { isForm: false
return userDeptArray.find((account) => account.id == cellValue)?.name },
}, {
form: { label: '从库区代码范围',
value: userDept.id, field: 'fromAreaCodes',
component: 'Select', sort: 'custom',
api: () => userDeptArray, table: {
componentProps: { width: 150
disabled: true, },
optionsAlias: { isForm: false
labelField: 'name', },
valueField: 'id' {
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
form: {
value: 'Scrap',
componentProps: {
disabled: true
}
},
isForm: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
} }
} }
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isTable:false,
table: {
width: 150
},
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '备注',
value: requestsettingData.autoCommit, field: 'remark',
componentProps: { sort: 'custom',
inactiveValue: 'FALSE', isTable: false,
activeValue: 'TRUE', table: {
disable: true width: 150
} }
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '自动提交',
value: requestsettingData.autoAgree, field: 'autoCommit',
componentProps: { dictType: DICT_TYPE.TRUE_FALSE,
inactiveValue: 'FALSE', dictClass: 'string',
activeValue: 'TRUE', isTable: false,
disable: true isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disable: true
}
} }
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '自动通过',
value: requestsettingData.autoExecute, field: 'autoAgree',
componentProps: { dictType: DICT_TYPE.TRUE_FALSE,
inactiveValue: 'FALSE', dictClass: 'string',
activeValue: 'TRUE', isTable: false,
disable: true isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disable: true
}
} }
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm:false,
isTable: false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '自动执行',
value: requestsettingData.directCreateRecord, field: 'autoExecute',
componentProps: { dictType: DICT_TYPE.TRUE_FALSE,
inactiveValue: 'FALSE', dictClass: 'string',
activeValue: 'TRUE', isTable: false,
disable: true isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disable: true
}
} }
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
}, },
form: { {
component: 'DatePicker', label: '直接生成记录',
componentProps: { field: 'directCreateRecord',
style: {width: '100%'}, dictType: DICT_TYPE.TRUE_FALSE,
type: 'datetime', dictClass: 'string',
dateFormat: 'YYYY-MM-DD HH:mm:ss', isForm: false,
valueFormat: 'x', isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disable: true
}
} }
}, },
isTable:false, {
isForm: false, label: '创建时间',
}, field: 'createTime',
{ formatter: dateFormatter,
label: '创建者', detail: {
field: 'creator', dateFormat: 'YYYY-MM-DD HH:mm:ss'
sort: 'custom', },
table: { sort: 'custom',
width: 150 table: {
}, width: 180
isTable:false, },
isForm: false, form: {
}, component: 'DatePicker',
{ componentProps: {
label: '最后更新时间', style: { width: '100%' },
field: 'updateTime', type: 'datetime',
formatter: dateFormatter, dateFormat: 'YYYY-MM-DD HH:mm:ss',
detail: { valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss' }
}, },
sort: 'custom', isTable: false,
table: { isForm: false
width: 180 },
}, {
form: { label: '创建者',
component: 'DatePicker', field: 'creator',
componentProps: { sort: 'custom',
style: {width: '100%'}, table: {
type: 'datetime', width: 150
dateFormat: 'YYYY-MM-DD HH:mm:ss', },
valueFormat: 'x', isTable: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isTable: false,
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
} }
}, }
isTable:false, ])
isForm: false, )
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable:false,
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
}
]))
//表单校验 //表单校验
export const ScrapRequestMainRules = reactive({ export const ScrapRequestMainRules = reactive({

644
src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts

@ -1,321 +1,371 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import * as InspectionQ3Api from '@/api/qms/inspectionQ3'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data'
/** /**
* @returns {Array} 退 * @returns {Array} 退
*/ */
export const ProductionscrapRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ProductionscrapRecordMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '单据号', {
field: 'number', label: '单据号',
sort: 'custom', field: 'number',
table: { sort: 'custom',
width: 180, table: {
fixed: 'left' width: 180,
}, fixed: 'left'
isSearch: true },
}, isSearch: true
{ },
label: '申请单号', {
field: 'requestNumber', label: '申请单号',
sort: 'custom', field: 'requestNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isSearch: true },
}, isSearch: true
{ },
label: '车间代码', {
field: 'workshopCode', label: 'Q3通知单号',
sort: 'custom', field: 'q3Number',
table: { sort: 'custom',
width: 150 isSearch: false,
}, isDetail: true,
}, table: {
{ width: 150
label: '出库事务类型', },
field: 'outTransactionType', form: {
sort: 'custom', // labelMessage: '信息提示说明!!!',
table: { componentProps: {
width: 150 enterSearch: true,
}, // multiple: true,
isTable: false, isSearchList: true, // 开启查询弹窗
}, searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
{ searchField: 'number', // 查询弹窗赋值字段
label: '入库事务类型', searchTitle: 'Q3通知单号', // 查询弹窗标题
field: 'inTransactionType', searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类
sort: 'custom', searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法
table: { searchCondition: [
width: 150 {
}, key: 'available',
isTable: false, value: 'TRUE',
}, isMainValue: false
{ },
label: '执行时间', {
field: 'executeTime', key: 'status',
formatter: dateFormatter, value: '0',
detail: { isMainValue: false
dateFormat: 'YYYY-MM-DD HH:mm:ss' }
}, ],
sort: 'custom', verificationParams: [
table: { {
width: 180 key: 'number',
}, action: '==',
isTable: false, value: '',
form: { isMainValue: false,
component: 'DatePicker', isSearch: true,
componentProps: { isFormModel: true
type: 'datetime', }
dateFormat: 'YYYY-MM-DD HH:mm:ss', ] // 失去焦点校验参数
valueFormat: 'x', }
} }
}, },
}, {
{ label: '车间代码',
label: '生效日期', field: 'workshopCode',
field: 'activeDate', sort: 'custom',
formatter: dateFormatter2, table: {
detail: { width: 150
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
} }
}, },
}, {
{ label: '出库事务类型',
label: '申请时间', field: 'outTransactionType',
field: 'requestTime', sort: 'custom',
formatter: dateFormatter, table: {
detail: { width: 150
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
}, isTable: false
sort: 'custom', },
table: { {
width: 180 label: '入库事务类型',
}, field: 'inTransactionType',
isTable: false, sort: 'custom',
form: { table: {
component: 'DatePicker', width: 150
componentProps: { },
type: 'datetime', isTable: false
dateFormat: 'YYYY-MM-DD HH:mm:ss', },
valueFormat: 'x', {
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
}, {
{ label: '生效日期',
label: '截止时间', field: 'activeDate',
field: 'dueTime', formatter: dateFormatter2,
formatter: dateFormatter, detail: {
detail: { dateFormat: 'YYYY-MM-DD'
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
}, sort: 'custom',
sort: 'custom', table: {
table: { width: 180
width: 180 },
}, isTable: false,
isTable: false, form: {
form: { component: 'DatePicker',
component: 'DatePicker', componentProps: {
componentProps: { style: { width: '100%' },
type: 'datetime', type: 'date',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
}
} }
}, },
}, {
{ label: '申请时间',
label: '部门', field: 'requestTime',
field: 'departmentCode', formatter: dateFormatter,
sort: 'custom', detail: {
table: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
width: 150 },
}, sort: 'custom',
isTable: false, table: {
}, width: 180
{ },
label: '接口类型', isTable: false,
field: 'interfaceType', form: {
dictType: DICT_TYPE.INTERFACE_TYPE, component: 'DatePicker',
dictClass: 'string', componentProps: {
isTable: false, type: 'datetime',
sort: 'custom', dateFormat: 'YYYY-MM-DD HH:mm:ss',
table: { valueFormat: 'x'
width: 150 }
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: true,
// },
// {
// label: '创建时间',
// field: 'createTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// isTable: true,
// form: {
// component: 'DatePicker',
// componentProps: {
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// },
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
}, },
isTable: false, {
}, label: '截止时间',
{ field: 'dueTime',
label: '从库区类型范围', formatter: dateFormatter,
field: 'fromAreaTypes', detail: {
dictType: DICT_TYPE.AREA_TYPE, dateFormat: 'YYYY-MM-DD HH:mm:ss'
dictClass: 'string', },
isTable: false, sort: 'custom',
sort: 'custom', table: {
table: { width: 180
width: 150 },
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
}, {
{ label: '部门',
label: '从库区代码范围', field: 'departmentCode',
field: 'fromAreaCodes', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 },
isTable: false
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
}, },
isTable: false, {
}, label: '业务类型',
{ field: 'businessType',
label: '到仓库代码', sort: 'custom',
field: 'toWarehouseCode', table: {
sort: 'custom', width: 150
table: { },
width: 150 isTable: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: true,
// },
// {
// label: '创建时间',
// field: 'createTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// isTable: true,
// form: {
// component: 'DatePicker',
// componentProps: {
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// },
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
isTable: false, {
}, label: '最后更新者',
{ field: 'updater',
label: '到库区类型范围', isDetail: true,
field: 'toAreaTypes', isForm: false,
dictType: DICT_TYPE.AREA_TYPE, isTable: false,
dictClass: 'string', table: {
isTable: false, width: 150
sort: 'custom', }
table: {
width: 150
}, },
}, {
{ label: '从仓库代码',
label: '到库区代码范围', field: 'fromWarehouseCode',
field: 'toAreaCodes', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 },
isTable: false
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
}, },
isTable: false, {
}, label: '从库区代码范围',
{ field: 'fromAreaCodes',
label: '是否可用', sort: 'custom',
field: 'available', table: {
dictType: DICT_TYPE.TRUE_FALSE, width: 150
dictClass: 'string', },
isSearch: true, isTable: false
isTable: false, },
sort: 'custom', {
table: { label: '到仓库代码',
width: 150 field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
}, },
form: { {
component: 'Switch', label: '到库区代码范围',
value: 'TRUE', field: 'toAreaCodes',
componentProps: { sort: 'custom',
inactiveValue: 'FALSE', table: {
activeValue: 'TRUE' width: 150
},
isTable: false
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
} }
} }
}, ])
])) )
//表单校验 //表单校验
export const ProductionscrapRecordMainRules = reactive({ export const ProductionscrapRecordMainRules = reactive({
@ -552,6 +602,7 @@ export const ProductionscrapRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 150 width: 150
}, },
isTable:false,
hiddenInMain: true, hiddenInMain: true,
}, },
{ {
@ -561,6 +612,7 @@ export const ProductionscrapRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 150 width: 150
}, },
isTable:false,
hiddenInMain: true, hiddenInMain: true,
}, },
{ {
@ -570,6 +622,7 @@ export const ProductionscrapRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 150 width: 150
}, },
isTable:false,
hiddenInMain: true, hiddenInMain: true,
}, },
{ {
@ -579,6 +632,7 @@ export const ProductionscrapRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 180 width: 180
}, },
isTable:false,
hiddenInMain: true, hiddenInMain: true,
}, },
{ {

916
src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts

@ -1,486 +1,548 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as WorkshopApi from '@/api/wms/workshop' import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ProductionlineApi from '@/api/wms/productionline' import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as WorkstationApi from '@/api/wms/workstation' import * as WorkstationApi from '@/api/wms/workstation'
import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data' import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
import * as BalanceApi from '@/api/wms/balance' import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as ItempackagingApi from '@/api/wms/itempackage' import * as ItempackagingApi from '@/api/wms/itempackage'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data' import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table' import { TableColumn } from '@/types/table'
import * as InspectionQ3Api from '@/api/qms/inspectionQ3'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { const queryParams = {
pageSize:10, pageSize: 10,
pageNo:1, pageNo: 1,
code:'MaterialReturnRequest' code: 'MaterialReturnRequest'
} }
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{} const requestsettingData = data?.list[0] || {}
//console.log(34, requestsettingData) //console.log(34, requestsettingData)
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到 // id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString() userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept] const userDeptArray: any = [userDept]
/** /**
* @returns {Array} 退 * @returns {Array} 退
*/ */
export const ProductionscrapRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ProductionscrapRequestMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '单据号', {
field: 'number', label: '单据号',
sort: 'custom', field: 'number',
table: { sort: 'custom',
width: 180, table: {
fixed: 'left' width: 180,
}, fixed: 'left'
isForm: false, },
isSearch: true, isForm: false,
}, isSearch: true
{ },
label: '状态', {
field: 'status', label: 'Q3通知单号',
dictType: DICT_TYPE.REQUEST_STATUS, field: 'q3Number',
dictClass: 'string', sort: 'custom',
isSearch: true, isSearch: false,
isTable: true, isDetail: true,
isForm:false, table: {
sort: 'custom', width: 150
table: { },
width: 150 form: {
}, // labelMessage: '信息提示说明!!!',
form: { componentProps: {
value: '1', enterSearch: true,
componentProps: { // multiple: true,
disabled: true isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: 'Q3通知单号', // 查询弹窗标题
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'status',
value: '0',
isMainValue: false
}
],
verificationParams: [
{
key: 'number',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
} }
}
},
{
label: '车间',
field: 'workshopCode',
sort: 'custom',
table: {
width: 150
}, },
isSearch: true, {
form: { label: '状态',
// labelMessage: '信息提示说明!!!', field: 'status',
componentProps: { dictType: DICT_TYPE.REQUEST_STATUS,
enterSearch: true, dictClass: 'string',
isSearchList: true, // 开启查询弹窗 isSearch: true,
searchListPlaceholder: '请选择车间代码', // 输入框占位文本 isTable: true,
searchField: 'code', // 查询弹窗赋值字段 isForm: false,
searchTitle: '车间信息', // 查询弹窗标题 sort: 'custom',
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 table: {
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 width: 150
searchCondition:[{ },
key: 'available', form: {
value: 'TRUE', value: '1',
isMainValue: false componentProps: {
}], disabled: true
verificationParams: [{ }
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
} }
}, },
}, {
{ label: '车间',
label: '生产线代码', field: 'workshopCode',
field: 'productionLineCode', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 },
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
}, },
form: { {
// labelMessage: '信息提示说明!!!', label: '生产线代码',
componentProps: { field: 'productionLineCode',
enterSearch: true, sort: 'custom',
isSearchList: true, // 开启查询弹窗 table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'workshopCode',
value: 'workshopCode',
message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}
],
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题 searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition:[{ searchCondition: [
key: 'available', {
value: 'TRUE', key: 'available',
isMainValue: false value: 'TRUE',
},{ isMainValue: false
key: 'workshopCode', },
value: 'workshopCode', {
message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示 key: 'workshopCode',
isMainValue: true value: 'workshopCode',
}], message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示
verificationParams: [{ isMainValue: true
key: 'code', }
action: '==', ]
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
} }
}, },
tableForm:{ {
isInpuFocusShow: true, label: '申请时间',
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 field: 'requestTime',
searchField: 'code', // 查询弹窗赋值字段 formatter: dateFormatter,
searchTitle: '生产线信息', // 查询弹窗标题 detail: {
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 dateFormat: 'YYYY-MM-DD HH:mm:ss'
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 },
searchCondition:[{ sort: 'custom',
key: 'available', table: {
value: 'TRUE', width: 180
isMainValue: false },
},{ isTable: false,
key: 'workshopCode', form: {
value: 'workshopCode', component: 'DatePicker',
message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示 componentProps: {
isMainValue: true style: { width: '100%' },
}] type: 'datetime',
}, dateFormat: 'YYYY-MM-DD HH:mm:ss',
}, valueFormat: 'x'
{ }
label: '申请时间', },
field: 'requestTime', isForm: false
formatter: dateFormatter, },
detail: { {
dateFormat: 'YYYY-MM-DD HH:mm:ss' label: '截止时间',
}, field: 'dueTime',
sort: 'custom', formatter: dateFormatter,
table: { detail: {
width: 180 dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
isTable: false, sort: 'custom',
form: { table: {
component: 'DatePicker', width: 180
componentProps: { },
style: {width:'100%'}, isTable: false,
type: 'datetime', form: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', component: 'DatePicker',
valueFormat: 'x', componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
isForm: false, {
}, label: '从库区类型范围',
{ field: 'fromAreaTypes',
label: '截止时间', dictType: DICT_TYPE.AREA_TYPE,
field: 'dueTime', dictClass: 'string',
formatter: dateFormatter, isTable: false,
detail: { sort: 'custom',
dateFormat: 'YYYY-MM-DD HH:mm:ss' table: {
}, width: 150
sort: 'custom', },
table: { isForm: false
width: 180
}, },
isTable: false, {
form: { label: '到库区类型范围',
component: 'DatePicker', field: 'toAreaTypes',
componentProps: { dictType: DICT_TYPE.AREA_TYPE,
style: {width:'100%'}, dictClass: 'string',
type: 'datetime', isSearch: true,
dateFormat: 'YYYY-MM-DD HH:mm:ss', isTable: false,
valueFormat: 'x', sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
} }
}, },
}, {
{ label: '自动提交',
label: '从库区类型范围', field: 'autoCommit',
field: 'fromAreaTypes', dictType: DICT_TYPE.TRUE_FALSE,
dictType: DICT_TYPE.AREA_TYPE, dictClass: 'string',
dictClass: 'string', isTable: false,
isTable: false, isForm: false,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isForm: false, form: {
}, component: 'Switch',
{ value: requestsettingData.autoCommit,
label: '到库区类型范围', componentProps: {
field: 'toAreaTypes', inactiveValue: 'FALSE',
dictType: DICT_TYPE.AREA_TYPE, activeValue: 'TRUE',
dictClass: 'string', disabled: true
isSearch: true,
isTable: false,
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false,
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false,
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false,
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm:false,
table: {
width: 150
},
isTable: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
} }
} }
}
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '自动通过',
value: requestsettingData.autoCommit, field: 'autoAgree',
componentProps: { dictType: DICT_TYPE.TRUE_FALSE,
inactiveValue: 'FALSE', dictClass: 'string',
activeValue: 'TRUE', isTable: false,
disabled: true, isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
} }
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '自动执行',
value: requestsettingData.autoAgree, field: 'autoExecute',
componentProps: { dictType: DICT_TYPE.TRUE_FALSE,
inactiveValue: 'FALSE', dictClass: 'string',
activeValue: 'TRUE', isTable: false,
disabled: true, isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
} }
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '直接生成记录',
value: requestsettingData.autoExecute, field: 'directCreateRecord',
componentProps: { dictType: DICT_TYPE.TRUE_FALSE,
inactiveValue: 'FALSE', dictClass: 'string',
activeValue: 'TRUE', isForm: false,
disabled: true, isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
} }
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'Switch', label: '创建时间',
value: requestsettingData.directCreateRecord, field: 'createTime',
componentProps: { formatter: dateFormatter,
inactiveValue: 'FALSE', detail: {
activeValue: 'TRUE', dateFormat: 'YYYY-MM-DD HH:mm:ss'
disabled: true, },
} sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isTable: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isTable: false
} }
}, ])
{ )
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTable: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isTable: false,
}
]))
//表单校验 //表单校验
export const ProductionscrapRequestMainRules = reactive({ export const ProductionscrapRequestMainRules = reactive({

6
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue

@ -43,7 +43,7 @@
<BasicForm <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true" :isOpenSearchTable="true"
fieldTableColumn="productionLineCode" fieldTableColumn="workStationCode"
@success="getList" @success="getList"
:rules="ProductreceiptRequestMainRules" :rules="ProductreceiptRequestMainRules"
:formAllSchemas="ProductreceiptRequestMain.allSchemas" :formAllSchemas="ProductreceiptRequestMain.allSchemas"
@ -220,7 +220,7 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
row['bomVersion'] = res.list[0].version row['bomVersion'] = res.list[0].version
} }
}) })
}else if(formField == 'productionLineCode'){ }else if(formField == 'workStationCode'){
// //
val.forEach(item=>{ val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
@ -627,7 +627,7 @@ const handleImport = () => {
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '制品收货申请主导入模版.xlsx' templateTitle: '隔离报工申请导入模版.xlsx'
}) })
// //

71
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/productreceiptscrapRequestMain.data.ts

@ -134,6 +134,73 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true,
multiple: true,
// isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}],
verificationPage: ProductionlineApi.getProductionlineByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{ {
label: '班组', label: '班组',
field: 'team', field: 'team',
@ -521,6 +588,9 @@ export const ProductreceiptRequestMainRules = reactive({
// shift: [ // shift: [
// { required: true, message: '请选择班次代码', trigger: 'change' } // { required: true, message: '请选择班次代码', trigger: 'change' }
// ], // ],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
dueTime: [ dueTime: [
{ required: true, message: '请选择截止时间', trigger: 'blur' } { required: true, message: '请选择截止时间', trigger: 'blur' }
], ],
@ -552,6 +622,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 150 width: 150
}, },
isTableForm: false,
tableForm:{ tableForm:{
disabled:true, disabled:true,
multiple: true, multiple: true,

7
src/views/wms/productionManage/productredress/productredressJobMain/productredressJobMain.data.ts

@ -240,6 +240,8 @@ export const ProductredressJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '从库区类型范围', label: '从库区类型范围',
field: 'fromAreaTypes', field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
sort: 'custom', sort: 'custom',
isForm:false, isForm:false,
isTable:false, isTable:false,
@ -247,6 +249,7 @@ export const ProductredressJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '到库区类型范围', label: '到库区类型范围',
field: 'toAreaTypes', field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
sort: 'custom', sort: 'custom',
isForm:false, isForm:false,
isTable:false, isTable:false,
@ -358,6 +361,8 @@ export const ProductredressJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '入库库存状态范围', label: '入库库存状态范围',
field: 'inInventoryStatuses', field: 'inInventoryStatuses',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom', sort: 'custom',
isForm:false, isForm:false,
isTable:false, isTable:false,
@ -365,6 +370,8 @@ export const ProductredressJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '出库库存状态范围', label: '出库库存状态范围',
field: 'outInventoryStatuses', field: 'outInventoryStatuses',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom', sort: 'custom',
isForm:false, isForm:false,
isTable:false, isTable:false,

3
src/views/wms/productionManage/productredress/productredressRecordMain/productredressRecordMain.data.ts

@ -143,6 +143,8 @@ export const ProductredressRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
sort: 'custom', sort: 'custom',
isForm:false, isForm:false,
isTable:false isTable:false
@ -249,6 +251,7 @@ export const ProductredressRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '到库区类型范围', label: '到库区类型范围',
field: 'toAreaTypes', field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150

944
src/views/wms/productionManage/productscrap/productscrapJobMain/productscrapJobMain.data.ts

File diff suppressed because it is too large

681
src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts

@ -1,348 +1,397 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import * as InspectionQ3Api from '@/api/qms/inspectionQ3'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data'
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ProductscrapRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ProductscrapRecordMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '单据号', {
field: 'number', label: '单据号',
sort: 'custom', field: 'number',
table: { sort: 'custom',
width: 180, table: {
fixed: 'left' width: 180,
}, fixed: 'left'
isSearch: true },
}, isSearch: true
{ },
label: '申请单号', {
field: 'requestNumber', label: '申请单号',
sort: 'custom', field: 'requestNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isSearch: true },
}, isSearch: true
{ },
label: '状态', {
field: 'status', label: 'Q3通知单号',
dictType: DICT_TYPE.REQUEST_STATUS, field: 'q3Number',
dictClass: 'string', sort: 'custom',
isForm:false, isSearch: false,
isTable: false, isDetail: true,
sort: 'custom', table: {
table: { width: 150
width: 150 },
}, form: {
}, // labelMessage: '信息提示说明!!!',
{ componentProps: {
label: '车间', enterSearch: true,
field: 'workshopCode', // multiple: true,
sort: 'custom', isSearchList: true, // 开启查询弹窗
table: { searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
width: 150 searchField: 'number', // 查询弹窗赋值字段
} searchTitle: 'Q3通知单号', // 查询弹窗标题
}, searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类
{ searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法
label: '生产线', searchCondition: [
field: 'productionLineCode', {
sort: 'custom', key: 'available',
table: { value: 'TRUE',
width: 150 isMainValue: false
} },
}, {
{ key: 'status',
label: '班组', value: '0',
field: 'team', isMainValue: false
sort: 'custom', }
table: { ],
width: 150 verificationParams: [
} {
}, key: 'number',
{ action: '==',
label: '班次', value: '',
field: 'shift', isMainValue: false,
sort: 'custom', isSearch: true,
table: { isFormModel: true
width: 150 }
} ] // 失去焦点校验参数
}, }
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180,
show:false
},
isTable: false,
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
}, {
{ label: '状态',
label: '生效日期', field: 'status',
field: 'activeDate', dictType: DICT_TYPE.REQUEST_STATUS,
formatter: dateFormatter2, dictClass: 'string',
detail: { isForm: false,
dateFormat: 'YYYY-MM-DD' isTable: false,
}, sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
} }
}, },
}, {
{ label: '车间',
label: '申请时间', field: 'workshopCode',
field: 'requestTime', sort: 'custom',
formatter: dateFormatter, table: {
detail: { width: 150
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
}, {
{ label: '生产线',
label: '截止时间', field: 'productionLineCode',
field: 'dueTime', sort: 'custom',
formatter: dateFormatter, table: {
detail: { width: 150
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
}, {
{ label: '班组',
label: '部门', field: 'team',
field: 'departmentCode', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 }
},
isTable: false,
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
}, },
isTable: false, {
}, label: '班次',
{ field: 'shift',
label: '创建者', sort: 'custom',
field: 'creator', table: {
sort: 'custom', width: 150
table: { }
width: 150
}, },
isTable: true, {
}, label: '任务单号',
{ field: 'jobNumber',
label: '创建时间', sort: 'custom',
field: 'createTime', table: {
formatter: dateFormatter, width: 180,
detail: { show: false
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
isTable: false
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
sort: 'custom', {
table: { label: '生效日期',
width: 180 field: 'activeDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x'
}
}
}, },
isTable: true, {
form: { label: '申请时间',
component: 'DatePicker', field: 'requestTime',
componentProps: { formatter: dateFormatter,
type: 'datetime', detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss'
valueFormat: 'x', },
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
}, {
{ label: '截止时间',
label: '最后更新时间', field: 'dueTime',
field: 'updateTime', formatter: dateFormatter,
sort: 'custom', detail: {
isDetail: true, dateFormat: 'YYYY-MM-DD HH:mm:ss'
isForm: false, },
isTable: false, sort: 'custom',
formatter: dateFormatter, table: {
detail: { width: 180
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
table: { {
width: 180 label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
}, },
form: { {
component: 'DatePicker', label: '业务类型',
componentProps: { field: 'businessType',
style: {width:'100%'}, sort: 'custom',
type: 'datetime', table: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', width: 150
valueFormat: 'x', },
isTable: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150,
show: false
}, },
isTable: false, {
}, label: '最后更新时间',
{ field: 'updateTime',
label: '从库区类型范围', sort: 'custom',
field: 'fromAreaTypes', isDetail: true,
dictType: DICT_TYPE.AREA_TYPE, isForm: false,
dictClass: 'string', isTable: false,
isTable: false, formatter: dateFormatter,
sort: 'custom', detail: {
table: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
width: 150 },
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
}, {
{ label: '最后更新者',
label: '从库区代码范围', field: 'updater',
field: 'fromAreaCodes', isDetail: true,
sort: 'custom', isForm: false,
table: { isTable: false,
width: 150 table: {
width: 150
}
}, },
isTable: false, // {
}, // label: '代码',
{ // field: 'code',
label: '是否可用', // sort: 'custom',
field: 'available', // table: {
dictType: DICT_TYPE.TRUE_FALSE, // width: 150
dictClass: 'string', // },
isSearch: true, // },
isTable: false, {
sort: 'custom', label: '从仓库代码',
table: { field: 'fromWarehouseCode',
width: 150 sort: 'custom',
table: {
width: 150,
show: false
},
isTable: false
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
}, },
form: { {
component: 'Switch', label: '从库区代码范围',
value: 'TRUE', field: 'fromAreaCodes',
componentProps: { sort: 'custom',
inactiveValue: 'FALSE', table: {
activeValue: 'TRUE' width: 150
},
isTable: false
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
} }
} }
}, ])
])) )
//表单校验 //表单校验
export const ProductscrapRecordMainRules = reactive({ export const ProductscrapRecordMainRules = reactive({

1043
src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

File diff suppressed because it is too large

1157
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnJobMain/purchasereturnJobMain.data.ts

File diff suppressed because it is too large

780
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/purchasereturnRecordMain.data.ts

@ -1,387 +1,439 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import * as InspectionQ2Api from '@/api/qms/inspectionQ2'
import { Q2 } from '@/views/qms/inspectionQ2/inspectionQ2.data'
/** /**
* @returns {Array} 退 * @returns {Array} 退
*/ */
export const PurchasereturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const PurchasereturnRecordMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '单据号', {
field: 'number', label: '单据号',
sort: 'custom', field: 'number',
table: { sort: 'custom',
width: 180, table: {
fixed: 'left' width: 180,
}, fixed: 'left'
sortTableDefault: 1012, },
sortSearchDefault:1, sortTableDefault: 1012,
isSearch: true sortSearchDefault: 1,
}, isSearch: true
{ },
label: '申请单号', {
field: 'requestNumber', label: '申请单号',
sort: 'custom', field: 'requestNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isTable: false },
}, isTable: false
{ },
label: '任务单号', {
field: 'jobNumber', label: '任务单号',
sort: 'custom', field: 'jobNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isTable: false },
}, isTable: false
{ },
label: '采购收货记录单号', {
field: 'purchaseReceiptRecordNumber', label: '采购收货记录单号',
sort: 'custom', field: 'purchaseReceiptRecordNumber',
table: { sort: 'custom',
width: 180 table: {
}, width: 180
isSearch: true, },
sortTableDefault: 3, isSearch: true,
sortSearchDefault: 5, sortTableDefault: 3,
}, { sortSearchDefault: 5
label: 'qad采购退货记录单号', },
field: 'qadPurchaseReturnRecordCode', {
sort: 'custom', label: 'qad采购退货记录单号',
table: { field: 'qadPurchaseReturnRecordCode',
width: 180 sort: 'custom',
}, table: {
sortSearchDefault:3, width: 180
sortTableDefault: 4, },
isTable: true sortSearchDefault: 3,
}, sortTableDefault: 4,
{ isTable: true
label: '发货单号', },
field: 'asnNumber', {
sort: 'custom', label: '发货单号',
table: { field: 'asnNumber',
width: 180 sort: 'custom',
}, table: {
sortSearchDefault:3, width: 180
isSearch: true, },
sortTableDefault: 2 sortSearchDefault: 3,
}, isSearch: true,
{ sortTableDefault: 2
label: '要货计划单号', },
field: 'ppNumber', {
sort: 'custom', label: '要货计划单号',
table: { field: 'ppNumber',
width: 180 sort: 'custom',
}, table: {
isTable: false width: 180
}, },
{ isTable: false
label: '供应商代码', },
field: 'supplierCode', {
sort: 'custom', label: 'Q2通知单号',
table: { field: 'q2Number',
width: 150 sort: 'custom',
}, isSearch: false,
sortTableDefault: 1, isDetail: true,
sortSearchDefault:2, sortTableDefault: 4,
isSearch: true table: {
}, width: 150
{ },
label: '从月台代码', form: {
field: 'fromDockCode', // labelMessage: '信息提示说明!!!',
sort: 'custom', componentProps: {
table: { enterSearch: true,
width: 150 // multiple: true,
}, isSearchList: true, // 开启查询弹窗
isTable: false searchListPlaceholder: '请选择Q2通知单号', // 输入框占位文本
}, searchField: 'number', // 查询弹窗赋值字段
{ searchTitle: 'Q2通知单号', // 查询弹窗标题
label: '承运商', searchAllSchemas: Q2.allSchemas, // 查询弹窗所需类
field: 'carrierCode', searchPage: InspectionQ2Api.getQ2Page, // 查询弹窗所需分页方法
sort: 'custom', searchCondition: [
table: { {
width: 150 key: 'available',
}, value: 'TRUE',
isTable: false isMainValue: false
}, },
{ {
label: '运输方式', key: 'status',
field: 'transferMode', value: '0',
sort: 'custom', isMainValue: false
table: { }
width: 150 ],
}, verificationParams: [
isTable: false {
}, key: 'number',
{ action: '==',
label: '车牌号', value: '',
field: 'vehiclePlateNumber', isMainValue: false,
sort: 'custom', isSearch: true,
table: { isFormModel: true
width: 150 }
}, ] // 失去焦点校验参数
isTable: false }
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
}, {
{ label: '供应商代码',
label: '生效日期', field: 'supplierCode',
field: 'activeDate', sort: 'custom',
formatter: dateFormatter2, table: {
detail: { width: 150
dateFormat: 'YYYY-MM-DD' },
}, sortTableDefault: 1,
sort: 'custom', sortSearchDefault: 2,
table: { isSearch: true
width: 180 },
}, {
isTable: false, label: '从月台代码',
form: { field: 'fromDockCode',
component: 'DatePicker', sort: 'custom',
componentProps: { table: {
style: {width: '100%'}, width: 150
type: 'date', },
dateFormat: 'YYYY-MM-DD', isTable: false
valueFormat: 'x', },
{
label: '承运商',
field: 'carrierCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '运输方式',
field: 'transferMode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '车牌号',
field: 'vehiclePlateNumber',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
} }
}, },
}, {
{ label: '到库区类型范围',
label: '申请时间', field: 'toAreaTypes',
field: 'requestTime', dictType: DICT_TYPE.AREA_TYPE,
formatter: dateFormatter, dictClass: 'string',
detail: { isTable: false,
dateFormat: 'YYYY-MM-DD HH:mm:ss' sort: 'custom',
}, table: {
sort: 'custom', width: 150
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
}, {
{ label: '从库区代码范围',
label: '截止时间', field: 'fromAreaCodes',
field: 'dueTime', sort: 'custom',
formatter: dateFormatter, table: {
detail: { width: 150
dateFormat: 'YYYY-MM-DD HH:mm:ss' },
}, isTable: false
sort: 'custom', },
table: { {
width: 180 label: '到库区代码范围',
}, field: 'toAreaCodes',
isTable: false, sort: 'custom',
form: { table: {
component: 'DatePicker', width: 150
componentProps: { },
type: 'datetime', isTable: false
dateFormat: 'YYYY-MM-DD HH:mm:ss', },
valueFormat: 'x', {
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
}, {
{ label: '生效日期',
label: '部门', field: 'activeDate',
field: 'departmentCode', formatter: dateFormatter2,
sort: 'custom', detail: {
table: { dateFormat: 'YYYY-MM-DD'
width: 150 },
}, sort: 'custom',
isTable: false, table: {
}, width: 180
// { },
// label: '代码', isTable: false,
// field: 'code', form: {
// sort: 'custom', component: 'DatePicker',
// table: { componentProps: {
// width: 150 style: { width: '100%' },
// }, type: 'date',
// }, dateFormat: 'YYYY-MM-DD',
{ valueFormat: 'x'
label: '接口类型', }
field: 'interfaceType', }
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}, },
}, {
// { label: '申请时间',
// label: '原因', field: 'requestTime',
// field: 'available', formatter: dateFormatter,
// sort: 'custom', detail: {
// table: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
// width: 150 },
// }, sort: 'custom',
// isTable: true, table: {
// }, width: 180
{ },
label: '创建时间', isTable: false,
field: 'createTime', form: {
formatter: dateFormatter, component: 'DatePicker',
detail: { componentProps: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
sort: 'custom', {
table: { label: '截止时间',
width: 180 field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
isTable: true, {
form: { label: '部门',
component: 'DatePicker', field: 'departmentCode',
componentProps: { sort: 'custom',
type: 'datetime', table: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', width: 150
valueFormat: 'x', },
isTable: false
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
} }
}, },
}, {
{ label: '业务类型',
label: '创建者', field: 'businessType',
field: 'creator', sort: 'custom',
sort: 'custom', table: {
table: { width: 150
width: 150 },
isTable: false
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
}, },
isTable: false, // {
}, // label: '原因',
{ // field: 'available',
label: '操作', // sort: 'custom',
field: 'action', // table: {
isDetail: false, // width: 150
isForm: false, // },
table: { // isTable: true,
width: 150, // },
fixed: 'right' {
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}, },
} {
])) label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)
//表单校验 //表单校验
export const PurchasereturnRecordMainRules = reactive({ export const PurchasereturnRecordMainRules = reactive({

1207
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

File diff suppressed because it is too large

3
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -577,6 +577,9 @@ const handleImport = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type : string, row ?: number) => { const openForm = async (type : string, row ?: number) => {
// :
SupplierinvoiceRequestDetail.allSchemas.tableFormColumns = SupplierinvoiceRequestDetail.allSchemas.tableFormColumns.filter(item=>item.field!='contractAmountTotal'&&item.field!='purchaseAmontTotal'&&item.field!='differencePriceTotal')
if(type=='update'){ if(type=='update'){
// //
SupplierinvoiceRequestMain.allSchemas.formSchema.forEach((item) => { SupplierinvoiceRequestMain.allSchemas.formSchema.forEach((item) => {

108
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -1240,8 +1240,9 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
isDetail: true, isDetail: true,
}, },
{ {
label: '', label: '系统采购价格',
field: '', field: 'purchaseAmountTotalMain',
formatter: accountantFormart,
sortTableDefault: 6, sortTableDefault: 6,
isForm: false, isForm: false,
isTable: false, isTable: false,
@ -1271,8 +1272,9 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
isDetail: true, isDetail: true,
}, },
{ {
label: '', label: '总价差',
field: '', field: 'differencePriceTotalMain',
formatter: accountantFormart,
sortTableDefault: 6, sortTableDefault: 6,
isForm: false, isForm: false,
isTable: false, isTable: false,
@ -1367,7 +1369,7 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
isDetail: true, isDetail: true,
}, },
{ {
label: '差', label: '差',
field: '', field: '',
sortTableDefault: 6, sortTableDefault: 6,
isForm: false, isForm: false,
@ -1468,35 +1470,6 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
isSearch: false, isSearch: false,
isDetail: true, isDetail: true,
}, },
// {
// label: '总价差',
// field: 'differencePriceTotal',
// formatter: accountantFormart,
// sortTableDefault: 6,
// isForm: false,
// isTable: false,
// isSearch: false,
// isDetail: true,
// },
// {
// label: '采购金额',
// field: 'purchaseAmontTotal',
// formatter: accountantFormart,
// sortTableDefault: 6,
// isForm: false,
// isTable: false,
// isSearch: false,
// isDetail: true,
// },
// {
// label: '',
// field: '',
// sortTableDefault: 6,
// isForm: false,
// isTable: false,
// isSearch: false,
// isDetail: true,
// },
])) ]))
@ -1753,6 +1726,39 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
precision: 5, precision: 5,
} }
}, },
{
label: '合同金额',
field: 'contractAmountTotal',
table: {
width: 150
},
isForm:false,
tableForm:{
disabled: true
}
},
{
label: '采购金额',
field: 'purchaseAmontTotal',
table: {
width: 150
},
isForm:false,
tableForm:{
disabled: true
}
},
{
label: '总差额',
field: 'differencePriceTotal',
table: {
width: 150
},
isForm:false,
tableForm:{
disabled: true
}
},
{ {
label: '单价差额', label: '单价差额',
field: 'differencePrice', field: 'differencePrice',
@ -2047,39 +2053,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 150 width: 150
}, },
}, },
// {
// label: '合同金额',
// field: 'contractAmountTotal',
// table: {
// width: 150
// },
// isForm:false,
// tableForm:{
// disabled: true
// }
// },
// {
// label: '采购金额',
// field: 'purchaseAmontTotal',
// table: {
// width: 150
// },
// isForm:false,
// tableForm:{
// disabled: true
// }
// },
// {
// label: '总差额',
// field: 'differencePriceTotal',
// table: {
// width: 150
// },
// isForm:false,
// tableForm:{
// disabled: true
// }
// },
{ {
label: '操作', label: '操作',

Loading…
Cancel
Save