zhang_li 11 months ago
parent
commit
61a499ce9b
  1. 2
      src/views/wms/basicDataManage/itemManage/bom/bom.data.ts
  2. 6
      src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts
  3. 10
      src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue
  4. 469
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

2
src/views/wms/basicDataManage/itemManage/bom/bom.data.ts

@ -262,9 +262,11 @@ export const BomRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
version: [
{ required: true, message: '请输入版本', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
layer: [
{ required: true, message: '请输入层级', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [

6
src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts

@ -439,6 +439,12 @@ export const rules = reactive({
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
],
desc1: [
{ required: true, message: '请输入描述1', trigger: 'blur' }
],
desc2: [
{ required: true, message: '请输入描述2', trigger: 'blur' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],

10
src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue

@ -264,6 +264,7 @@ import * as RuleApi from '@/api/wms/rule'
import { isString } from '@/utils/is'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { json } from 'stream/consumers'
const { t } = useI18n() //
const message = useMessage() //
@ -450,6 +451,10 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const emit = defineEmits(['success']) // success
const hasSameData = (array)=>{
const set = new Set(array.map(JSON.stringify))
return set.size !== array.length
}
const submitForm = async () => {
//
inputBlur()
@ -460,6 +465,10 @@ const submitForm = async () => {
message.error('优先级不可以为0')
return
}
if (hasSameData( formData.value.configuration.ManagementPrecision)) {
message.error('规则配置数据重复,请重新填写')
return;
}
//
formLoading.value = true
try {
@ -480,6 +489,7 @@ const submitForm = async () => {
Value:str
}
})
let data = {
id: formData.value.id,
strategyCode: formData.value.strategyCode, //

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

@ -1,58 +1,96 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
<Search
:schema="SupplierdeliverRequestMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" :tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules" :tableData="tableData"
<BasicForm
ref="formRef"
@success="getList"
:rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas"
:tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules"
:tableData="tableData"
:apiUpdate="SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain"
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail"
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail"
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage"
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" />
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import"
:importTemplateData="importTemplateData" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true"
:mode="2" />
<ImportForm
ref="importFormRef"
url="/wms/supplierdeliver-request-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
<!-- 打印 -->
<point ref='pointRef' :detailListTableColumns='detailListTableColumns' />
<point ref="pointRef" :detailListTableColumns="detailListTableColumns" />
<!-- <el-dialog v-model="dialogVisible" :title="dialogTitle" width="60%">
<Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading" :pagination="{
total: detatableData.total
@ -70,35 +108,40 @@
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { SupplierdeliverRequestMain, SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import point from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/point.vue'
// import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import {
SupplierdeliverRequestMain,
SupplierdeliverRequestMainRules,
SupplierdeliverRequestDetail,
SupplierdeliverRequestDetailRules
} from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import point from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/point.vue'
// import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
@ -115,35 +158,35 @@
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -152,40 +195,48 @@
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
}
} else if (val == 'filtrate') {
//
}
}
//
const isShowMainButton = (row, val) => {
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
}
// -
const butttondata = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']),hasPermi: 'wms:supplierdeliver-request-main:update' }), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:supplierdeliver-request-main:update'
}), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), //
{
label: '生成标签',
@ -195,7 +246,7 @@
icon: '',
color: '',
hasPermi: '',
link: true, //
link: true //
},
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3']) }), //
defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3']) }), //
@ -208,52 +259,63 @@
icon: '',
color: '',
hasPermi: '',
link: true, //
},
]
link: true //
}
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') {
//
handleOpe(row.id)
} else if (val == 'mainPurPlanClo') {//
} else if (val == 'mainPurPlanClo') {
//
handleClo(row.id)
} else if (val == 'mainPlanSub') { //
} else if (val == 'mainPlanSub') {
//
handleSub(row.id)
} else if (val == 'mainPlanApp') { //
} else if (val == 'mainPlanApp') {
//
handleApp(row.id)
} else if (val == 'mainPlanTur') { //
} else if (val == 'mainPlanTur') {
//
handleTur(row.id)
} else if (val == 'genRecords') { //
} else if (val == 'genRecords') {
//
genRecords(row.id)
} else if (val == 'edit') { //
} else if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'ssbq') { //
} else if (val == 'ssbq') {
//
handlePoint(row)
} else if (val == 'point') { //
} else if (val == 'point') {
//
labelPrint(row)
} else if (val == 'documentPrint') { //
} else if (val == 'documentPrint') {
//
handleDocumentPrint(row.id)
}
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
///
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
}
///
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
@ -262,11 +324,11 @@
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
} catch {}
}
/** 关闭按钮操作 */
const handleClo = async (id : number) => {
/** 关闭按钮操作 */
const handleClo = async (id: number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
@ -275,11 +337,11 @@
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
} catch {}
}
/** 打开按钮操作 */
const handleOpe = async (id : number) => {
/** 打开按钮操作 */
const handleOpe = async (id: number) => {
try {
//
await message.confirm('是否打开所选中数据?')
@ -288,11 +350,11 @@
message.success(t('打开成功!'))
//
await getList()
} catch { }
}
} catch {}
}
/** 提交审批按钮操作 */
const handleSub = async (id : number) => {
/** 提交审批按钮操作 */
const handleSub = async (id: number) => {
try {
//
await message.confirm('是否提交审批所选中数据?')
@ -301,11 +363,11 @@
message.success(t('提交审批成功!'))
//
await getList()
} catch { }
}
} catch {}
}
/** 审批通过按钮操作 */
const handleApp = async (id : number) => {
/** 审批通过按钮操作 */
const handleApp = async (id: number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
@ -314,11 +376,11 @@
message.success(t('审批通过成功!'))
//
await getList()
} catch { }
}
} catch {}
}
/** 驳回按钮操作 */
const handleTur = async (id : number) => {
/** 驳回按钮操作 */
const handleTur = async (id: number) => {
try {
//
await message.confirm('是否驳回所选中数据?')
@ -327,11 +389,11 @@
message.success(t('驳回成功!'))
//
await getList()
} catch { }
}
} catch {}
}
/** 处理按钮操作 */
const genRecords = async (id : number) => {
/** 处理按钮操作 */
const genRecords = async (id: number) => {
try {
//
await message.confirm('是否处理所选中数据?')
@ -340,37 +402,46 @@
message.success(t('处理成功!'))
//
await getList()
} catch { }
}
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams)
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(
setSearchParams
)
download.excel(data, '供应商发货申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间')
const dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () => {
}
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(
(item) =>
item.label != '操作' &&
item.label != '创建者' &&
item.label != '创建时间' &&
item.label != '最后更新者' &&
item.label != '最后更新时间'
)
const dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () => {
dialogVisible.value = false
isShow.value = false
}
}
/** 生成标签按钮操作 */
const genLabel = async () => {
/** 生成标签按钮操作 */
const genLabel = async () => {
try {
//
await message.confirm('是否为此数据生成标签?')
@ -381,25 +452,24 @@
message.success(t('生成标签成功!'))
//
await getList()
} catch { }
}
} catch {}
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/897700407827668992?token=' + getAccessToken())
const genLabelId = ref();
//
const pointRef = ref()
const handlePoint = async (row) => {
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/897700407827668992?token=' + getAccessToken())
const genLabelId = ref()
//
const pointRef = ref()
const handlePoint = async (row) => {
pointRef.value.openPoint(row.id)
}
//
const labelPrint = async (row) => {
}
//
const labelPrint = async (row) => {
window.open(src.value + '&asn_number=' + row.asnNumber)
}
}
const print = async () => {
const print = async () => {
//
// const packageArray:any= ref([])
// let packageObject = {
@ -477,36 +547,41 @@
// })
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
window.open(src.value + '&number=' + detatableData.tableList[0].number)
}
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}
}
/**
/**
* tableForm方法
*/
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
})
const tableData = ref([])
//
const handleAddTable = () => {
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
}
//
const submitForm = async (formType, data) => {
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
let isHave = data.subList.some((item) => item.produceDate > item.expireDate)
if (isHave) {
message.error('生产日期不可以大于过期日期')
formRef.value.formLoading = false
return
}
try {
if (formType === 'create') {
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
@ -521,37 +596,37 @@
} finally {
formRef.value.formLoading = false
}
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
}
//
const importTemplateData = reactive({
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xlsx'
})
})
//
const importSuccess = () => {
//
const importSuccess = () => {
getList()
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
})
</script>

Loading…
Cancel
Save