Browse Source

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

master_hella_20240701
zhaoyiran 7 months ago
parent
commit
a31e98394d
  1. 27
      src/api/qms/inspectionRequest/InspectionRequestPackage.ts
  2. 5
      src/api/qms/inspectionRequest/index.ts
  3. 5
      src/api/wms/package/index.ts
  4. 186
      src/components/ListTable/src/ListTable.vue
  5. 36
      src/views/qms/inspection/inspectionRequest/index.vue
  6. 17
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts
  7. 4
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue
  8. 7
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts
  9. 66
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  10. 52
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts
  11. 32
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  12. 2
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

27
src/api/qms/inspectionRequest/InspectionRequestPackage.ts

@ -0,0 +1,27 @@
import request from '@/config/axios'
export interface InspectionRequestPackageVO {
number: string
packageCode: string
packageSpecificationCode: string
amount: string
measuringUnit: string
}
//查询包装列表
export const getInspectionRequestPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id })
}
// 新增检验申请
export const createInspectionRequestPackage = async (data: InspectionRequestPackageVO) => {
return await request.post({ url: `/qms/inspection-request-package/create`, data })
}
// 修改检验申请
export const updateInspectionRequestPackage = async (data: InspectionRequestPackageVO) => {
return await request.put({ url: `/qms/inspection-request-package/update`, data })
}
// 删除检验申请
export const deleteInspectionRequestPackage = async (id: number) => {
return await request.delete({ url: `/qms/inspection-request-package/delete?id=` + id })
}

5
src/api/qms/inspectionRequest/index.ts

@ -86,8 +86,3 @@ export const refusedInspectRequestMain = async (id) => {
export const handleInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/handle?id=` + id })
}
//查询检验申请列表
export const getInspectionRequestPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id })
}

5
src/api/wms/package/index.ts

@ -100,3 +100,8 @@ export const createPackageLabel = async (data: PackageVO) => {
export const batchPrintingLable = async (data: any) => {
return await request.post({ url: `/wms/package/batchPrintingLable`, data })
}
// 打印标签获取包装列表
export const getLabel = async (id: number) => {
return await request.get({ url: `/wms/package/getLabel?id=` + id })
}

186
src/components/ListTable/src/ListTable.vue

@ -1,40 +1,202 @@
<template>
<div>
<Dialog v-model="isPackageShow" :title="dialogTitle" :width="width?width:'900px'" v-loading="packageLoading">
<Dialog
v-model="isPackageShow"
:title="dialogTitle"
:width="width ? width : '900px'"
v-loading="packageLoading"
>
<TableHead
:HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId"
@button-base-click="buttonBaseClick"
:allSchemas="detailAllSchemas"
/>
<Table
ref="searchTableRef"
:columns="columns"
:data="allList"
:reserveSelection="true"
row-key="id"
/>
>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</Dialog>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
:isDetail="true"
:detailData="detailData"
@success="submitForm"
/>
</div>
</template>
<script lang="ts" setup>
const isPackageShow = ref(false)
const packageLoading = ref(false)
const dialogTitle = ref()
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const message = useMessage() //
const columns = ref()
const allList = ref()
const { t } = useI18n() //
//
const props = defineProps({
width: {
type: String,
required: false
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemasRules: {
type: Object,
required: true,
default: null
},
// API
apiCreate: {
type: Function,
required: false,
default: null
},
// API
apiUpdate: {
type: Function,
required: false,
default: null
},
//
detailValidate: {
type: Function,
required: false,
default: null
},
//
detailButtonIsShowDelete: {
type: Boolean,
required: false,
default: true
},
//
list: {
type: Object,
required: true,
default: null
}
})
const isPackageShow = ref(false)
const packageLoading = ref(false)
const dialogTitle = ref()
const columns = ref()
const allList = ref([])
//
const masterParmas = ref({
masterId: '', //id
number: '' //
})
const openPackage = async (row?: any, titleName?: any,tableColumns?: any,list?: any) => {
//
const HeadButttondata = ref()
// -
const butttondata = ref()
const detailData = ref({})
const openPackage = async (row?: any, titleName?: any, tableColumns?: any, list?: any) => {
isPackageShow.value = true
detailData.value = row
masterParmas.value.masterId = row.masterId || row.id
masterParmas.value.number = row.number
if(detailData.value.status ==1){
HeadButttondata.value = [
defaultButtons.defaultAddBtn(null) //
]
butttondata.value =[
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null) //
]
columns.value = tableColumns
}else{
columns.value = tableColumns.filter(item=>item.field != 'action')
}
if (titleName) {
dialogTitle.value = titleName
}
columns.value = tableColumns.filter(item => (item.field !== 'action'))
allList.value = list
}
defineExpose({ openPackage }) // open
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
}
const submitForm = async (formType, data) => {
try {
// detailValidate
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true
if (!rs) return
emit('ListTableSubmit', formType, data)
//
} finally {
formRef.value.formLoading = false
}
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row)
}
}
const handleDelete = async (row: any) => {
try {
//
await message.delConfirm()
//
emit('ListTableSubmit', 'detele', row)
} catch {}
}
const emit = defineEmits(['ListTableSubmit']) // success
defineExpose({ openPackage, formRef }) // open
watch(
() => props.list,
(newValue) => {
allList.value = newValue
formRef.value.dialogVisible = false
},
{
deep: true
}
)
</script>

36
src/views/qms/inspection/inspectionRequest/index.vue

@ -1,4 +1,5 @@
<template>
<div>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
@ -45,24 +46,31 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" />
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" /> -->
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionMain.allSchemas"
:detailAllSchemas="InspectionRequestPackage.allSchemas" :detailAllSchemasRules="InspectionRequestPackageRules"
:apiPage="InspectionMainApi.getInspectionRequestPackageList"
/> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
<!-- 包装信息 -->
<ListTable ref="listTableRef" titleName="包装信息" />
<ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionMain.allSchemas"
:detailAllSchemas="InspectionRequestPackage.allSchemas" :detailAllSchemasRules="InspectionRequestPackageRules"
:list="list" @ListTableSubmit='ListTableSubmit'/>
</div>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionMain, InspectionMainRules,InspectionRequestPackage,InspectionRequestPackageRules } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as InspectionRequestPackageApi from '@/api/qms/inspectionRequest/InspectionRequestPackage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ListTable from '@/components/ListTable/src/ListTable.vue'
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 { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data'
defineOptions({ name: 'InspectionMain' })
@ -157,12 +165,13 @@
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-request-main:submit' }), //
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:refused' }), //
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:agree' }), //
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']), hasPermi: 'qms:inspection-request-main:handle' }), //
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']), hasPermi: 'qms:inspection-request-main:handle' }), //
defaultButtons.mainListPackageBtn(null), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-request-main:edit'}), //
]
}
const listTableRef = ref()
const list = ref([])
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
@ -180,8 +189,9 @@ const listTableRef = ref()
} else if (val == 'edit') { //
openForm('update', row)
}else if (val == 'mainPackage') { //
const list = await InspectionMainApi.getInspectionRequestPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionRequestPackage.allSchemas.tableColumns,list)
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(row.id)
// row.status = '1'
listTableRef.value.openPackage(row,'包装信息',InspectionRequestPackage.allSchemas.tableColumns)
}
}
@ -374,6 +384,20 @@ const handleAddTable = () => {
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
const ListTableSubmit =async (formType,data)=>{
console.log(formType,data)
if (formType === 'create') {
await InspectionRequestPackageApi.createInspectionRequestPackage(data)
message.success(t('common.createSuccess'))
} else if(formType === 'updete') {
await InspectionRequestPackageApi.updateInspectionRequestPackage(data)
message.success(t('common.updateSuccess'))
}else {
await InspectionRequestPackageApi.deleteInspectionRequestPackage(data.id)
message.success(t('common.updateSuccess'))
}
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(data.masterId)
}
/** 初始化 **/
onMounted(async () => {

17
src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

@ -433,7 +433,12 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
table:{
width:200
},
isTableForm:false
isTableForm:false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '包装号',
@ -487,4 +492,14 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
width:150
}
},
{
label: '操作',
field: 'action',
isForm: false,
isTable:true,
table: {
width: 120,
fixed: 'right'
}
}
]))

4
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue

@ -163,8 +163,8 @@ const butttondata = (row,$index) => {
return []
}
return [
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag === false }),//
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag === false }),//
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
]
}

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

@ -352,7 +352,6 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -561,7 +560,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -584,7 +582,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '包装规格',
field: 'packUnit',
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -608,7 +605,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'supplierUom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -621,7 +617,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -787,7 +782,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'failedReason',
dictType: DICT_TYPE.PURCHASE_RETURN_REASON,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -846,7 +840,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {

66
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -20,8 +20,8 @@
/>
<!-- 列表 -->
<ContentWrap>
<Table
<ContentWrap >
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -146,6 +146,10 @@
<span>1111</span>
</template>
</BasicForm>
<!-- 标签打印 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template>
@ -159,7 +163,8 @@ import {
SupplierdeliverRequestMainRules,
SupplierdeliverRequestDetail,
SupplierdeliverRequestDetailRules,
SupplierdeliverRequestDetailLabel
SupplierdeliverRequestDetailLabel,
SupplierdeliverRequestPackage
} from './supplierdeliverRequestMain.data'
import {   SupplierdeliverInspectionDetail} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
@ -168,6 +173,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail'
import * as PackageApi from '@/api/wms/package'
import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data'
import { addDay } from '@/utils/formatTime'
@ -752,8 +758,60 @@ const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
//
const searchTableRef = ref()
const labelPrint = async (row) => {
window.open(src.value + '&asn_number=' + row.asnNumber)
tableObject.loading = true
const subTableDFata = await PackageApi.getLabel(row.masterId)
tableObject.loading = false
const tableObject1 = {
//
currentPage: 1,
//
exportLoading: false,
//
loading: false,
//
pageSize: subTableDFata.length,
params:null,
//
sort: {
order: '', //
prop: '' //
},
//
total: subTableDFata.length,
//
tableList: subTableDFata,
currentRow:null
}
console.log("标签打印",subTableDFata,tableObject1,SupplierdeliverRequestPackage.allSchemas)
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("采购收货记录单号",tableObject1,{tableColumns},true)
// window.open(src.value + '&asn_number=' + row.asnNumber)
}
//
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => {
let rows:any = []
val.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.id)]
})
if(rows.length == 0){
message.warning("请先选择要打印的数据!")
return
}
await PackageApi.batchPrintingLable(rows.join(',')).then(res => {
console.log(res)
window.open(src.value + '&asn_number=' + res)
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
const print = async () => {

52
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -857,7 +857,6 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
@ -1662,4 +1661,55 @@ export const UploadQualityReport = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
]))
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
},
]))

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

@ -90,7 +90,7 @@
}]"
annexAliasLabel="其他附件"
:otherHeadButttonData="[{
label: '打印',
label: '打印明细',
name: 'printing',
hide: false,
type: 'primary',
@ -98,6 +98,26 @@
color: '',
float:'left',
hasPermi: ''
},{
label: '打印全部发货单',
name: 'printing-all',
hide: false,
type: 'primary',
// icon: 'ep:operation',
color: '',
float:'left',
hasPermi: ''
}]"
:buttondataTable = "[{
label: '打印',
name: 'print',
hide: false,
type: 'primary',
// icon: 'ep:operation',
color: '',
float:'left',
link: true, //
hasPermi: ''
}]"
:isBasic="false"
:allSchemas="SupplierinvoiceRequestMain.allSchemas"
@ -110,6 +130,7 @@
:apiDelete="SupplierinvoiceRequestDetailApi.deleteSupplierinvoiceRequestDetail"
:Echo="Echo"
@buttonBaseClick="detailButtonBaseClick"
@tableFormButton="tableFormButton"
/>
<!-- 导入 -->
@ -632,9 +653,18 @@ const importSuccess = () => {
if(val == 'printing'){
//
handleDocumentPrint(clicKRowId.value)
}else if(val === 'printing-all'){
//
}
}
const tableFormButton = (val, item) => {
console.log("点击的按钮",val)
if(val == 'print'){
//
}
}
//
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const documentSrc = ref(BASE_URL + '/jmreport/view/936875675614240768?token=' + getAccessToken())

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

@ -1005,7 +1005,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
isDetail: false,
isForm: false,
table: {
width: 150,
width: 250,
fixed: 'right'
},
hiddenInMain:true,

Loading…
Cancel
Save