Browse Source

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

# Conflicts:
#	src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts
hella_online_20240816
zhaoxuebing 3 months ago
parent
commit
af06ea8bad
  1. 73
      src/api/qms/inspectionQ3/index.ts
  2. 64
      src/api/qms/inspectionQ3/inspectionQ3Detail/index.ts
  3. 65
      src/api/qms/inspectionQ3/inspectionQ3Main/index.ts
  4. 16
      src/api/wms/bomDismantle/index.ts
  5. 9
      src/api/wms/purchaseDetail/index.ts
  6. 9
      src/api/wms/purchasereturnRequestDetail/index.ts
  7. 438
      src/views/qms/inspectionQ3/index.vue
  8. 448
      src/views/qms/inspectionQ3/inspectionQ3.data.ts
  9. 43
      src/views/qms/inspectionRecord/index.vue
  10. 49
      src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts
  11. 50
      src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts
  12. 192
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts
  13. 93
      src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts
  14. 97
      src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts
  15. 9
      src/views/wms/productionManage/productreceipt/productreceiptRecordMain/productreceiptRecordMain.data.ts
  16. 9
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/productreceiptAssembleRecordMain.data.ts
  17. 2
      src/views/wms/productionManage/productredress/productredressRequestMain/index.vue
  18. 111
      src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts
  19. 93
      src/views/wms/productionManage/productscrap/productscrapJobMain/productscrapJobMain.data.ts
  20. 97
      src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts
  21. 37
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue
  22. 97
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts
  23. 121
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts
  24. 1
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  25. 15
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue
  26. 24
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts
  27. 62
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  28. 175
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMain.data.ts

73
src/api/qms/inspectionQ3/index.ts

@ -1,73 +0,0 @@
import request from '@/config/axios'
export interface Q3VO {
id: number
number: string
q1Number: string
itemCode: string
qty: number
code: string
uom: string
desc: string
defectLocation: string
defectType: string
problemReason: string
priority: number
responUser: string
amount: number
costCode: string
handleTime: Date
status: string
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询Q3通知单列表
export const getQ3Page = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/qms/inspectionQ3/senior', data })
} else {
return await request.get({ url: `/qms/inspectionQ3/page`, params })
}
}
// 查询Q3通知单详情
export const getQ3 = async (id: number) => {
return await request.get({ url: `/qms/inspectionQ3/get?id=` + id })
}
// 新增Q3通知单
export const createQ3 = async (data: Q3VO) => {
return await request.post({ url: `/qms/inspectionQ3/create`, data })
}
// 修改Q3通知单
export const updateQ3 = async (data: Q3VO) => {
return await request.put({ url: `/qms/inspectionQ3/update`, data })
}
// 删除Q3通知单
export const deleteQ3 = async (id: number) => {
return await request.delete({ url: `/qms/inspectionQ3/delete?id=` + id })
}
// 导出Q3通知单 Excel
export const exportQ3 = async (params) => {
return await request.download({ url: `/qms/inspectionQ3/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/inspectionQ3/get-import-template' })
}
// 完成
export const finishQ3 = async (id: number) => {
return await request.get({ url: `/qms/inspectionQ3/finish?id=` + id })
}

64
src/api/qms/inspectionQ3/inspectionQ3Detail/index.ts

@ -0,0 +1,64 @@
import request from '@/config/axios'
export interface InspectionQ3DetailVO {
id: number
masterId: number
number: string
itemCode: string
qty: number
uom: string
price: number
amount: number
costCode: string
defectCode: string
defectLocation: string
defectType: string
problemReason: string
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询Q3通知单子列表
export const getInspectionQ3DetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/qms/inspection-Q3-detail/senior', data })
} else {
return await request.get({ url: `/qms/inspection-Q3-detail/page`, params })
}
}
// 查询Q3通知单子详情
export const getInspectionQ3Detail = async (id: number) => {
return await request.get({ url: `/qms/inspection-Q3-detail/get?id=` + id })
}
// 新增Q3通知单子
export const createInspectionQ3Detail = async (data: InspectionQ3DetailVO) => {
return await request.post({ url: `/qms/inspection-Q3-detail/create`, data })
}
// 修改Q3通知单子
export const updateInspectionQ3Detail = async (data: InspectionQ3DetailVO) => {
return await request.put({ url: `/qms/inspection-Q3-detail/update`, data })
}
// 删除Q3通知单子
export const deleteInspectionQ3Detail = async (id: number) => {
return await request.delete({ url: `/qms/inspection-Q3-detail/delete?id=` + id })
}
// 导出Q3通知单子 Excel
export const exportInspectionQ3Detail = async (params) => {
return await request.download({ url: `/qms/inspection-Q3-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-Q3-detail/get-import-template' })
}

65
src/api/qms/inspectionQ3/inspectionQ3Main/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface InspectionQ3MainVO {
id: number
number: string
q1Number: string
responUser: string
priority: string
handleTime: Date
summaryAmount: number
desc: string
status: string
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询Q3通知单主列表
export const getInspectionQ3MainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/qms/inspection-Q3-main/senior', data })
} else {
return await request.get({ url: `/qms/inspection-Q3-main/page`, params })
}
}
// 查询Q3通知单主详情
export const getInspectionQ3Main = async (id: number) => {
return await request.get({ url: `/qms/inspection-Q3-main/get?id=` + id })
}
// 新增Q3通知单主
export const createInspectionQ3Main = async (data: InspectionQ3MainVO) => {
return await request.post({ url: `/qms/inspection-Q3-main/create`, data })
}
// 修改Q3通知单主
export const updateInspectionQ3Main = async (data: InspectionQ3MainVO) => {
return await request.put({ url: `/qms/inspection-Q3-main/update`, data })
}
// 删除Q3通知单主
export const deleteInspectionQ3Main = async (id: number) => {
return await request.delete({ url: `/qms/inspection-Q3-main/delete?id=` + id })
}
// 导出Q3通知单主 Excel
export const exportInspectionQ3Main = async (params) => {
return await request.download({ url: `/qms/inspection-Q3-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-Q3-main/get-import-template' })
}
// 完成
export const finishInspectionQ3Main = async (id: number) => {
return await request.get({ url: `/qms/inspection-Q3-main/finish?id=` + id })
}

16
src/api/wms/bomDismantle/index.ts

@ -15,6 +15,22 @@ export const getProductscrapBomDismantlePage = async (params) => {
return await request.get({ url: `/wms/productscrap-request-main/bomPage`, params }) return await request.get({ url: `/wms/productscrap-request-main/bomPage`, params })
} }
export const getProductscrapBomRecordPage = async (params1) => {
console.log('getProductscrapBomRecordPage',params1)
let params = {...params1}
if(params.isRecord){
delete params.isRecord
return await request.get({ url: `/wms/productscrap-request-main/bomRecordPage`, params })
}else{
delete params.isRecord
return await request.get({ url: `/wms/productscrap-request-main/bomPage`, params })
}
}
// 查询制品报废申请子列表 // 查询制品报废申请子列表
export const getProductscrapBomDismantleRecordPage = async (params) => { export const getProductscrapBomDismantleRecordPage = async (params) => {
return await request.get({ url: `/wms/productscrap-record-main/bomPage`, params }) return await request.get({ url: `/wms/productscrap-record-main/bomPage`, params })

9
src/api/wms/purchaseDetail/index.ts

@ -55,6 +55,15 @@ export const getPurchaseDetailPageWMS = async (params) => {
} }
} }
export const getPurchaseDetailPageWMSTypeM = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchase-detail/seniorM', data })
} else {
return await request.get({ url: `/wms/purchase-detail/pageM`, params })
}
}
// 查询采购订单子列表 // 查询采购订单子列表
export const getPurchaseDetailPageWMSSpare = async (params) => { export const getPurchaseDetailPageWMSSpare = async (params) => {

9
src/api/wms/purchasereturnRequestDetail/index.ts

@ -37,7 +37,14 @@ export const getPurchasereturnRequestDetailPage = async (params) => {
return await request.get({ url: `/wms/purchasereturn-request-detail/page`, params }) return await request.get({ url: `/wms/purchasereturn-request-detail/page`, params })
} }
} }
// 物料供应商查询
export const getPurchasereturnSupplierByCode = async (params) => {
return await request.get({ url: `/wms/supplieritem/querySupplierByCode`, params })
}
// 收货明细查询
export const getPurchasereturnPurchasereceiptRecordByItemCode = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/queryPurchasereceiptRecordByItemCode`, params })
}
// 查询采购退货申请子列表 // 查询采购退货申请子列表
export const getPurchasereturnRequestDetailPageSpare = async (params) => { export const getPurchasereturnRequestDetailPageSpare = async (params) => {

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

@ -2,7 +2,10 @@
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search <Search
:schema="Q3.allSchemas.searchSchema" :schema="[
...InspectionQ3Main.allSchemas.searchSchema,
...InspectionQ3Detail.allSchemas.searchSchema
]"
@search="setSearchParams" @search="setSearchParams"
@reset="setSearchParams" @reset="setSearchParams"
/> />
@ -15,12 +18,14 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Q3.allSchemas" :allSchemas="InspectionQ3Main.allSchemas"
:detailAllSchemas="InspectionQ3Detail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -32,13 +37,13 @@
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, $index }">
<ButtonBase <ButtonBase
:Butttondata="butttondata(row)" :Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)" @button-base-click="buttonTableClick($event, row)"
/> />
</template> </template>
@ -47,45 +52,75 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="basicFormRef" ref="formRef"
@success="formsSuccess" :isOpenSearchTable="true"
:rules="Q3Rules" fieldTableColumn="itemCode"
:formAllSchemas="Q3.allSchemas" @success="getList"
:apiUpdate="Q3Api.updateQ3" :rules="InspectionQ3MainRules"
:apiCreate="Q3Api.createQ3" :formAllSchemas="InspectionQ3Main.allSchemas"
:tableAllSchemas="InspectionQ3Detail.allSchemas"
:tableFormRules="InspectionQ3DetailRules"
:tableData="tableData"
:apiUpdate="InspectionQ3MainApi.updateInspectionQ3Main"
:apiCreate="InspectionQ3MainApi.createInspectionQ3Main"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" @submitForm="submitForm"
@onChange="onChange" @inputNumberChange="inputNumberChange"
/> :sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
tableData.forEach((item) => {
item.qty = item.countQty * item.packQty
})
}
"
>
<!-- <template #default="{row}">
<el-input-number disabled v-model="row.qty"></el-input-number>
</template> -->
</BasicForm>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q3.allSchemas" /> <Detail
ref="detailRef"
<!-- 导入 --> :isBasic="false"
<ImportForm :allSchemas="InspectionQ3Main.allSchemas"
ref="importFormRef" :detailAllSchemas="InspectionQ3Detail.allSchemas"
url="/basic/Q3/import" :detailAllSchemasRules="InspectionQ3DetailRules"
:importTemplateData="importTemplateData" :apiCreate="InspectionQ3DetailApi.createInspectionQ3Detail"
@success="importSuccess" :apiUpdate="InspectionQ3DetailApi.updateInspectionQ3Detail"
:apiPage="InspectionQ3DetailApi.getInspectionQ3DetailPage"
:apiDelete="InspectionQ3DetailApi.deleteInspectionQ3Detail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailValidate="detailValidate"
/> />
</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 { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as Q3Api from '@/api/qms/inspectionQ3' import {
InspectionQ3Main,
InspectionQ3MainRules,
InspectionQ3Detail,
InspectionQ3DetailRules
} from './inspectionQ3.data'
import * as InspectionQ3MainApi from '@/api/qms/inspectionQ3/inspectionQ3Main'
import * as InspectionQ3DetailApi from '@/api/qms/inspectionQ3/inspectionQ3Detail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import * as StdcostpriceApi from '@/api/wms/stdcostprice' import * as StdcostpriceApi from '@/api/wms/stdcostprice'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { async } from '@antv/x6/lib/registry/marker/async'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
defineOptions({ name: 'InspectionQ3' }) //
defineOptions({ name: 'InspectionQ3Main' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -93,74 +128,145 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(Q3.allSchemas.tableColumns) const tableColumns = ref([
...InspectionQ3Main.allSchemas.tableColumns,
...InspectionQ3Detail.allSchemas.tableMainColumns
])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
// //
const priceObj = ref() const priceObj = ref()
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => { nextTick(async () => {
const setV = {} const setV = {}
if (type == 'tableForm') {
//
if (formField == 'itemCode') { if (formField == 'itemCode') {
console.log(val) // val.forEach(item=>{
setV['uom'] = val[0]['uom']
console.log(formRef.formModel.qty) // })
// let res = await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[0].code) const index1 = 0
ProductionlineitemApi.selectItemCodeToProductionLineCode(val[0].code).then((res) => { setTableFormsValues(val, index1)
console.log(res)
if (res?.length > 0) { // row['uom'] = val[0]['uom']
formRef.formModel.defectLocation = res[0].productionLineCode // console.log(formRef.formModel.qty)
Q3.allSchemas.formSchema.forEach(item=>{ // // let res = await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[0].code)
if (item.field == 'defectLocation') { // ProductionlineitemApi.selectItemCodeToProductionLineCode(val[0].code).then((res) => {
item.componentProps.options = res // console.log(res)
// if (res?.length > 0) {
// formRef.formModel.defectLocation = res[0].productionLineCode
// InspectionQ3Detail.allSchemas.formSchema.forEach(item=>{
// if (item.field == 'defectLocation') {
// item.componentProps.options = res
// }
// })
// }
// })
// const params = {
// by: "ASC",
// filters: [{column: "itemCode", action: "==", value: val[0].code}],
// pageNo: 1,
// pageSize: 500,
// sort: ""
// }
// params.isSearch = true
// StdcostpriceApi.getStdcostpricePage(params).then((res) => {
// if (res.list?.length > 0) {
// priceObj.value = res.list[0]
// formRef.setValues({
// amount: (parseFloat(formRef.formModel.qty) * parseFloat(priceObj.value.price)).toFixed(6)
// })
// }
// })
} }
if (formField == 'costCode') {
console.log(11111)
row['costCode'] = val[0]['costcentreCode']
}
if (formField == 'q1Number') {
//Q1
let list = []
val.forEach((item) => {
list.push(item[searchField])
}) })
setV[formField] = list.join(',')
formRef.setValues(setV)
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
} }
}) })
}
const setTableFormsValues = async (val, index1) => {
if (index1 <= val.length - 1) {
let tableForm = JSON.parse(JSON.stringify(tableFormKeys))
if (tableData.value.find((item1) => item1['itemCode'] == val[index1]['itemCode'])) return
const newRow = JSON.parse(JSON.stringify({ ...tableForm, ...val[index1] }))
newRow['itemCode'] = val[index1]['itemCode']
newRow['uom'] = val[index1]['uom']
newRow['qty'] = 0
newRow.defectLocation = val[index1]['productionLineCode']
await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[index1].itemCode).then(
(res) => {
console.log(res)
if (res?.length > 0) {
newRow.defectLocationInitOptions = res
}
}
)
const params = { const params = {
by: "ASC", by: 'ASC',
filters: [{column: "itemCode", action: "==", value: val[0].code}], filters: [{ column: 'itemCode', action: '==', value: val[index1].itemCode }],
pageNo: 1, pageNo: 1,
pageSize: 500, pageSize: 500,
sort: "" sort: ''
} }
params.isSearch = true params.isSearch = true
StdcostpriceApi.getStdcostpricePage(params).then((res) => { await StdcostpriceApi.getStdcostpricePage(params).then((res) => {
if (res.list?.length > 0) { if (res.list?.length > 0) {
priceObj.value = res.list[0] priceObj.value = res.list[0]
formRef.setValues({ newRow['price'] = parseFloat(priceObj.value.price)
amount: (parseFloat(formRef.formModel.qty) * parseFloat(priceObj.value.price)).toFixed(6) newRow['amount']=(parseFloat(newRow['qty']) * parseFloat(priceObj.value.price)).toFixed(6)
}
}) })
tableData.value.push(newRow)
index1++
setTableFormsValues(val, index1)
} }
}
}) const inputNumberChange = (field, index, row, val) => {
if (field == 'qty') {
row.amount = (parseFloat(row['qty']) * parseFloat(row.price)).toFixed(6)
} }
if (formField == 'q1Number') { formRef.value.formRef.formModel.summaryAmount =0
//Q1 tableData.value.forEach(item=>{
let list = [] formRef.value.formRef.formModel.summaryAmount += parseFloat(item.amount)
val.forEach((item) => {
list.push(item[searchField])
}) })
setV[formField] = list.join(',') }
formRef.setValues(setV) //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if (formField == 'itemCode') {
setV['itemCode'] = val[0]['code']
setV['uom'] = val[0]['uom']
} else { } else {
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV)
} }
formRef.setValues(setV)
}) })
} }
const onChange =(field,e)=>{
if (field == 'qty') {
basicFormRef.value.formRef.formModel.amount = (parseFloat( basicFormRef.value.formRef.formModel.qty) * parseFloat( priceObj.value.price)).toFixed(6)
}
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: Q3Api.getQ3Page // getListApi: InspectionQ3DetailApi.getInspectionQ3DetailPage //
}) })
// //
@ -168,20 +274,11 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'qms:Q3:create' }), // defaultButtons.defaultAddBtn({ hasPermi: 'qms:inspection-Q3-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'qms:Q3:import' }), // defaultButtons.defaultExportBtn({ hasPermi: 'qms:inspection-Q3-main: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: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
// //
@ -189,9 +286,6 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') { if (val == 'add') {
// //
openForm('create') openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { } else if (val == 'export') {
// //
handleExport() handleExport()
@ -206,6 +300,7 @@ const buttonBaseClick = (val, 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
@ -215,19 +310,25 @@ const isShowMainButton = (row, val) => {
} }
// - // -
const butttondata = (row) => { const butttondata = (row, $index) => {
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
return [ return [
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0']), hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:update' hasPermi: 'qms:inspection-Q3-main:update'
}), // }), //
defaultButtons.mainListDeleteBtn({ defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['0']), hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:delete' hasPermi: 'qms:inspection-Q3-main:delete'
}), // }), //
defaultButtons.mainListFinishBtn({ defaultButtons.mainListFinishBtn({
hide: isShowMainButton(row, ['0']), hide: isShowMainButton(row, ['0']),
hasPermi: 'qms:Q3:finish' hasPermi: 'qms:inspection-Q3-main:finish'
}) // }) //
] ]
} }
@ -239,16 +340,16 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.masterId)
} else if (val == 'finish') { } else if (val == 'finish') {
// //
handleFinish(row.id) handleFinish(row.masterId)
} }
} }
const handleFinish = async (id: number) => { const handleFinish = async (id: number) => {
try { try {
await Q3Api.finishQ3(id) await InspectionQ3MainApi.finishInspectionQ3Main(id)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
// //
await getList() await getList()
@ -256,12 +357,12 @@ const handleFinish = async (id: number) => {
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const formRef = ref()
const openForm = (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
basicFormRef.value.open(type, row) formRef.value.open(type, row)
if (type == 'create') { if (type == 'create') {
nextTick(() => { nextTick(() => {
basicFormRef.value.formRef.setValues({ formRef.value.formRef.setValues({
handleTime: new Date().getTime(), handleTime: new Date().getTime(),
priority: '3' priority: '3'
}) })
@ -269,50 +370,16 @@ const openForm = (type: string, row?: any) => {
} }
} }
// form //
const formsSuccess = async (formType, data) => { const { wsCache } = useCache()
data.responUser = userStore.getUser.id
var isHave = Q3.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return
}
}
if (data.qty == 0) {
message.error('数量不能为0')
return
}
if (data.amount == 0) {
message.error('金额不能为0')
return
}
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
try {
basicFormRef.value.formLoading = true
if (formType === 'create') {
await Q3Api.createQ3(data)
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
}
}
/** 详情操作 */ /** 详情操作 */
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, 'basicQ3') const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'inspectionQ3Main')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -320,11 +387,13 @@ const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
tableObject.loading = true
// //
await Q3Api.deleteQ3(id) await InspectionQ3MainApi.deleteInspectionQ3Main(id)
tableObject.loading = false
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() buttonBaseClick('refresh', null)
} catch {} } catch {}
} }
@ -336,25 +405,113 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const excelTitle = ref(route.meta.title) const data = await InspectionQ3MainApi.exportInspectionQ3Main(tableObject.params)
const data = await Q3Api.exportQ3(tableObject.params) download.excel(data, `${route.meta.title}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
} }
} }
/**
* tableForm方法
*/
const tableFormKeys = {}
InspectionQ3Detail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
// 线
let tableForm = JSON.parse(JSON.stringify(tableFormKeys))
if (tableData.value.length > 0) {
// tableForm.productionLineCode = tableData.value[0].productionLineCode
// tableForm.workStationCode = tableData.value[0].workStationCode
}
tableData.value.push(tableForm)
}
//
const handleDeleteTable = (item, index) => {
let itemIndex = tableData.value.indexOf(item)
if (itemIndex > -1) {
tableData.value.splice(itemIndex, 1)
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter((item) => !selection.includes(item))
}
//
const submitForm = async (formType, submitData) => {
let data = { ...submitData }
if (data.masterId) {
data.id = data.masterId
}
data.responUser = userStore.getUser.nickname
data.subList = tableData.value //
if (tableData.value.find((item) => item.qty <= 0)) {
message.warning('数量必须大于0')
formRef.value.formLoading = false
return
}
// 线
// if (tableData.value.length > 0) {
// let productionLineCode = tableData.value[0].productionLineCode
// let workStationCode = tableData.value[0].workStationCode
// for(var i=0;i<tableData.value.length;i++) {
// if(productionLineCode !== tableData.value[i].productionLineCode){
// message.warning('线')
// formRef.value.formLoading = false
// return;
// }
// if(workStationCode !== tableData.value[i].workStationCode){
// message.warning('')
// formRef.value.formLoading = false
// return;
// }
// }
// }
formRef.value.formLoading = true
try {
if (formType === 'create') {
await InspectionQ3MainApi.createInspectionQ3Main(data)
message.success(t('common.createSuccess'))
} else {
await InspectionQ3MainApi.updateInspectionQ3Main(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
} else {
buttonBaseClick('refresh', null)
}
} finally {
formRef.value.formLoading = false
}
}
// /
const detailValidate = async (data) => {
// let rs = false
// TODO: /线
return true
}
/** 导入 */ /** 导入 */
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: `${route.meta.title}】导入模版.xlsx` templateTitle: `${route.meta.title}】导入模版.xlsx`
}) })
// //
const importSuccess = () => { const importSuccess = () => {
getList() getList()
@ -372,6 +529,5 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await Q3Api.importTemplate()
}) })
</script> </script>

448
src/views/qms/inspectionQ3/inspectionQ3.data.ts

@ -4,39 +4,38 @@ import { dateFormatter } from '@/utils/formatTime'
import * as InspectionQ1Api from '@/api/qms/inspectionQ1' import * as InspectionQ1Api from '@/api/qms/inspectionQ1'
import { Q1 } from '@/views/qms/inspectionQ1/inspectionQ1.data' import { Q1 } from '@/views/qms/inspectionQ1/inspectionQ1.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
import * as QadCostcentreApi from '@/api/wms/qadCostcentre' import * as QadCostcentreApi from '@/api/wms/qadCostcentre'
import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data' import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data'
import * as ItembasicApi from '@/api/wms/itembasic' const { t } = useI18n() // 国际化
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'IssueRequest'
}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
import { fa } from 'element-plus/es/locale'
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray: any = [userDept]
// 表单校验 /**
export const Q3Rules = reactive({ * @returns {Array}
number: [required], */
itemCode: [required], export const InspectionQ3Main = useCrudSchemas(
qty: [required],
code: [required],
defectLocation: [required],
defectType: [
{ required: true, message: '缺陷类型不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
problemReason: [
{ required: true, message: '问题原因不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
priority: [required],
amount: [required],
costCode: [required],
handleTime: [required],
available: [required],
concurrencyStamp: [required]
})
export const Q3 = useCrudSchemas(
reactive<CrudSchema[]>([ reactive<CrudSchema[]>([
{ {
label: '通知单号', label: '通知单号',
@ -53,6 +52,7 @@ export const Q3 = useCrudSchemas(
label: 'Q1通知单号', label: 'Q1通知单号',
field: 'q1Number', field: 'q1Number',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -90,8 +90,87 @@ export const Q3 = useCrudSchemas(
} }
] // 失去焦点校验参数 ] // 失去焦点校验参数
} }
}
}, },
isSearch: true {
label: '负责用户',
field: 'responUser',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
form: {
componentProps: {
value: userStore.getUser.nickname,
disabled: true
}
}
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY,
dictClass: 'string',
isSearch: false,
isTable: true,
tableForm: {
type: 'Select'
}
},
{
label: '处理时间',
field: 'handleTime',
isSearch: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '汇总金额',
field: 'summaryAmount',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
disabled: true
}
}
},
{
label: '描述',
field: 'desc',
sort: 'custom',
isSearch: false,
table: {
width: '150'
},
form: {
component: 'Input',
componentProps: {
type: 'textarea'
}
}
}, },
{ {
label: '状态', label: '状态',
@ -99,8 +178,8 @@ export const Q3 = useCrudSchemas(
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.PUBLISHE_STATUS, dictType: DICT_TYPE.PUBLISHE_STATUS,
dictClass: 'string', dictClass: 'string',
isForm: false,
isSearch: false, isSearch: false,
isForm: false,
tableForm: { tableForm: {
type: 'Select', type: 'Select',
disabled: true disabled: true
@ -112,21 +191,96 @@ export const Q3 = useCrudSchemas(
} }
}, },
{ {
label: '物料代码', label: '是否可用',
field: 'itemCode', field: 'available',
sort: 'custom', sort: 'custom',
isSearch: false,
isForm: false,
isTable: false,
isDetail: false
},
{
label: '创建时间',
field: 'createTime',
isTable: true,
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isSearch: true, isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 230,
fixed: 'right'
}
}
])
)
export const InspectionQ3MainRules = reactive({
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
handleTime: [{ required: true, message: '请选择处理时间', trigger: 'change' }],
desc: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }]
})
/**
* @returns {Array}
*/
export const InspectionQ3Detail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '通知单号',
field: 'number',
sort: 'custom',
isSearch: false,
isTable: false,
isTableForm: false
},
{
label: '物料号',
field: 'itemCode',
sort: 'custom',
isTable: true,
isDetail: true,
isSearch: false,
table: { table: {
width: 150 width: 150
}, },
tableForm: { tableForm: {
enterSearch: true, isInpuFocusShow: false,
isInpuFocusShow: true, disabled: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题 searchTitle: '物料信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [ searchCondition: [
{ {
key: 'available', key: 'available',
@ -134,6 +288,8 @@ export const Q3 = useCrudSchemas(
isMainValue: false isMainValue: false
} }
], ],
isShowTableFormSearch: true, //tableForm下方是否出现输入框
isRepeat: true, //tableForm下方输入框是否可以重复添加该条数据
verificationParams: [ verificationParams: [
{ {
key: 'code', key: 'code',
@ -179,18 +335,14 @@ export const Q3 = useCrudSchemas(
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isTable: true,
isSearch: false, isSearch: false,
table: { isTable: true,
width: 150
}, tableForm: {
form: { type: 'InputNumber',
component: 'InputNumber',
componentProps: {
min: 0, min: 0,
precision: 2 precision: 2
} }
}
}, },
{ {
label: '单位', label: '单位',
@ -211,86 +363,16 @@ export const Q3 = useCrudSchemas(
} }
}, },
{ {
label: '编码', label: '单价',
field: 'code', field: 'price',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.QMS_Q3_CODE,
dictClass: 'string',
isSearch: true,
isTable: true, isTable: true,
tableForm: {
type: 'Select'
}
},
{
label: '缺陷位置',
field: 'defectLocation',
sort: 'custom',
dictClass: 'string',
isSearch: false, isSearch: false,
isTable: false,
form: {
component: 'Select',
componentProps: {
options: [],
optionsAlias: {
labelField: 'productionLineName',
valueField: 'productionLineCode'
},
filterable: true,
}
}
},
{
label: '缺陷类型',
field: 'defectType',
sort: 'custom',
isSearch: false,
isTable: false,
table: {
width: '150'
},
form: {
component: 'Input'
}
},
{
label: '问题原因',
field: 'problemReason',
sort: 'custom',
isSearch: false,
isTable: false,
table: {
width: '150'
},
form: {
component: 'Input'
}
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY,
dictClass: 'string',
isSearch: false,
isTable: false,
tableForm: { tableForm: {
type: 'Select' disabled: true
}
},
{
label: '负责用户',
field: 'responUser',
sort: 'custom',
isSearch: false,
isForm: true,
table: {
width: 120
}, },
form: { form: {
componentProps: { componentProps: {
value: userStore.getUser.nickname,
disabled: true disabled: true
} }
} }
@ -299,16 +381,15 @@ export const Q3 = useCrudSchemas(
label: '金额', label: '金额',
field: 'amount', field: 'amount',
sort: 'custom', sort: 'custom',
isTable: false,
isSearch: false, isSearch: false,
table: { isTable: true,
width: 150 isForm: false,
tableForm: {
disabled: true
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
min: 0, disabled: true
precision: 2
} }
} }
}, },
@ -317,13 +398,10 @@ export const Q3 = useCrudSchemas(
field: 'costCode', field: 'costCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false, isTable: true,
isForm: true, isForm: true,
form: { tableForm: {
// labelMessage: '信息提示说明!!!', isInpuFocusShow: true,
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择成本中心', // 输入框占位文本 searchListPlaceholder: '请选择成本中心', // 输入框占位文本
searchField: 'costcentreCode', // 查询弹窗赋值字段 searchField: 'costcentreCode', // 查询弹窗赋值字段
searchTitle: '成本中心信息', // 查询弹窗标题 searchTitle: '成本中心信息', // 查询弹窗标题
@ -347,94 +425,88 @@ export const Q3 = useCrudSchemas(
} }
] // 失去焦点校验参数 ] // 失去焦点校验参数
} }
},
{
label: '缺陷编码',
field: 'defectCode',
sort: 'custom',
dictType: DICT_TYPE.QMS_Q3_CODE,
dictClass: 'string',
isSearch: true,
isTable: true,
tableForm: {
type: 'Select'
} }
}, },
{ {
label: '处理时间', label: '缺陷位置',
field: 'handleTime', field: 'defectLocation',
sort: 'custom',
dictClass: 'string',
isSearch: false, isSearch: false,
isTable: false, isTable: true,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: { form: {
component: 'DatePicker', component: 'Select',
componentProps: { componentProps: {
style: { width: '100%' }, options: [],
type: 'datetime', optionsAlias: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', labelField: 'productionLineName',
valueFormat: 'x' valueField: 'productionLineCode'
},
filterable: true
} }
},
tableForm: {
type: 'Select',
valueField: 'productionLineName',
labelField: 'productionLineCode'
} }
}, },
{ {
label: '描述', label: '缺陷类型',
field: 'desc', field: 'defectType',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: { isTable: true,
width: '150'
},
form: { form: {
component: 'Input', component: 'Select'
componentProps: {
type: 'textarea'
}
} }
}, },
{ {
label: '是否可用', label: '问题原因',
field: 'available', field: 'problemReason',
hiddenInMain: true,
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
isTable: false,
isDetail: false
},
{
label: '创建时间',
field: 'createTime',
isTable: true, isTable: true,
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: { form: {
component: 'DatePicker', component: 'Select'
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
} }
}, },
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
},
},
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, hiddenInMain: true,
isDetail: false, isDetail: false,
isForm: false,
table: { table: {
width: 150, width: 200,
fixed: 'right' fixed: 'right'
} },
isTableForm: false
} }
]) ])
) )
//表单校验
export const InspectionQ3DetailRules = reactive({
itemCode: [{ required: true, message: '请选择物料代码', trigger: 'change' }],
qty: [{ required: true, message: '请输入数量', trigger: 'change' }],
price: [{ required: true, message: '请选择单价', trigger: 'change' }],
amount: [{ required: true, message: '请选择金额', trigger: 'change' }],
costCode: [{ required: true, message: '请选择成本中心编码', trigger: 'change' }],
defectLocation: [{ required: true, message: '请选择缺陷位置', trigger: 'change' }],
defectType: [{ required: true, message: '请选择缺陷类型', trigger: 'change' }],
problemReason: [{ required: true, message: '请选择问题原因', trigger: 'change' }],
defectCode: [{ required: true, message: '请选择缺陷编码', trigger: 'change' }]
})

43
src/views/qms/inspectionRecord/index.vue

@ -244,6 +244,7 @@ const isShowPackageBtn = (row, val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // // defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
defaultButtons.mainApplyDecisionBtn({ defaultButtons.mainApplyDecisionBtn({
hide: isShowMainButton(row, null), hide: isShowMainButton(row, null),
hasPermi: 'qms:inspection-recode-main:edit' hasPermi: 'qms:inspection-recode-main:edit'
@ -253,6 +254,10 @@ const butttondata = (row) => {
hide: isShowMainButton(row, 'publish'), hide: isShowMainButton(row, 'publish'),
hasPermi: 'qms:inspection-recode-main:pub' hasPermi: 'qms:inspection-recode-main:pub'
}), // }), //
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, 'publish'),
hasPermi: 'qms:inspection-recode-main:close'
}), //
defaultButtons.mainListPackageBtn({ hide: isShowPackageBtn(row, ['11']) }), // defaultButtons.mainListPackageBtn({ hide: isShowPackageBtn(row, ['11']) }), //
// defaultButtons.mainListJobExeBtn({ // defaultButtons.mainListJobExeBtn({
// hide:row.useDecision, // hide:row.useDecision,
@ -269,7 +274,9 @@ const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION)
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision") // const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision")
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'applyDecision') { if (val == 'mainClose') {
handleOrderClose(row)
} else if (val == 'applyDecision') {
// //
// 1使 // 1使
if (row.estimateCode == 1) { if (row.estimateCode == 1) {
@ -366,7 +373,20 @@ const handleOrderPub = async (row: object) => {
await getList() await getList()
} catch {} } catch {}
} }
/** 关闭按钮操作 */
const handleOrderClose = async (row: object) => {
try {
//
await message.confirm(t('ts.是否关闭所选中数据?'))
row.isPublished = true
row.packageList = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id)
await InspectionRecordMainApi.updateInspectionRecordMain(row)
message.success(t('ts.关闭成功!'))
await getList()
} catch {
row.isPublished = false
}
}
// //
const execute = async (type: string, row?: number) => { const execute = async (type: string, row?: number) => {
@ -445,25 +465,31 @@ const searchFormClick = (searchData) => {
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType')
if (!isHave) { if (!isHave) {
if (route.name == 'inspectionRecordPurchase') { if (route.name == 'inspectionRecordPurchase') {
searchData.filters.push({ searchData.filters.push(
{
action: '==', action: '==',
column: 'inspectionType', column: 'inspectionType',
value: '1' value: '1'
},{ },
{
action: '==', action: '==',
column: 'available', column: 'available',
value: true value: true
}) }
)
} else if (route.name == 'inspectionRecordProduction') { } else if (route.name == 'inspectionRecordProduction') {
searchData.filters.push({ searchData.filters.push(
{
action: '==', action: '==',
column: 'inspectionType', column: 'inspectionType',
value: '4' value: '4'
},{ },
{
action: '==', action: '==',
column: 'available', column: 'available',
value: true value: true
}) }
)
} else { } else {
searchData.filters.push({ searchData.filters.push({
action: 'notIn', action: 'notIn',
@ -471,7 +497,6 @@ const searchFormClick = (searchData) => {
value: '1,4,11' value: '1,4,11'
}) })
} }
} }
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,

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

@ -2,9 +2,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } 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}
*/ */
@ -41,51 +38,7 @@ export const ScrapJobMain = useCrudSchemas(
width: 150 width: 150
} }
}, },
{
label: 'Q3通知单号',
field: 'q3Number',
sort: 'custom',
isSearch: false,
isDetail: true,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
// multiple: 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: '申请时间', label: '申请时间',
field: 'requestTime', field: 'requestTime',

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

@ -2,9 +2,6 @@ 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}
*/ */
@ -38,51 +35,6 @@ export const ScrapRecordMain = useCrudSchemas(
}, },
isSearch: true isSearch: true
}, },
{
label: 'Q3通知单号',
field: 'q3Number',
sort: 'custom',
isSearch: false,
isDetail: true,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
// multiple: 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: '申请时间', label: '申请时间',
field: 'requestTime', field: 'requestTime',
@ -270,7 +222,7 @@ export const ScrapRecordMain = useCrudSchemas(
type: 'daterange', type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, }
}, },
{ {
label: '创建者', label: '创建者',

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

@ -8,8 +8,14 @@ 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 * as InspectionQ1Api from '@/api/qms/inspectionQ1'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data' // import { Q1 } from '@/views/qms/inspectionQ1/inspectionQ1.data'
// import * as InspectionQ2Api from '@/api/qms/inspectionQ2'
// import { Q2 } from '@/views/qms/inspectionQ2/inspectionQ2.data'
// import * as InspectionQ3Api from '@/api/qms/inspectionQ3/inspectionQ3Main'
// import { InspectionQ3Main } from '@/views/qms/inspectionQ3/inspectionQ3.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
@ -47,51 +53,141 @@ export const ScrapRequestMain = useCrudSchemas(
isForm: false, isForm: false,
isSearch: true isSearch: true
}, },
{ // {
label: 'Q3通知单号', // label: 'Q1通知单号',
field: 'q3Number', // field: 'q1Number',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isDetail: true, // isDetail: true,
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true,
// multiple: true, // // multiple: true,
isSearchList: true, // 开启查询弹窗 // isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本 // searchListPlaceholder: '请选择Q1通知单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 // searchField: 'number', // 查询弹窗赋值字段
searchTitle: 'Q3通知单号', // 查询弹窗标题 // searchTitle: 'Q1通知单号', // 查询弹窗标题
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类 // searchAllSchemas: Q1.allSchemas, // 查询弹窗所需类
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法 // searchPage: InspectionQ1Api.getQ1Page, // 查询弹窗所需分页方法
searchCondition: [ // searchCondition: [
{ // {
key: 'available', // key: 'available',
value: 'TRUE', // value: 'TRUE',
isMainValue: false // isMainValue: false
}, // },
{ // {
key: 'status', // key: 'status',
value: '0', // value: '0',
isMainValue: false // isMainValue: false
} // }
], // ],
verificationParams: [ // verificationParams: [
{ // {
key: 'number', // key: 'number',
action: '==', // action: '==',
value: '', // value: '',
isMainValue: false, // isMainValue: false,
isSearch: true, // isSearch: true,
isFormModel: true // isFormModel: true
} // }
] // 失去焦点校验参数 // ] // 失去焦点校验参数
} // }
} // }
}, // },
// {
// label: 'Q2通知单号',
// field: 'q2Number',
// sort: 'custom',
// isSearch: false,
// isDetail: true,
// table: {
// width: 150
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// // multiple: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择Q2通知单号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: 'Q2通知单号', // 查询弹窗标题
// searchAllSchemas: Q2.allSchemas, // 查询弹窗所需类
// searchPage: InspectionQ2Api.getQ2Page, // 查询弹窗所需分页方法
// 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: 'Q3通知单号',
// field: 'q3Number',
// sort: 'custom',
// isSearch: false,
// isDetail: true,
// table: {
// width: 150
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// // multiple: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: 'Q3通知单号', // 查询弹窗标题
// searchAllSchemas: InspectionQ3Main.allSchemas, // 查询弹窗所需类
// searchPage: InspectionQ3Api.getInspectionQ3MainPage, // 查询弹窗所需分页方法
// 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: 'status', field: 'status',
@ -403,7 +499,7 @@ export const ScrapRequestMain = useCrudSchemas(
type: 'daterange', type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, }
}, },
{ {
label: '创建者', label: '创建者',

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

@ -1,8 +1,8 @@
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 * as InspectionQ3Api from '@/api/qms/inspectionQ3/inspectionQ3Main'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data' // import { InspectionQ3Main } from '@/views/qms/inspectionQ3/inspectionQ3.data'
/** /**
* @returns {Array} 退 * @returns {Array} 退
@ -28,51 +28,50 @@ export const ProductionscrapRecordMain = useCrudSchemas(
}, },
isSearch: true isSearch: true
}, },
{ // {
label: 'Q3通知单号', // label: 'Q3通知单号',
field: 'q3Number', // field: 'q3Number',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isDetail: true, // isDetail: true,
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true, // multiple: true,
// multiple: true, // isSearchList: true, // 开启查询弹窗
isSearchList: true, // 开启查询弹窗 // searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本 // searchField: 'number', // 查询弹窗赋值字段
searchField: 'number', // 查询弹窗赋值字段 // searchTitle: 'Q3通知单号', // 查询弹窗标题
searchTitle: 'Q3通知单号', // 查询弹窗标题 // searchAllSchemas: InspectionQ3Main.allSchemas, // 查询弹窗所需类
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类 // searchPage: InspectionQ3Api.getInspectionQ3MainPage, // 查询弹窗所需分页方法
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法 // searchCondition: [
searchCondition: [ // {
{ // key: 'available',
key: 'available', // value: 'TRUE',
value: 'TRUE', // isMainValue: false
isMainValue: false // },
}, // {
{ // key: 'status',
key: 'status', // value: '0',
value: '0', // isMainValue: false
isMainValue: false // }
} // ],
], // verificationParams: [
verificationParams: [ // {
{ // key: 'number',
key: 'number', // action: '==',
action: '==', // value: '',
value: '', // isMainValue: false,
isMainValue: false, // isSearch: true,
isSearch: true, // isFormModel: true
isFormModel: true // }
} // ] // 失去焦点校验参数
] // 失去焦点校验参数 // }
} // }
} // },
},
{ {
label: '车间代码', label: '车间代码',
field: 'workshopCode', field: 'workshopCode',

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

@ -23,8 +23,8 @@ import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplie
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 * as InspectionQ3Api from '@/api/qms/inspectionQ3/inspectionQ3Main'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data' // import { InspectionQ3Main } from '@/views/qms/inspectionQ3/inspectionQ3.data'
// import * as LocationApi from '@/api/wms/location' // import * as LocationApi from '@/api/wms/location'
// import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' // import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
@ -63,51 +63,50 @@ export const ProductionscrapRequestMain = useCrudSchemas(
isForm: false, isForm: false,
isSearch: true isSearch: true
}, },
{ // {
label: 'Q3通知单号', // label: 'Q3通知单号',
field: 'q3Number', // field: 'q3Number',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isDetail: true, // isDetail: true,
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true, // multiple: true,
// multiple: true, // isSearchList: true, // 开启查询弹窗
isSearchList: true, // 开启查询弹窗 // searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本 // searchField: 'number', // 查询弹窗赋值字段
searchField: 'number', // 查询弹窗赋值字段 // searchTitle: 'Q3通知单号', // 查询弹窗标题
searchTitle: 'Q3通知单号', // 查询弹窗标题 // searchAllSchemas: InspectionQ3Main.allSchemas, // 查询弹窗所需类
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类 // searchPage: InspectionQ3Api.getInspectionQ3MainPage, // 查询弹窗所需分页方法
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法 // searchCondition: [
searchCondition: [ // {
{ // key: 'available',
key: 'available', // value: 'TRUE',
value: 'TRUE', // isMainValue: false
isMainValue: false // },
}, // {
{ // key: 'status',
key: 'status', // value: '0',
value: '0', // isMainValue: false
isMainValue: false // }
} // ],
], // verificationParams: [
verificationParams: [ // {
{ // key: 'number',
key: 'number', // action: '==',
action: '==', // value: '',
value: '', // isMainValue: false,
isMainValue: false, // isSearch: true,
isSearch: true, // isFormModel: true
isFormModel: true // }
} // ] // 失去焦点校验参数
] // 失去焦点校验参数 // }
} // }
} // },
},
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -496,8 +495,8 @@ export const ProductionscrapRequestMain = useCrudSchemas(
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange', type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}, }
}, }
}, },
{ {
label: '创建者', label: '创建者',

9
src/views/wms/productionManage/productreceipt/productreceiptRecordMain/productreceiptRecordMain.data.ts

@ -33,6 +33,15 @@ export const ProductreceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isSearch: true isSearch: true
}, },
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 180
},
isSearch: false
},
{ {
label: '生产计划单号', label: '生产计划单号',
field: 'productionPlanNumber', field: 'productionPlanNumber',

9
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/productreceiptAssembleRecordMain.data.ts

@ -33,6 +33,15 @@ export const ProductreceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isSearch: true isSearch: true
}, },
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 180
},
isSearch: false
},
{ {
label: '生产计划单号', label: '生产计划单号',
field: 'productionPlanNumber', field: 'productionPlanNumber',

2
src/views/wms/productionManage/productredress/productredressRequestMain/index.vue

@ -119,7 +119,7 @@ defineOptions({ name: 'ProductredressRequestMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
//
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name

111
src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

@ -1,6 +1,9 @@
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 { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as WorkshopApi from '@/api/wms/workshop'
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 getBusinessTypeApi from '@/api/wms/businesstype/index' import * as getBusinessTypeApi from '@/api/wms/businesstype/index'
@ -17,6 +20,12 @@ export const ProductredressRequestMainRules = reactive({
autoAgree: [required], autoAgree: [required],
autoExecute: [required], autoExecute: [required],
directCreateRecord: [required], directCreateRecord: [required],
workshopCode: [
{ required: true, message: '请选择车间代码', trigger: 'change' }
],
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
}) })
export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -55,6 +64,106 @@ export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '车间代码',
field: 'workshopCode',
sort: 'custom',
table: {
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,
}], // 失去焦点校验参数
}
}
},
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
isTable:false,
tableForm: {
enterSearch: 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
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
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,
}], // 失去焦点校验参数
}
}
},
// { // {
// label: '车间代码', // label: '车间代码',
// field: 'workshopCode', // field: 'workshopCode',

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

@ -1,8 +1,8 @@
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 InspectionQ3Api from '@/api/qms/inspectionQ3' // import * as InspectionQ3Api from '@/api/qms/inspectionQ3/inspectionQ3Main'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data' // import { InspectionQ3Main } from '@/views/qms/inspectionQ3/inspectionQ3.data'
/** /**
* @returns {Array} * @returns {Array}
@ -28,51 +28,50 @@ export const ProductscrapJobMain = useCrudSchemas(
}, },
isSearch: true isSearch: true
}, },
{ // {
label: 'Q3通知单号', // label: 'Q3通知单号',
field: 'q3Number', // field: 'q3Number',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isDetail: true, // isDetail: true,
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true, // multiple: true,
// multiple: true, // isSearchList: true, // 开启查询弹窗
isSearchList: true, // 开启查询弹窗 // searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本 // searchField: 'number', // 查询弹窗赋值字段
searchField: 'number', // 查询弹窗赋值字段 // searchTitle: 'Q3通知单号', // 查询弹窗标题
searchTitle: 'Q3通知单号', // 查询弹窗标题 // searchAllSchemas: InspectionQ3Main.allSchemas, // 查询弹窗所需类
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类 // searchPage: InspectionQ3Api.getInspectionQ3MainPage, // 查询弹窗所需分页方法
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法 // searchCondition: [
searchCondition: [ // {
{ // key: 'available',
key: 'available', // value: 'TRUE',
value: 'TRUE', // isMainValue: false
isMainValue: false // },
}, // {
{ // key: 'status',
key: 'status', // value: '0',
value: '0', // isMainValue: false
isMainValue: false // }
} // ],
], // verificationParams: [
verificationParams: [ // {
{ // key: 'number',
key: 'number', // action: '==',
action: '==', // value: '',
value: '', // isMainValue: false,
isMainValue: false, // isSearch: true,
isSearch: true, // isFormModel: true
isFormModel: true // }
} // ] // 失去焦点校验参数
] // 失去焦点校验参数 // }
} // }
} // },
},
{ {
label: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',

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

@ -1,8 +1,8 @@
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 * as InspectionQ3Api from '@/api/qms/inspectionQ3/inspectionQ3Main'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data' // import { InspectionQ3Main } from '@/views/qms/inspectionQ3/inspectionQ3.data'
/** /**
* @returns {Array} * @returns {Array}
@ -28,51 +28,50 @@ export const ProductscrapRecordMain = useCrudSchemas(
}, },
isSearch: true isSearch: true
}, },
{ // {
label: 'Q3通知单号', // label: 'Q3通知单号',
field: 'q3Number', // field: 'q3Number',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isDetail: true, // isDetail: true,
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true, // multiple: true,
// multiple: true, // isSearchList: true, // 开启查询弹窗
isSearchList: true, // 开启查询弹窗 // searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本 // searchField: 'number', // 查询弹窗赋值字段
searchField: 'number', // 查询弹窗赋值字段 // searchTitle: 'Q3通知单号', // 查询弹窗标题
searchTitle: 'Q3通知单号', // 查询弹窗标题 // searchAllSchemas: InspectionQ3Main.allSchemas, // 查询弹窗所需类
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类 // searchPage: InspectionQ3Api.getInspectionQ3MainPage, // 查询弹窗所需分页方法
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法 // searchCondition: [
searchCondition: [ // {
{ // key: 'available',
key: 'available', // value: 'TRUE',
value: 'TRUE', // isMainValue: false
isMainValue: false // },
}, // {
{ // key: 'status',
key: 'status', // value: '0',
value: '0', // isMainValue: false
isMainValue: false // }
} // ],
], // verificationParams: [
verificationParams: [ // {
{ // key: 'number',
key: 'number', // action: '==',
action: '==', // value: '',
value: '', // isMainValue: false,
isMainValue: false, // isSearch: true,
isSearch: true, // isFormModel: true
isFormModel: true // }
} // ] // 失去焦点校验参数
] // 失去焦点校验参数 // }
} // }
} // },
},
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -304,8 +303,8 @@ export const ProductscrapRecordMain = useCrudSchemas(
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange', type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}, }
}, }
}, },
{ {
label: '最后更新时间', label: '最后更新时间',

37
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -92,8 +92,8 @@
:isBusiness="true" :isBusiness="true"
:isShowButton="false" :isShowButton="false"
:isShowReduceButton="false" :isShowReduceButton="false"
:isShowFooterButtton="true" :isShowFooterButtton="isShowFooterButtton"
:isShowReduceButtonSelection="true" :isShowReduceButtonSelection="isShowReduceButtonSelection"
@handleDeleteTable="handleDeleteTableBom" @handleDeleteTable="handleDeleteTableBom"
@tableSelectionDelete="tableSelectionDeleteBom" @tableSelectionDelete="tableSelectionDeleteBom"
:Butttondata="ButttondataBom" :Butttondata="ButttondataBom"
@ -162,10 +162,14 @@ const footButttondata = ref([
]) ])
// //
const detailBomRef = ref() const detailBomRef = ref()
const isShowFooterButtton = ref(true)
const isShowReduceButtonSelection = ref(true)
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({
getListApi: BomDismantleApi.getProductscrapBomDismantlePage getListApi: BomDismantleApi.getProductscrapBomRecordPage
}) })
const { getList:getDetailListBom } = detatableMethodsBom const { getList:getDetailListBom } = detatableMethodsBom
detatableDataBom.params.isRecord = false
/** bom 列表 表单 按钮 */ /** bom 列表 表单 按钮 */
const ButttondataBom = ref([ const ButttondataBom = ref([
defaultButtons.formSaveBtn(null), // defaultButtons.formSaveBtn(null), //
@ -252,6 +256,7 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> {
detatableDataBom.params.bomVersion = row.bomVersion detatableDataBom.params.bomVersion = row.bomVersion
detailQty.value = row.qty detailQty.value = row.qty
bomModelVisible.value = true bomModelVisible.value = true
detatableDataBom.params.isRecord = false
await getDetailListBom() await getDetailListBom()
console.log(row.fromLocationCode); console.log(row.fromLocationCode);
detatableDataBom.tableList.forEach(async (item) => { detatableDataBom.tableList.forEach(async (item) => {
@ -291,11 +296,22 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> {
if(isSave){ if(isSave){
buttonBaseClickBom('save') buttonBaseClickBom('save')
}else{ }else{
isShowFooterButtton.value = true
isShowReduceButtonSelection.value = true
ProdcutscrapBomScrap.allSchemas.tableFormColumns.forEach(item=>{
if(item.field=='qty'){
item.tableForm.disabled = false
}
})
detailBomRef.value.open('create', row, null,'viewDetail')// detailBomRef.value.open('create', row, null,'viewDetail')//
} }
} }
// //
const handleDeleteTableBom = (item, index) => { const handleDeleteTableBom = (item, index) => {
if(detatableDataBom.tableList.length<=1){
message.error('至少保留一条数据')
return
}
let itemIndex = detatableDataBom.tableList.indexOf(item) let itemIndex = detatableDataBom.tableList.indexOf(item)
if (itemIndex > -1) { if (itemIndex > -1) {
detatableDataBom.tableList.splice(itemIndex, 1) detatableDataBom.tableList.splice(itemIndex, 1)
@ -303,6 +319,12 @@ const handleDeleteTableBom = (item, index) => {
} }
const tableSelectionDeleteBom = (selection) => { const tableSelectionDeleteBom = (selection) => {
if(detatableDataBom.tableList.length<=1||detatableDataBom.tableList.length==selection.length){
message.error('至少保留一条数据')
return
}
detatableDataBom.tableList = detatableDataBom.tableList.filter(item => !selection.includes(item)) detatableDataBom.tableList = detatableDataBom.tableList.filter(item => !selection.includes(item))
} }
@ -331,7 +353,16 @@ const tableFormButton = async (val , row) => {
} }
rowId.value = row.masterId rowId.value = row.masterId
detailQty.value = row.qty detailQty.value = row.qty
detatableDataBom.params.isRecord = true
await getDetailListBom() await getDetailListBom()
//
isShowFooterButtton.value = false
isShowReduceButtonSelection.value = false
ProdcutscrapBomScrap.allSchemas.tableFormColumns.forEach(item=>{
if(item.field=='qty'){
item.tableForm.disabled = true
}
})
detailBomRef.value.open('create', row, null,'viewDetail')// detailBomRef.value.open('create', row, null,'viewDetail')//
} }
} }

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

@ -21,8 +21,8 @@ import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/produ
import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data' import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
import * as BomApi from '@/api/wms/bom' import * as BomApi from '@/api/wms/bom'
import * as InspectionQ3Api from '@/api/qms/inspectionQ3' // import * as InspectionQ3Api from '@/api/qms/inspectionQ3/inspectionQ3Main'
import { Q3 } from '@/views/qms/inspectionQ3/inspectionQ3.data' // import { InspectionQ3Main } from '@/views/qms/inspectionQ3/inspectionQ3.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
@ -60,51 +60,50 @@ export const ProductscrapRequestMain = useCrudSchemas(
isForm: false, isForm: false,
isSearch: true isSearch: true
}, },
{ // {
label: 'Q3通知单号', // label: 'Q3通知单号',
field: 'q3Number', // field: 'q3Number',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isDetail: true, // isDetail: true,
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true, // multiple: true,
// multiple: true, // isSearchList: true, // 开启查询弹窗
isSearchList: true, // 开启查询弹窗 // searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本
searchListPlaceholder: '请选择Q3通知单号', // 输入框占位文本 // searchField: 'number', // 查询弹窗赋值字段
searchField: 'number', // 查询弹窗赋值字段 // searchTitle: 'Q3通知单号', // 查询弹窗标题
searchTitle: 'Q3通知单号', // 查询弹窗标题 // searchAllSchemas: InspectionQ3Main.allSchemas, // 查询弹窗所需类
searchAllSchemas: Q3.allSchemas, // 查询弹窗所需类 // searchPage: InspectionQ3Api.getInspectionQ3MainPage, // 查询弹窗所需分页方法
searchPage: InspectionQ3Api.getQ3Page, // 查询弹窗所需分页方法 // searchCondition: [
searchCondition: [ // {
{ // key: 'available',
key: 'available', // value: 'TRUE',
value: 'TRUE', // isMainValue: false
isMainValue: false // },
}, // {
{ // key: 'status',
key: 'status', // value: '0',
value: '0', // isMainValue: false
isMainValue: false // }
} // ],
], // verificationParams: [
verificationParams: [ // {
{ // key: 'number',
key: 'number', // action: '==',
action: '==', // value: '',
value: '', // isMainValue: false,
isMainValue: false, // isSearch: true,
isSearch: true, // isFormModel: true
isFormModel: true // }
} // ] // 失去焦点校验参数
] // 失去焦点校验参数 // }
} // }
} // },
},
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -391,8 +390,8 @@ export const ProductscrapRequestMain = useCrudSchemas(
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange', type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}, }
}, }
}, },
{ {
label: '创建者', label: '创建者',

121
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts

@ -1,6 +1,5 @@
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 { t } from '@wangeditor/editor'
@ -39,6 +38,16 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
sortTableDefault:3 sortTableDefault:3
}, },
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 180
},
isSearch: false,
sortTableDefault:3
},
{ {
label: '发货单号', label: '发货单号',
field: 'asnNumber', field: 'asnNumber',
@ -339,15 +348,15 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isTable:false, isTable:false,
}, },
{ // {
label: '备注', // label: '备注',
field: 'mainRemark', // field: 'mainRemark',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
isTable:true, // isTable:true,
}, // },
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
@ -639,44 +648,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
sortTableDefault:10, sortTableDefault:10,
isSearch: true isSearch: true
}, },
{
label: '是否已发送检验申请',
field: 'inspectRequestFlag',
dictType: DICT_TYPE.TRUE_FALSE,
sort: 'custom',
table: {
width: 150
},
isTable:false,
isTableForm:false,
isForm:false,
form: {
value: 'ALL',
componentProps: {
disabled: true
}
},
isSearch: true,
},
{
label: '是否已生成上架申请',
field: 'putawayRequestFlag',
dictType: DICT_TYPE.TRUE_FALSE,
sort: 'custom',
table: {
width: 150
},
isTable:false,
isTableForm:false,
isForm:false,
form: {
value: 'ALL',
componentProps: {
disabled: true
}
},
isSearch: true,
},
{ {
label: '物料名称', label: '物料名称',
field: 'itemName', field: 'itemName',
@ -1147,16 +1118,16 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
isTable:false, isTable:false,
hiddenInMain:true hiddenInMain:true
}, },
{ // {
label: '备注', // label: '备注',
field: 'remark', // field: 'remark',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
hiddenInMain:true, // hiddenInMain:true,
sortTableDefault:2000, // sortTableDefault:2000,
}, // },
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
@ -1973,21 +1944,21 @@ export const PurchasereceiptRecordDetailPackingNumber = useCrudSchemas(reactive<
disabled: true, disabled: true,
} }
}, },
{ // {
label: '备注', // label: '备注',
field: 'remark', // field: 'remark',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
hiddenInMain:true, // hiddenInMain:true,
form: { // form: {
componentProps: { // componentProps: {
disabled:true // disabled:true
} // }
}, // },
tableForm: { // tableForm: {
disabled: true, // disabled: true,
} // }
}, // }
])) ]))

1
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -591,6 +591,7 @@ const getSearchTableData = async (number,isEnter=false)=>{
defaultParams:{number}, defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPageWMS // getListApi: PurchaseDetailApi.getPurchaseDetailPageWMS //
}) })
tableObject.pageSize = 500
// //
const { getList:getList1 } = tableMethods const { getList:getList1 } = tableMethods
await getList1() await getList1()

15
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue

@ -348,7 +348,7 @@ const butttondata = (row,$index) => {
return [] return []
} }
return [ return [
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchasereceipt-request-main:reAdd'}), // // defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchasereceipt-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:submit'}), // defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), // defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), // defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), //
@ -509,6 +509,12 @@ const updateTableData = (tableList)=>{
// //
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['defaultToLocationCode'] =row['defaultLocation'] newRow['defaultToLocationCode'] =row['defaultLocation']
if(Number(row['orderQty'])>1){
newRow['qty'] = 1
}else{
newRow['qty'] = row['orderQty']
}
if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){ if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){
tableData.value.push(newRow) tableData.value.push(newRow)
} }
@ -518,7 +524,7 @@ const updateTableData = (tableList)=>{
const getSearchTableData = async (number,isEnter=false)=>{ const getSearchTableData = async (number,isEnter=false)=>{
const {tableObject ,tableMethods} = useTable({ const {tableObject ,tableMethods} = useTable({
defaultParams:{number}, defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPageWMS // getListApi: PurchaseDetailApi.getPurchaseDetailPageWMSTypeM //
}) })
// //
const { getList:getList1 } = tableMethods const { getList:getList1 } = tableMethods
@ -734,6 +740,11 @@ const submitForm = async (formType, submitData) => {
tableData.value.forEach((row, index) => { tableData.value.forEach((row, index) => {
row['expireDate'] = row['expireTime']?addDay(row['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf() row['expireDate'] = row['expireTime']?addDay(row['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf()
}) })
if(tableData.value.find(item=>item['qty']>item['orderQty'])){
message.error('收货数不能大于订单数')
return
}
data.subList = tableData.value // data.subList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {

24
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts

@ -580,7 +580,13 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
} }
])) ]))
function validateQty(rule, value, callback) {
if (value>0) {
callback()
}else{
callback(new Error('数量必须大于0'))
}
}
//表单校验 //表单校验
export const PurchasereceiptRequestMainRules = reactive({ export const PurchasereceiptRequestMainRules = reactive({
ppNumber: [ ppNumber: [
@ -609,7 +615,7 @@ export const PurchasereceiptRequestMainRules = reactive({
], ],
businessType: [ businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' } { required: true, message: '请输入业务类型', trigger: 'blur' }
], ]
}) })
/** /**
@ -634,7 +640,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
isConcatDetailSchemas:true,//是否是主子表合并 默认false isConcatDetailSchemas:true,//是否是主子表合并 默认false
searchDetailSchemas:PurchaseDetail.allSchemas, searchDetailSchemas:PurchaseDetail.allSchemas,
searchAllSchemas: PurchaseMain.allSchemas, searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseDetailApi.getPurchaseDetailPageWMS, searchPage: PurchaseDetailApi.getPurchaseDetailPageWMSTypeM,
searchCondition: [ searchCondition: [
{ {
key:'number', key:'number',
@ -642,6 +648,8 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
action: '==', // 查询拼接条件 action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件 isSearch: true, // 使用自定义拼接条件
isFormModel:true, isFormModel:true,
required:true,
message:'请选择M型采购订单号',
isMainValue: false isMainValue: false
}, },
{ {
@ -661,7 +669,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
searchTitle: '采购订单信息', searchTitle: '采购订单信息',
searchDetailSchemas:PurchaseDetail.allSchemas, searchDetailSchemas:PurchaseDetail.allSchemas,
searchAllSchemas: PurchaseMain.allSchemas, searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseDetailApi.getPurchaseDetailPageWMS, searchPage: PurchaseDetailApi.getPurchaseDetailPageWMSTypeM,
searchCondition: [{ searchCondition: [{
key:'supplierCode', key:'supplierCode',
value:'supplierCode', value:'supplierCode',
@ -844,6 +852,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
}, },
sortTableDefault:9, sortTableDefault:9,
tableForm: { tableForm: {
disabled:true,
type: 'InputNumber', type: 'InputNumber',
min: 1, min: 1,
precision: 6 precision: 6
@ -860,13 +869,13 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 1, min: 0,
precision: 6 precision: 6
}, },
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
min: 1, min: 0,
precision: 6 precision: 6
} }
}, },
@ -1370,6 +1379,9 @@ export const PurchasereceiptRequestDetailRules = reactive({
itemCode: [ itemCode: [
{ required: true, message: '请输入物料代码', trigger: 'change' } { required: true, message: '请输入物料代码', trigger: 'change' }
], ],
qty:[
{ validator:validateQty, message: '收货数量必须大于0', trigger: 'change'}
]
}) })
/** /**

62
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

@ -146,7 +146,8 @@ import {
PurchasereturnRequestDetail, PurchasereturnRequestDetail,
PurchasereturnRequestDetailRules, PurchasereturnRequestDetailRules,
PurchasereReturnRequestDetailLabel, PurchasereReturnRequestDetailLabel,
PurchasereceiptRecordMain1 PurchasereceiptRecordMain1,
PurchasereturnPurchasereceiptRecord
} from './purchasereturnRequestMain.data' } from './purchasereturnRequestMain.data'
import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain' import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain'
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
@ -185,17 +186,28 @@ const updataTableColumns = (val) => {
const onChangeForm = (field, cur, formRef)=>{ const onChangeForm = (field, cur, formRef)=>{
console.log('onChangeForm',field, cur, formRef) console.log('onChangeForm',field, cur, formRef)
console.log('1111') if(field=='supplierCode'){
console.log(PurchasereturnRequestMain.allSchemas) //
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{ PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
if(item.field == field){
// //
if(item.field=='supplierCode'){
let setV = {} let setV = {}
setV['supplierName'] = item.componentProps.options?.find(el=>el.id==cur)['nickname'] setV['supplierName'] = item.componentProps.options?.find(el=>el.supplierCode==cur+'')['supplierName']
formRef.value.setValues(setV) formRef.value.setValues(setV)
} }
}) })
}else if(field == 'locationCode'){
// 退
tableData.value = [{
'batch':'20240908',
'status':'合格',
'inventoryBalance':300,
'qty':1,
'reason':'200',
'remark':'',
}]
}
} }
const onEnter = async (field, value) => { const onEnter = async (field, value) => {
console.log(field, value) console.log(field, value)
@ -258,18 +270,25 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField=='itemCode'){ if(formField=='itemCode'){
// //
let res = await PurchasereturnRequestDetailApi.getPurchasereturnSupplierByCode({
itemCode:val[0][searchField]
})
console.log('物料供应商',res)
if(res&&res.length>0){
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{ PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
if(item.field == 'supplierCode1'){ if(item.field == 'supplierCode'){
item.componentProps.options = [ item.componentProps.options = res
{
id:'454556',
nickname:'哈哈哈哈'
}
]
formRef.setValues(setV)
} }
}) })
} }
}else if(formField=='hahaha'){
//
setV['poNumber'] = val[0]['poNumber']
setV['poLine'] = val[0]['poLine']
setV['receiptNumber'] = val[0]['receiptNumber']
setV['asnNumber'] = val[0]['asnNumber']
}
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
@ -585,26 +604,23 @@ const chooseReceiptList = ()=>{
message.error('请选择物料代码') message.error('请选择物料代码')
return return
} }
if(!formRef.value.formRef.formModel.supplierName){ if(!formRef.value.formRef.formModel.supplierCode){
message.error('请选择供应商') message.error('请选择供应商')
return return
} }
searchTableRef.value.open( searchTableRef.value.open(
"收货单明细", "收货单明细",
Itembasic.allSchemas, PurchasereturnPurchasereceiptRecord.allSchemas,
ItembasicApi.getItembasicPage, PurchasereturnRequestDetailApi.getPurchasereturnPurchasereceiptRecordByItemCode,
"hahaha", "hahaha",
"hahaha", "hahaha",
false, false,
'tableForm', 'tableForm',
null, null,
[{ {
key: 'available', supplierCode:formRef.value.formRef.formModel.supplierCode,
value: 'TRUE', itemCode:formRef.value.formRef.formModel.itemCode
action: '==', },
isSearch: true,
isMainValue: false
}],
undefined, undefined,
false, false,
null null

175
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMain.data.ts

@ -21,14 +21,18 @@ import { Q2 } from '@/views/qms/inspectionQ2/inspectionQ2.data'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { let locationList = await LocationApi.selectBusinessTypeOutLocation({
pageSize: 10, businessType:'PurchaseReturn',
pageNo: 1, isIn:'out'
code: 'PurchaseReturnRequest' })
} locationList = locationList.list.map(item=>({
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) label :item.code,
const requestsettingData = data?.list[0] || {} value :item.code
}))
console.log('locationList',locationList)
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
@ -72,7 +76,6 @@ export const PurchasereceiptRecordMain1 = useCrudSchemas(
sortTableDefault: 2, sortTableDefault: 2,
isSearch: true isSearch: true
}, },
{ {
label: '采购订单号', label: '采购订单号',
field: 'poNumber', field: 'poNumber',
@ -208,7 +211,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
} }
}, },
{ {
label: '供应商1', label: '供应商',
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
table: { table: {
@ -217,13 +220,10 @@ export const PurchasereturnRequestMain = useCrudSchemas(
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [{ options: [],
id:123,
nickname:'供应商'
}],
optionsAlias: { optionsAlias: {
labelField: 'id', labelField: 'supplierCode',
valueField: 'id' valueField: 'supplierCode'
}, },
filterable: true, filterable: true,
} }
@ -305,7 +305,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
}, },
{ {
label: '收货单号', label: '收货单号',
field: 'purchaseReceiptRecordNumber', field: 'receiptNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -321,7 +321,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
}, },
{ {
label: '发货单号', label: '发货单号',
field: 'asnNumber1', field: 'asnNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -365,15 +365,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [{ options: locationList
id:123,
nickname:'供应商'
}],
optionsAlias: {
labelField: 'id',
valueField: 'id'
},
filterable: true,
} }
} }
}, },
@ -440,6 +432,130 @@ export const PurchasereturnRequestMain = useCrudSchemas(
]) ])
) )
export const PurchasereturnPurchasereceiptRecord = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '收货日期',
field: 'currentDeliveryDate',
isTable: true,
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: '收货单号',
field: 'receiptNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
}
])
)
//表单校验 //表单校验
export const PurchasereturnRequestMainRules = reactive({ export const PurchasereturnRequestMainRules = reactive({
supplierCode: [ supplierCode: [
@ -538,6 +654,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
} }
}, },
tableForm:{ tableForm:{
disabled:true,
hidden:false,//控制列是否展示 hidden:false,//控制列是否展示
type:'InputNumber', type:'InputNumber',
min:0, min:0,
@ -565,7 +682,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
isTable:false, isTable:false,
isTableForm:true, isTableForm:true,
tableForm:{ tableForm:{
disabled:true,
type:'InputNumber', type:'InputNumber',
min:0, min:0,
precision: 6 precision: 6
@ -573,7 +689,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}, },
{ {
label: '退货原因', label: '退货原因',
field: 'status', field: 'reason',
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
// isSearch: true, // isSearch: true,
@ -583,7 +699,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true,
type: 'Select', type: 'Select',
}, },
form: { form: {

Loading…
Cancel
Save