Browse Source

采购任务修改

master
zhaoxuebing 9 months ago
parent
commit
1bd5d352a7
  1. 5
      src/api/wms/purchasereceiptRequestMain/index.ts
  2. 29
      src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue
  3. 97
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  4. 542
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts
  5. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

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

@ -106,3 +106,8 @@ export const refusedPurchasereceiptRequestMain = async (id) => {
export const handlePurchasereceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/handle?id=` + id })
}
// 生成标签
export const genLabel = async (id) => {
return await request.post({ url: `/wms/purchasereceipt-request-main/genLabel?id=` + id })
}

29
src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue

@ -127,22 +127,22 @@
<el-row gutter="10">
<el-col :span="24">
<el-form-item label="不拆分">
<el-switch v-model="formData.configuration.NotGroup" active-value="TRUE" inactive-value="FALSE" chang = "changeGroup"/>
<el-switch v-model="formData.configuration.NotGroup" active-value="TRUE" inactive-value="FALSE" @change="changeGroup"/>
</el-form-item>
<!-- 按零件拆分 -->
<el-form-item label="按零件拆分">
<el-switch v-model="formData.configuration.ByItem" active-value="TRUE" inactive-value="FALSE"/>
<el-switch v-model="formData.configuration.ByItem" active-value="TRUE" inactive-value="FALSE" @change="changeGroup"/>
</el-form-item>
<!-- 按库位拆分 -->
<el-form-item label="按库位拆分">
<el-switch v-model="formData.configuration.ByLocation" active-value="TRUE" inactive-value="FALSE"/>
<el-switch v-model="formData.configuration.ByLocation" active-value="TRUE" inactive-value="FALSE" @change="changeGroup"/>
</el-form-item>
<!--按器具拆分-->
<el-form-item label="按器具拆分">
<el-switch v-model="formData.configuration.ByContainer" active-value="TRUE" inactive-value="FALSE"/>
<el-switch v-model="formData.configuration.ByContainer" active-value="TRUE" inactive-value="FALSE" @change="changeGroup"/>
</el-form-item>
<!-- 每个任务明细数量 -->
<el-form-item label="每个任务明细数量">
<el-form-item label="每个任务明细数量" v-show="false">
<el-input-number v-model="formData.configuration.JobDetailCount" :min="0" />
</el-form-item>
</el-col>
@ -283,11 +283,20 @@ const changeSupplierType = (e) => {
}
const changeGroup = () =>{
console.log(formData.configuration.NotGroup.value);
if(formData.configuration.NotGroup.value = "TRUE"){
formData.configuration.ByItem.value = "FALSE"
formData.configuration.ByLocation.value = "FALSE"
formData.configuration.ByContainer.value = "FALSE"
if(formData.value.configuration.NotGroup == 'TRUE'){
formData.value.configuration.ByItem = 'FALSE'
formData.value.configuration.ByLocation = 'FALSE'
formData.value.configuration.ByContainer = 'FALSE'
}else{
if(formData.value.configuration.ByItem == 'TRUE'){
formData.value.configuration.NotGroup == 'FALSE'
}
if(formData.value.configuration.ByLocation == 'TRUE'){
formData.value.configuration.NotGroup == 'FALSE'
}
if(formData.value.configuration.ByContainer == 'TRUE'){
formData.value.configuration.NotGroup == 'FALSE'
}
}
}
getFormSupplierList()

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

@ -75,24 +75,44 @@
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchasereceipt-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<!-- 创建标签 -->
<BasicForm
ref="formLabelRef"
@success="getList"
:tableAllSchemas="PurchasereceiptRequestDetailLabel.allSchemas"
:tableFormRules="PurchasereceiptRequestDetailRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
@submitForm="submitFormLabel"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { PurchasereceiptRequestMain,PurchasereceiptRequestMainRules,PurchasereceiptRequestDetail,PurchasereceiptRequestDetailRules } from './purchasereceiptRequestMain.data'
import {
PurchasereceiptRequestMain,
PurchasereceiptRequestMainRules,
PurchasereceiptRequestDetail,
PurchasereceiptRequestDetailRules,
PurchasereceiptRequestDetailLabel,
} from './purchasereceiptRequestMain.data'
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain'
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { getAccessToken } from '@/utils/auth'
//
defineOptions({ name: 'PurchasereceiptRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const genLabelId = ref(); //ID
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
@ -102,7 +122,6 @@ const apiPage = ref(PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDet
const detailAllSchemas = ref(PurchasereceiptRequestDetail.allSchemas)
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -126,11 +145,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['uom'] = val[0]['uom']
let supplierCode = formRef.formModel.supplierCode;
let itemCode = val[0]['itemCode']
let queryData:SupplieritemApi.SupplieritemVO={
let queryData = {
supplierCode:supplierCode,
itemCode:itemCode
}
SupplieritemApi.getDefaultLocationCode(queryData).then(res =>{
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
row['defaultToLocationCode'] = res
})
}else if (formField == 'packQty'){
@ -208,16 +227,38 @@ const isShowMainButton = (row,val) => {
}
}
//
const isASNShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
if(row.sourceType == 'ASN_ExternalReceipt'){
return false
}
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), //
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.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), //
// defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:update'}), //
{
label: '生成标签',
name: 'ssbq',
hide: isASNShowMainButton(row, ['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true //
},
defaultButtons.mainListPointBtn({ hide: isASNShowMainButton(row, ['3','8']) }), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), //
]
}
@ -237,9 +278,51 @@ const buttonTableClick = async (val, row) => {
handleHandle(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if(val == 'ssbq'){ //
//
detatableData.params = {
masterId:row.id
}
genLabelId.value = row.id
await getDetailList()
formLabelRef.value.open('create', row, null,'createLabel')// createLabel
}else if (val == 'point') {
//
labelPrint(row)
}
}
//
const isCreateLabel = ref(false)
const formLabelRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
//
const submitFormLabel = async (formType, data) => {
try {
await message.confirm('是否为此数据生成标签?')
await PurchasereceiptRequestMainApi.genLabel(genLabelId.value)
isCreateLabel.value = true
message.success('创建标签成功')
} finally {
formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false
}
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
//
const labelPrint = async (row) => {
window.open(src.value + '&asn_number=' + row.asnNumber)
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {

542
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -463,7 +463,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isDetail: false,
isForm: false,
table: {
width: 230,
width: 300,
fixed: 'right'
},
}
@ -1108,3 +1108,543 @@ export const PurchasereceiptRequestDetailRules = reactive({
})
export const PurchasereceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
message: '请选择供应商!',
isMainValue: true
}]
},
form: {
labelMessage: '该订单号会影响订单行的选择',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
message: '请选择供应商!',
isMainValue: true
}]
}
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
isSearchList: false, // 开启查询弹窗
searchListPlaceholder: '请选择订单行', // 输入框占位文本
searchField: 'lineNumber', // 查询弹窗赋值字段
searchTitle: '订单信息', // 查询弹窗标题
searchAllSchemas: PurchaseDetail.allSchemas, // 查询弹窗所需类
searchPage: PurchaseDetailApi.getPurchaseDetailPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'number',
value:'poNumber',
message: '请填写订单号!',
isMainValue: true
}]
}
},
tableForm:{
disabled:true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择订单行', // 输入框占位文本
searchField: 'lineNumber', // 查询弹窗赋值字段
searchTitle: '订单信息', // 查询弹窗标题
searchAllSchemas: PurchaseDetail.allSchemas, // 查询弹窗所需类
searchPage: PurchaseDetailApi.getPurchaseDetailPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'number',
value:'poNumber',
message: '请填写订单号!',
isMainValue: true
}]
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
isTableForm: true,
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
isTableForm: true,
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
disabled:true,
min: 1,
precision: 6
},
},
tableForm: {
disabled:true,
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '默认到库位代码',
field: 'defaultToLocationCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
isSearchList: false, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm:{
disabled:true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: false
},
{
label: '生产日期',
field: 'produceDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
disabled:true,
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
tableForm:{
disabled:true,
type:'FormDate',
placeholder: '请选择生产日期',
valueFormat: 'x',
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '到货日期',
field: 'arriveDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
disabled: true,
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
tableForm:{
disabled: true,
type:'FormDate',
placeholder: '请选择到货日期',
valueFormat: 'x',
},
},
{
label: '过期日期',
field: 'expireDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
disabled: true,
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
tableForm:{
disabled: true,
type:'FormDate',
placeholder: '请选择过期日期',
valueFormat: 'x',
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
tableForm: {
type: 'Select'
}
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true,
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
},
{
label: '包装规格',
field: 'packUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
},
{
label: '供应商计量数量',
field: 'supplierPackQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
disabled: true,
min: 1,
precision: 6
},
},
isTableForm: false,
isForm: false
},
{
label: '供应商计量单位',
field: 'supplierPackUnit',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
tableForm: {
type: 'Select'
}
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
disabled: true,
min: 0
},
},
isTableForm: false,
isForm: false
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
]))

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

@ -543,7 +543,6 @@ const { getList:getDetailList } = detatableMethods
//
const submitFormLabel = async (formType, data) => {
try {
console.log("data",data)
await message.confirm('是否为此数据生成标签?')
await SupplierdeliverRequestMainApi.genLabel(genLabelId.value)
isCreateLabel.value = true

Loading…
Cancel
Save