ljlong_2630 3 days ago
parent
commit
b1c4859f99
  1. 29
      src/api/wms/customerSaleInvoiceDetail/index.ts
  2. 41
      src/api/wms/customerSaleInvoiceMain/index.ts
  3. 12
      src/api/wms/purchaseClaimRequestDetail/index.ts
  4. 9
      src/api/wms/purchaseClaimRequestMain/index.ts
  5. 24
      src/components/Detail/src/Detail.vue
  6. 5
      src/utils/dict.ts
  7. 2
      src/views/infra/outerApiHis/index.vue
  8. 13
      src/views/wms/basicDataManage/customerManage/customer/customer.data.ts
  9. 1
      src/views/wms/basicDataManage/itemManage/bom/bom.data.ts
  10. 5
      src/views/wms/basicDataManage/itemManage/itembasic/index.vue
  11. 1
      src/views/wms/basicDataManage/itemManage/itempackage/index.vue
  12. 36
      src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts
  13. 42
      src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue
  14. 45
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  15. 13
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue
  16. 103
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts
  17. 56
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue
  18. 255
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue
  19. 142
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts
  20. 391
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue
  21. 65
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  22. 1
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts
  23. 4
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts
  24. 12
      src/views/wms/productionManage/productredress/productredressRequestMain/index.vue
  25. 15
      src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts
  26. 62
      src/views/wms/purchasereceiptManage/bspurchasereceipt/bsPurchasereceiptRecordMain/purchasereceiptRecordMain.data.ts
  27. 2
      src/views/wms/purchasereceiptManage/developpurchasereceipt/developPurchasereceiptRequestMain/index.vue
  28. 2
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  29. 2
      src/views/wms/purchasereceiptManage/toolpurchasereceipt/toolPurchasereceiptRequestMain/index.vue
  30. 10
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts
  31. 28
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts
  32. 102
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue
  33. 1
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  34. 61
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
  35. 16
      src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue

29
src/api/wms/customerSaleInvoiceDetail/index.ts

@ -27,6 +27,17 @@ export const getCustomerSaleInvoiceDetailPage = async (params) => {
return await request.get({ url: `/wms/customer-sale-invoice-detail/page`, params })
}
}
// 查询客户销售开票子信息表(WMS)列表
export const getCustomerSaleInvoiceRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-sale-invoice-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/customer-sale-invoice-record-detail/page`, params })
}
}
// 查询客户销售开票子信息表(WMS)详情
export const getCustomerSaleInvoiceDetail = async (id: number) => {
@ -49,8 +60,22 @@ export const deleteCustomerSaleInvoiceDetail = async (id: number) => {
}
// 导出客户销售开票子信息表(WMS) Excel
export const exportCustomerSaleInvoiceDetail = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params })
export const exportCustomerSaleInvoiceRequestDetail = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-detail/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params })
}
}
// 导出客户销售开票子信息表(WMS) Excel
export const exportCustomerSaleInvoiceRecordDetail = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-record-detail/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-record-detail/export-excel`, params })
}
}
// 下载用户导入模板

41
src/api/wms/customerSaleInvoiceMain/index.ts

@ -48,11 +48,24 @@ export const deleteCustomerSaleInvoiceMain = async (id: number) => {
return await request.delete({ url: `/wms/customer-sale-invoice-main/delete?id=` + id })
}
// 导出客户销售开票主信息表(WMS) Excel
// 导出设备制造商 Excel
export const exportCustomerSaleInvoiceMain = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params })
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-main/export-excel`, params })
}
}
// 导出销售开票记录 Excel
export const exportCustomerSaleInvoiceRecordMain = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/wms/customer-sale-invoice-record-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/customer-sale-invoice-record-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' })
@ -62,9 +75,27 @@ export const importTemplate = () => {
export const getCustomerSaleInvoiceRecodeMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
// const data = {...params}
// return await request.post({ url: '/wms/customer-sale-invoice-main/senior', data })
const data = {...params}
return await request.post({ url: '/wms/customer-sale-invoice-record-main/senior', data })
} else {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/page`, params })
}
}
// 销售开票申请 发布功能
export const publish = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-main/publish?id=` + id})
}
// 销售开票申请 作废功能
export const nodeAbrogate = async (id: number) => {
return await request.get({ url: `/wms/customer-sale-invoice-main/nodeAbrogate?id=` + id})
}
// 从客户对账单中获取客户代码 -- 销售申请
export const getCustomerList = async () => {
return await request.get({ url: `/wms/customer-statement-main/getCustomerList`})
}
// 从客户对账单中获取客户代码 -- 销售记录
export const getRecordCustomerList = async () => {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/getCustomerList`})
}

12
src/api/wms/purchaseClaimRequestDetail/index.ts

@ -15,29 +15,29 @@ export const getPurchaseClaimRequestDetailList = async (supplierCode) => {
}
// 创建采购索赔子
export const createPurchaseClaimRequestDetail = async (data) => {
return await request.post({ url: `/wms/purchase-claim-request-detail/create`, data })
return await request.post({ url: `/wms/purchaseClaim-request-detail/create`, data })
}
// 修改采购索赔子
export const updatePurchaseClaimRequestDetail = async (data) => {
return await request.put({ url: `/wms/purchase-claim-request-detail/update`, data })
return await request.put({ url: `/wms/purchaseClaim-request-detail/update`, data })
}
// 删除采购索赔子
export const deletePurchaseClaimRequestDetail = async (id) => {
return await request.delete({ url: `/wms/purchase-claim-request-detail/delete?id=` + id })
return await request.delete({ url: `/wms/purchaseClaim-request-detail/delete?id=` + id })
}
// 获得采购索赔子
export const getPurchaseClaimRequestDetail = async (id) => {
return await request.get({ url: `/wms/purchase-claim-request-detail/get?id=` + id })
return await request.get({ url: `/wms/purchaseClaim-request-detail/get?id=` + id })
}
// 导出采购索赔子 Excel
export const exportPurchaseClaimRequestDetailExcel = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({url: `/wms/purchase-claim-request-detail/export-excel-senior`, data})
return await request.downloadPost({ url: `/wms/purchaseClaim-request-detail/export-excel-senior`, data})
} else {
return await request.download({ url: `/wms/purchase-claim-request-detail/export-excel`, params })
return await request.download({ url: `/wms/purchaseClaim-request-detail/export-excel`, params })
}
}

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

@ -44,6 +44,15 @@ export const deletePurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/delete?id=` + id })
}
// 关闭审批采购索赔
export const closePurchaseClaimRequestMain = async (id: number) => {
return await request.put({ url: `/wms/purchaseClaim-request-main/close?id=` + id })
}
// 关闭审批采购索赔
export const reAddPurchaseClaimRequestMain = async (id: number) => {
return await request.put({ url: `/wms/purchaseClaim-request-main/reAdd?id=` + id })
}
// 提交审批采购索赔
export const subPurchaseClaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseClaim-request-main/sub?id=` + id })

24
src/components/Detail/src/Detail.vue

@ -476,6 +476,12 @@ const props = defineProps({
required: false,
default: 8
},
//
isChangeDetailDrawer:{
type:Array,
required: false,
default: () => []
},
})
const allSchemas = ref(props.allSchemas)
const detailAllSchemasRef = ref(props.detailAllSchemas)
@ -1015,9 +1021,23 @@ const buttonTableClick = async (val, row) => {
}
}
/** 添加/修改操作 */
//
const isShowChangeDetailDrawer = (row, val) => {
if(!val || val &&val.length == 0) return false;
if (val.indexOf(row.status) > -1) {
return true
} else {
return false
}
}
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row)
//
if (isShowChangeDetailDrawer(curRow.value,props.isChangeDetailDrawer)) {
emit('detailOpenForm', type, row, masterParmas.value)
}else{
formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row)
}
}
// form
const submitForm = async (formType, data) => {

5
src/utils/dict.ts

@ -283,6 +283,7 @@ export enum DICT_TYPE {
CONTAINER_STATUS = 'container_status', // 容器状态
PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型
PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型
PACK_DATA_SOURCE = 'pack_data_source', // 物料包装数据来源
TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因
PURCHASERECEIPT_SOURCE_TYPE = 'purchasereceipt_source_type', //采购收货数据来源
PLAN_PRODUCTION_TYPE = 'plan_production_type', // 生产计划类型
@ -410,5 +411,7 @@ export enum DICT_TYPE {
RECEIVE_STATUS = 'receive_status', // 收货确认状态
LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典)
CUSTOMER_STATEMENT_TYPE = 'customer_statement_type', // wms客户对账单 模具分摊状态
DELIVER_METHOD = 'deliver_method'
DELIVER_METHOD = 'deliver_method',
CUSTOMER_SALE_INVOICE_TYPE = 'customer_saleInvoice_type' // 销售开票
}

2
src/views/infra/outerApiHis/index.vue

@ -128,7 +128,7 @@ const butttondata = (row) =>{
return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:outerApiHis:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:outerApiHis:delete'}), //
defaultButtons.retryBtn({hide: row.times >= 3}), //
defaultButtons.retryBtn({hide: row.times >= 3 || row.success}), //
]
}

13
src/views/wms/basicDataManage/customerManage/customer/customer.data.ts

@ -18,6 +18,16 @@ export const Customer = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'left'
},
},
{
label: '顺引代码',
field: 'shunyinCode',
isSearch: true,
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
@ -294,6 +304,9 @@ export const CustomerRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator:validateYS, message: '请输入正确的代码', trigger: 'blur'}
],
shunyinCode: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],

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

@ -151,6 +151,7 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
label: '层级',
field: 'layer',
sort: 'custom',
isTable:false,
// form: {
// component: 'Input',
// componentProps: {

5
src/views/wms/basicDataManage/itemManage/itembasic/index.vue

@ -371,11 +371,14 @@ const changeTabs = (item) => {
tabsExtend.value = false
allSchemas.value = Itembasic.allSchemas
}
detailAllSchemas.value.tableColumns.map((item,index) => {
if (detailAllSchemas.value && detailAllSchemas.value.tableColumns) {
detailAllSchemas.value.tableColumns.map((item,index) => {
if (item.field == 'action') {
detailAllSchemas.value.tableColumns.splice(index,1)
}
})
}
//
tableObjectExtend.value = [{
key: 'itemCode',

1
src/views/wms/basicDataManage/itemManage/itempackage/index.vue

@ -357,6 +357,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
const setV = {}
setV[formField] = val[0][searchField]
if('itemCode'==formField){
setV['itemName'] = val[0]['name']
setV['uom'] = val[0]['uom']
}
if('packUnit'==formField){

36
src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts

@ -46,6 +46,24 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
form: {
componentProps: {
disabled: true
}
},
isTable:true,
isTableForm:true,
isForm:true,
isDetail:true
},
{
label: '计量单位',
field: 'uom',
@ -56,7 +74,8 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
isTable: true,
table: {
width: 120
},form: {
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true
@ -231,10 +250,25 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
field: 'dataSource',
sort: 'custom',
isForm:false,
dictType: DICT_TYPE.PACK_DATA_SOURCE,
dictClass: 'string',
table: {
width: 180
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
isTable:true,
isTableForm:true,
isForm:true,
isDetail:true
},
{
label: '创建时间',
field: 'createTime',

42
src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue

@ -167,14 +167,13 @@
v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料"
v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 选择供应商和客户 -->
<el-form-item key="供应商和客户formItem" label="客户" class="err-240" v-if="index == 1">
@ -483,6 +482,8 @@ import * as TransactiontypeApi from '@/api/wms/transactiontype'
import { Transactiontype } from '@/views/wms/basicDataManage/documentSetting/transactiontype/transactiontype.data'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic} from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { Customer, CustomerRules } from '@/views/wms/basicDataManage/customerManage/customer/customer.data'
import * as CustomerApi from '@/api/wms/customer'
@ -605,7 +606,7 @@ const options = reactive({
{ value: 'ItemType', label: '物料类型' },
{ value: 'ItemGroup', label: '物料分组' },
{ value: 'ItemCode', label: '物料' },
{ value: 'Project', label: '项目' },
// { value: 'Project', label: '' },
{ value: 'AbcClass', label: 'ABC类' },
{ value: 'ItemStatus', label: '物料状态' }
],
@ -853,6 +854,21 @@ const blurCustomerList = async ()=>{
}
}
}
//
const searchItemCode = ()=>{
searchTableRef.value.open(
'请选择物料',
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
'ItemCode',
'code',
true,
undefined,
undefined,
undefined
)
}
// 线
const searchTransactionType = ()=>{
searchTableRef.value.open(
@ -960,6 +976,14 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
}
return
}
if(formField=='ItemCode'){
// --
let itemCode = formData.value.condition.find(item=>item['ParamCode']=='ItemCode')
if(itemCode){
itemCode.Value = val.map(item=>(item['code'])).join(',')
}
return
}
// let searchTableTitle = warehouseType.value == 'WarehouseCode'?'':warehouseType.value == 'AreaCode'?'':warehouseType.value == 'LocationGroupCode'?'':warehouseType.value == 'LocationCode'?'':''
console.log('searchTableSuccess',formField, searchField, val, type, row)
console.log(val.map(item=>(item['code'])).join(','))

45
src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

@ -215,14 +215,13 @@
v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料"
v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
:disabled="formData.priority==0&&formType=='update'"
/>
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value">
<template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 选择重量体积还是面积 -->
<!-- <el-form-item key="重量体积或面积formItem" label="" label-width="0" class="err-240" v-if="index == 2">-->
@ -680,7 +679,8 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as TransactiontypeApi from '@/api/wms/transactiontype'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic} from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
const { t } = useI18n() //
const message = useMessage() //
@ -792,7 +792,7 @@ const options = reactive({
{ value: 'ItemType', label: '物料类型' },
{ value: 'ItemGroup', label: '物料分组' },
{ value: 'ItemCode', label: '物料' },
{ value: 'Project', label: '项目' },
// { value: 'Project', label: '' },
{ value: 'AbcClass', label: 'ABC类' },
{ value: 'ItemStatus', label: '物料状态' }
],
@ -1009,6 +1009,23 @@ const blurWarehouse = async ()=>{
})
}
//
const searchItemCode = ()=>{
searchTableRef.value.open(
'请选择物料',
Itembasic.allSchemas,
ItembasicApi.getItembasicPage,
'ItemCode',
'code',
true,
undefined,
undefined,
undefined
)
}
//
const searchTransactionType = ()=>{
searchTableRef.value.open(
@ -1108,6 +1125,14 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
}
return
}
if(formField=='ItemCode'){
// --
let itemCode = formData.value.condition.find(item=>item['ParamCode']=='ItemCode')
if(itemCode){
itemCode.Value = val.map(item=>(item['code'])).join(',')
}
return
}
// let searchTableTitle = warehouseType.value == 'WarehouseCode'?'':warehouseType.value == 'AreaCode'?'':warehouseType.value == 'LocationGroupCode'?'':warehouseType.value == 'LocationCode'?'':''
console.log('searchTableSuccess',formField, searchField, val, type, row)
console.log(val.map(item=>(item['code'])).join(','))

13
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

@ -82,7 +82,7 @@
<!-- 仓库 -->
<el-input style="flex:1" v-show="item.ParamCode == 'WarehouseCode'" placeholder="请选择从仓库" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'WarehouseCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse({module:'condition',type:'WarehouseCode'})">
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse({module:'condition',type:'WarehouseCode'})">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
@ -1045,6 +1045,7 @@ const blurWarehouse = async ({module='config',type})=>{
return
}
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
verifyRes = await WarehouseApi.verifyWarehouse({
@ -1059,13 +1060,13 @@ const blurWarehouse = async ({module='config',type})=>{
console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
let verifyRes = await LocationgroupApi.verifyLocationgroup({
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
let verifyRes = await LocationApi.verifyLocation({
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
@ -1240,7 +1241,11 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.condition = JSON.parse(data.condition)
formData.value.condition.forEach((item, index) => {
if ((item.Operator == 'IN' || item.Operator == 'NOT IN')&& !Array.isArray(item.Value)) {
item.Value = item.Value.split(',')
if (item.ParamCode != 'WarehouseCode' && item.ParamCode != 'AreaCode' && item.ParamCode != 'LocationGroupCode' && item.ParamCode != 'LocationCode') {
if (item.Value) {
item.Value = item.Value.split(',')
}
}
}
})
}

103
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts

@ -4,7 +4,23 @@ import {
CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
let custormList = []
try {
custormList = await CustomerSaleInvoiceMainApi.getRecordCustomerList()
if(custormList.length>0){
custormList.unshift({
customerCode:'ALL',
customerName:t('ts.全选'),
})
}
console.log('custormList11',custormList)
} catch (error) {
}
// 表单校验
export const CustomerSaleInvoiceMainRules = reactive({
customerStatementNumber: [required],
@ -25,12 +41,13 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
},
{
label: '状态',
field: 'status',
label: '申请单号',
sort: 'custom',
isSearch: true,
isForm:false,
// 0:新增1:已发布2已作废
field: 'requestNumber',
table:{
width:150
}
},
{
label: '客户对账单',
@ -52,6 +69,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isMainValue: false
}]
}
},
table:{
width:180
}
},
{
@ -59,10 +79,30 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'customerCode',
sort: 'custom',
isSearch: true,
isDetail:false,
form: {
componentProps: {
disabled:true
}
},
search:{
component:'Select',
value:custormList.length>1?[custormList[0]['customerCode']]:[],
componentProps: {
showAll:true,// 备用做全选
multiple:true,
// emptyValues:[null, undefined],
valueOnClear:null,
options:custormList.length>0?custormList.map(item=>({
label:item.customerName,
value:item.customerCode
})):[]
}
},
table:{
width:150
}
},
{
@ -73,6 +113,10 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled: true
}
},
isDetail:false,
table:{
width:150
}
},
{
@ -83,6 +127,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
@ -114,12 +161,18 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
table:{
width:150
}
},
{
label: '开票日期',
@ -141,6 +194,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
table:{
width:180
}
},
{
@ -153,13 +209,22 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
isTable:false,
isDetail:true,
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isTable:false,
isDetail:true,
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
isForm: false,
},
@ -237,22 +302,6 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'qty',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm: {
type: 'InputNumber',
precision: 2,

56
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap>
<!-- 列表头部 -->
@ -45,8 +45,11 @@
:detailAllSchemasRules="CustomerSaleInvoiceDetailRules"
:apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail"
:apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceRecordDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` })]"
@buttonBaseClick="detailButtonBaseClick"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
@ -84,7 +87,28 @@ const { tableObject, tableMethods } = useTable({
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const detailButtonBaseClick = async (val, item,tableObject) => {
if (val == 'export') {
//
console.log('子表导出',val, tableObject)
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRecordDetail(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
@ -108,8 +132,8 @@ const Echo = []
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-record-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -149,7 +173,7 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceMain(tableObject.params)
const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
@ -182,7 +206,27 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const seachRef = ref()
const onSearchChange = (field, value)=>{
if(field=='customerCode'){
if(value.length>0){
if(value[value.length-1]=='ALL'){
//
seachRef.value.setFormValues({
customerCode:['ALL']
})
}else{
seachRef.value.setFormValues({
customerCode:value.filter(item=>item!='ALL')
})
}
}
}
}
const searchClick = async (data)=>{
console.log('查询',data)
setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL')})
}
/** 初始化 **/
onMounted(async () => {
getList()

255
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue

@ -0,0 +1,255 @@
<template>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isShowButton="false"
:isShowReduceButton="false"
:isShowReduceButtonSelection="false"
:rules="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:tableAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
:tableFormRules="CustomerSaleInvoiceDetailRules"
:tableData="tableData"
:apiUpdate="CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain"
:apiCreate="CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@inputNumberChange="inputNumberChange"
@onChange="onChange"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
const { taxRate = 0 } = formModel
// 1 mainBeforeTaxAmount :
let mainBeforeTaxAmount = tableData.reduce(
(prev, item) =>
prev + Number(item['beforeTaxAmount']),
0
)
// 2. mainTaxAmount = */100
let mainTaxAmount = Number(Number(mainBeforeTaxAmount*taxRate*0.01).toFixed(2))
const sumObject = {
//
beforeTaxAmount:mainBeforeTaxAmount,
//
taxAmount:mainTaxAmount,
// mainAdTaxAmount =+
adTaxAmount:mainBeforeTaxAmount+mainTaxAmount
}
formRef.value.setValues(sumObject)
}
"
/>
</template>
<script setup lang="ts">
import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules,CustomerSaleInvoiceDetailRules,CustomerSaleInvoiceDetail} from './customerSaleInvoiceRequestMain.data'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
//
const emit = defineEmits([
'buttonBaseClick','getList'
])
const message = useMessage() //
const { t } = useI18n() //
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: any) => {
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'customerStatementNumber'){
item.componentProps.disabled = type=='update'
item.componentProps.isSearchList = type!='update'
item.componentProps.enterSearch = type!='update'
}
})
tableData.value = [] //
formRef.value.open(type, row)
}
const onChange = (field, cur, formRef)=>{
console.log('onChange',field, cur, formRef)
if(field == 'taxRate'){
// taxAmount */100,2
tableData.value.forEach(item=>{
item['taxAmount'] = (item['beforeTaxAmount'] * cur)/100 //
})
}
}
const inputNumberChange = (field, index, row, val) => {
console.log('inputNumberChange',field, index, row, val)
// = +,2
row['afterTaxAmount'] = row['beforeTaxAmount'] + row['taxAmount']
// /-
row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price']
// = +
row['sumPrice'] = row['price'] + row['allocationPrice']
// taxAmount */100,2
row['taxAmount'] = (row['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //
}
const flag = ref(false)
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
}
data.subList = tableData.value //
data.subList.forEach(item=>{
item.toWarehouseCode = data.toWarehouseCode
item.toLocationCode = data.toLocationCode
})
//
let isExist = false
tableData.value.forEach(item => {
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
if(rs.length > 1) isExist = true
})
if (isExist) {
formRef.value.formLoading = false
return message.warning('物料代码重复')
}
data.subList.forEach(obj => {
if(obj.qty == 0){
message.error(`数量不能为0!`)
flag.value = true
return;
}
})
if(flag.value){
return
}
var isHave =CustomerSaleInvoiceMain.allSchemas.formSchema.some(function (item) {
return item.field === 'beginTime' || item.field === 'endTime';
});
if(isHave){
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){
message.error('结束时间要大于开始时间')
return;
}
}
console.log(data.beginTime)
if(!data.beginTime)data.beginTime = null;
if(!data.planDate)data.planDate = null;
if(!data.endTime)data.endTime = null;
formRef.value.formLoading = true
try {
if (formType === 'create') {
await CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain(data)
message.success(t('common.createSuccess'))
} else {
await CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
emit('getList', 'refresh')
}else{
emit('buttonBaseClick', 'refresh')
}
} finally {
formRef.value.formLoading = false
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode') {
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0) return
val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
row[formField] = item[searchField]
newRow['uom'] = item['customerUom']
newRow['id'] = item['id']
tableData.value.push(newRow)
})
}else{
row[formField] = val[0][searchField]
}
// if(formField == 'itemCode') {
// row['uom'] = val[0]['customerUom']
// }
//
} else {
const setV = {}
if(formField == 'customerStatementNumber') {
//
setV['customerCode'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1,
pageNSize: 100,
masterId:val[0]['id']
}).then((res) => {
console.log(55,res)
tableData.value = res.list && res.list.length > 0 ?res.list : []
tableData.value.forEach(item=>{
item['sumPrice'] = item['price'] + item['allocationPrice']
// *2
item['beforeTaxAmount'] = item['sumPrice']*item['qty']
// taxAmount */100,2
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //
// +,2
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
})
})
// tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
const tableData = ref([])
const tableFormKeys = {}
CustomerSaleInvoiceDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
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))
}
defineExpose({openForm})
</script>
<style lang="scss" scoped></style>

142
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts

@ -4,16 +4,31 @@ import {
CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
let custormList = []
try {
custormList = await CustomerSaleInvoiceMainApi.getCustomerList()
if(custormList.length>0){
custormList.unshift({
customerCode:'ALL',
customerName:t('ts.全选'),
})
}
console.log('custormList11',custormList)
} catch (error) {
}
// 表单校验
export const CustomerSaleInvoiceMainRules = reactive({
customerStatementNumber: [required],
customerCode: [required],
customerName: [required],
mainBeforeTaxAmount: [required],
beforeTaxAmount: [required],
taxRate: [required],
mainTaxAmount: [required],
mainAdTaxAmount: [required],
taxAmount: [required],
adTaxAmount: [required],
})
export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -23,6 +38,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
isForm: false,
table:{
width:180
}
},
{
label: '状态',
@ -31,6 +49,18 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
isForm:false,
// 0:新增1:已发布2已作废
dictType: DICT_TYPE.CUSTOMER_SALE_INVOICE_TYPE,
dictClass: 'string',
table:{
width:120
},
search:{
component:'Select',
componentProps: {
multiple:true,
}
},
},
{
label: '客户对账单',
@ -46,12 +76,21 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
searchCondition: [
{
key: 'status',
value: [5],
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
table:{
width:180
}
},
{
@ -63,6 +102,26 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled:true
}
},
isDetail:false,
search:{
component:'Select',
value:custormList.length>1?[custormList[0]['customerCode']]:[],
componentProps: {
showAll:true,// 备用做全选
multiple:true,
// emptyValues:[null, undefined],
valueOnClear:null,
options:custormList.length>0?custormList.map(item=>({
label:item.customerName,
value:item.customerCode
})):[]
}
},
table:{
width:150
}
},
{
@ -73,16 +132,23 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
disabled: true
}
},
isDetail:false,
table:{
width:150
}
},
{
label: '未税金额',
field: 'mainBeforeTaxAmount',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
@ -98,28 +164,37 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '税额',
field: 'mainTaxAmount',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '价税合计金额',
field: 'mainAdTaxAmount',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table:{
width:150
}
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
table:{
width:150
}
},
{
label: '开票日期',
@ -134,6 +209,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
@ -141,12 +219,17 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
table:{
width:180
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table:{
width:150
}
},
{
label: '创建时间',
@ -161,7 +244,20 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
}
},
isForm: false,
table:{
width:180
}
},
{
label: '操作',
@ -248,23 +344,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
type: 'InputNumber',
precision: 2,
disabled: true
}
},
tableForm: {
type: 'InputNumber',
precision: 2,
disabled: true
}
},
{
@ -274,11 +362,13 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
form: {
componentProps: {
type: 'InputNumber',
disabled: true
}
},
tableForm: {
type: 'InputNumber',
disabled: true
}
},
{
@ -325,12 +415,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
form: {
componentProps: {
type: 'InputNumber',
precision: 2,
disabled: true
}
},
tableForm: {
type: 'InputNumber',
precision: 2,
disabled: true
}
},
{
@ -348,5 +441,14 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
type: 'InputNumber',
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

391
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap>
<!-- 列表头部 -->
@ -39,35 +39,7 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:tableAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
:tableFormRules="CustomerSaleInvoiceDetailRules"
:tableData="tableData"
:apiUpdate="CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain"
:apiCreate="CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@inputNumberChange="inputNumberChange"
@onChange="onChange"
:sumFormDataByTableCustom="
(formRef, formModel, tableData) => {
tableData.forEach(item=>{
})
}
"
/>
<CustomerSaleInvoiceBasicForm ref="formRef" @getList="getList" @buttonBaseClick="buttonBaseClick"/>
<!-- 详情 -->
<Detail
@ -81,6 +53,11 @@
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo"
:detailButtonIsShowAddStatusArray="['0']"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` })]"
@buttonBaseClick="detailButtonBaseClick"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
@ -91,6 +68,7 @@
<script setup lang="ts">
import download from '@/utils/download'
import CustomerSaleInvoiceBasicForm from './CustomerSaleInvoiceBasicForm.vue'
import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules,CustomerSaleInvoiceDetailRules,CustomerSaleInvoiceDetail} from './customerSaleInvoiceRequestMain.data'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
import * as CustomerSaleInvoiceDetailApi from '@/api/wms/customerSaleInvoiceDetail'
@ -99,6 +77,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as AreabasicApi from '@/api/wms/areabasic'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { status } from 'nprogress'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'customerSaleInvoiceMain' })
@ -126,66 +105,27 @@ const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode') {
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0) return
val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
row[formField] = item[searchField]
newRow['uom'] = item['customerUom']
newRow['id'] = item['id']
tableData.value.push(newRow)
})
}else{
row[formField] = val[0][searchField]
}
// if(formField == 'itemCode') {
// row['uom'] = val[0]['customerUom']
// }
//
} else {
const setV = {}
if(formField == 'customerStatementNumber') {
//
setV['customer'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1,
pageNSize: 100,
masterId:val[0]['id']
}).then((res) => {
console.log(55,res)
tableData.value = res.list && res.list.length > 0 ?res.list : []
tableData.value.forEach(item=>{
item['sumPrice'] = item['price'] + item['allocationPrice']
// *2
item['beforeTaxAmount'] = item['sumPrice']*item['qty']
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
// taxAmount */100,2
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //
})
})
// tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
//
const detailButtonBaseClick = async (val, item,tableObject) => {
if (val == 'export') {
//
console.log('子表导出',val, tableObject)
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRequestDetail(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
})
}
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
@ -210,9 +150,9 @@ const Echo = []
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), //
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-request-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -264,77 +204,19 @@ const butttondata = (row,$index) => {
return []
}
return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:publish`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:update`}), //
defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['0']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { //
tableObject.loading = true
CustomerSaleInvoiceMainApi.open(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.close(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanSub') { //
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.submit(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.reject(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanApp') { //
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanPub') { //
if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.masterId).then(() => {
CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
@ -342,29 +224,28 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.resetting(row.masterId).then(() => {
} else if (val == 'cancel') { //
try {
await message.confirm('确认要作废吗?')
tableObject.loading = true
await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id)
message.success(t('common.updateSuccess'))
tableObject.loading = false
//
//exportLoading.value = true
} catch {
} finally {
//
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
}
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
const openForm =async (type: string, row?: any) => {
formRef.value.openForm(type,row)
}
/** 详情操作 */
@ -373,20 +254,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,'planDeliverMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await CustomerSaleInvoiceMainApi.deleteCustomerSaleInvoiceMain(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
@ -404,123 +272,6 @@ const handleExport = async () => {
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
CustomerSaleInvoiceDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
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 onChange = (field, cur, formRef)=>{
console.log('onChange',field, cur, formRef)
if(field == 'taxRate'){
// taxAmount */100,2
tableData.value.forEach(item=>{
item['taxAmount'] = (item['beforeTaxAmount'] * cur)/100 //
})
}
}
const inputNumberChange = (field, index, row, val) => {
console.log('inputNumberChange',field, index, row, val)
// = +
row['sumPrice'] = row['price'] + row['allocationPrice']
// = +,2
row['afterTaxAmount'] = row['beforeTaxAmount'] + row['taxAmount']
// /-
row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price']
}
//true0
const flag = ref(false)
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
}
data.subList = tableData.value //
data.subList.forEach(item=>{
item.toWarehouseCode = data.toWarehouseCode
item.toLocationCode = data.toLocationCode
})
data.businessType = businessType.value
//
let isExist = false
tableData.value.forEach(item => {
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
if(rs.length > 1) isExist = true
})
if (isExist) {
formRef.value.formLoading = false
return message.warning('物料代码重复')
}
data.subList.forEach(obj => {
if(obj.qty == 0){
message.error(`数量不能为0!`)
flag.value = true
return;
}
})
if(flag.value){
return
}
var isHave =CustomerSaleInvoiceMain.allSchemas.formSchema.some(function (item) {
return item.field === 'beginTime' || item.field === 'endTime';
});
if(isHave){
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){
message.error('结束时间要大于开始时间')
return;
}
}
console.log(data.beginTime)
if(!data.beginTime)data.beginTime = null;
if(!data.planDate)data.planDate = null;
if(!data.endTime)data.endTime = null;
formRef.value.formLoading = true
try {
if (formType === 'create') {
await CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain(data)
message.success(t('common.createSuccess'))
} else {
await CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
@ -547,7 +298,43 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const seachRef = ref()
const onSearchChange = (field, value)=>{
console.log('onSearchChange',field,value)
if(field=='status'){
//
if(value.length>0){
if(value[value.length-1]==''){
//
seachRef.value.setFormValues({
status:['']
})
}else{
seachRef.value.setFormValues({
status:value.filter(item=>item!='')
})
}
}
}
if(field=='customerCode'){
if(value.length>0){
if(value[value.length-1]=='ALL'){
//
seachRef.value.setFormValues({
customerCode:['ALL']
})
}else{
seachRef.value.setFormValues({
customerCode:value.filter(item=>item!='ALL')
})
}
}
}
}
const searchClick = async (data)=>{
console.log('查询',data)
setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL'),status:data.status.filter(item=>item!='')})
}
/** 初始化 **/
onMounted(async () => {
getList()

65
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -83,7 +83,7 @@
ref="formLabelRef"
@success="getList"
:tableAllSchemas="detailListTableColumns"
:tableFormRules="ProductionreturnRequestDetailLabelRules"
:tableFormRules="detailListTableColumnsRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
@ -118,6 +118,7 @@ import * as LocationApi from '@/api/wms/location'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
const { loadStart, loadDone } = usePageLoading()
import { cloneDeep } from 'lodash-es'
// 退
defineOptions({ name: 'ProductionreturnRequestMain' })
@ -130,7 +131,8 @@ routeName.value = route.name
const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns,...ProductionreturnRequestDetail.allSchemas.tableMainColumns])
//
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const detailListTableColumns =cloneDeep(ProductionreturnRequestDetailLabel.allSchemas)
const detailListTableColumnsRules =cloneDeep(ProductionreturnRequestDetailLabel)
const isCreateLabel = ref(false)
const formLabelRef = ref()
const labelType = ref('') //
@ -261,13 +263,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {
newRow['batchFormItemType'] = 'FormDate'
newRow['disabled_batch'] = false
} else {
newRow['batchFormItemType'] = ''
newRow['disabled_batch'] = true
}
// if (fromManagementPrecision.value == 'BY_QUANTITY') {
// newRow['batchFormItemType'] = 'FormDate'
// newRow['disabled_batch'] = false
// } else {
// newRow['batchFormItemType'] = ''
// newRow['disabled_batch'] = true
// }
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){
messageItemCodes.push(item['itemCode'])
@ -545,7 +547,6 @@ const buttonTableClick = async (val, row) => {
await getDetailList()
//
// dialogVisible.value = true
formLabelRef.value.open('create', row)
detatableData.tableList.map((item) => {
// item.batch = '000000'
// 线
@ -558,19 +559,17 @@ const buttonTableClick = async (val, row) => {
}).then(res => {
if (res.list.length > 0) {
//
detailListTableColumnsRules.value = cloneDeep(ProductionreturnRequestDetailLabelRules)
if (res.list[0].enableBuy == "TRUE") {
// tableform
detailListTableColumns.tableFormColumns = ProductionreturnRequestDetailLabel.allSchemas.tableFormColumns.filter(item=>item.field != 'productionLineCodePackage')
delete detailListTableColumnsRules.value.productionLineCodePackage
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
// tableform
if(itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = true
itemColumns.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true
formLabelRef.value.formLoading = true
SupplieritemApi.getSupplieritemPage({
pageSize: 10,
pageNo: 1,
code: item.itemCode,
itemCode: item.itemCode,
sort: '',
by: 'ASC',
}).then(response => {
@ -579,30 +578,17 @@ const buttonTableClick = async (val, row) => {
})
}
})
} else {
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = false
itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false
}
})
}
//
if (res.list[0].enableMake == "TRUE") {
// tableform
// tableform
detailListTableColumns.tableFormColumns = ProductionreturnRequestDetailLabel.allSchemas.tableFormColumns.filter(item=>item.field != 'supplierItemCode')
delete detailListTableColumnsRules.value.supplierItemCode
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') {
item.productionLineCodePackage = item.productionLineCode
itemColumns.tableForm.isInpuFocusShow = true
itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true
formLabelRef.value.formLoading = true
ProductionlineitemApi.getProductionlineitemPage({
pageNo: 1,
code: item.itemCode,
itemCode: item.itemCode,
sort: '',
by: 'ASC',
}).then(response => {
@ -611,20 +597,13 @@ const buttonTableClick = async (val, row) => {
})
}
})
} else {
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') {
itemColumns.tableForm.isInpuFocusShow = false
itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false
}
})
}
} else {
message.warning('没有查询到物料代码:【' + item.itemCode + '】')
return
}
formLabelRef.value.open('create', row)
})
})

1
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts

@ -1514,6 +1514,7 @@ export const ProductionreturnRequestDetailLabel = useCrudSchemas(reactive<CrudSc
width: 150
},
tableForm: {
type:'Select',
disabled: true
},
form: {

4
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts

@ -1188,7 +1188,7 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
searchListPlaceholder: '请选择从批次',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: BalanceShow.allSchemas,
searchAllSchemas: BalancePopWindow.allSchemas,
searchPage: BalanceApi.selectLocationTypeToBalance,
},
form: {
@ -1200,7 +1200,7 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
searchListPlaceholder: '请选择从批次',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: BalanceShow.allSchemas,
searchAllSchemas: BalancePopWindow.allSchemas,
searchPage: BalanceApi.selectLocationTypeToBalance,
}
},

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

@ -77,6 +77,9 @@
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
:detailValidate="detailValidate"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false"
/>
<!-- bom列表
<Dialog
@ -360,7 +363,12 @@ const openForm =async (type: string, row?: number) => {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
}
if(itemColumns.field == 'workStationCode') {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
}
})
} else {
// tableform
ProductredressRequestMain.allSchemas.formSchema.map(itemColumns => {
@ -368,6 +376,10 @@ const openForm =async (type: string, row?: number) => {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
}
if(itemColumns.field == 'workStationCode') {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
}
})
}
formRef.value.open(type, row)

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

@ -27,6 +27,9 @@ export const ProductredressRequestMainRules = reactive({
workshopCode: [
{ required: true, message: '请选择车间代码', trigger: 'change' }
],
productionLineCode: [
{ required: true, message: '请选择生产线', trigger: 'change' }
],
workStationCode: [
{ required: true, message: '请选择工位代码', trigger: 'change' }
],
@ -961,15 +964,5 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
isTableForm: false,
hiddenInMain:true,
table: {
width: 150,
fixed: 'right'
}
}
]))

62
src/views/wms/purchasereceiptManage/bspurchasereceipt/bsPurchasereceiptRecordMain/purchasereceiptRecordMain.data.ts

@ -20,24 +20,24 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sortTableDefault:1
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 180
},
sortTableDefault:2
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180
},
sortTableDefault:3
},
// {
// label: '申请单号',
// field: 'requestNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// sortTableDefault:2
// },
// {
// label: '任务单号',
// field: 'jobNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// sortTableDefault:3
// },
{
label: '发货单号',
field: 'asnNumber',
@ -83,7 +83,7 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
isSearch: true,
isSearch: false,
sortSearchDefault:2,
isTable:false
},
@ -411,15 +411,15 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
sortTableDefault:12,
},
{
label: '发货数量',
field: 'shippedQty',
sort: 'custom',
table: {
width: 150
},
sortTableDefault:12,
},
// {
// label: '发货数量',
// field: 'shippedQty',
// sort: 'custom',
// table: {
// width: 150
// },
// sortTableDefault:12,
// },
{
label: '收货数量',
field: 'qty',
@ -516,9 +516,9 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验
export const PurchasereceiptRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
// requestNumber: [
// { required: true, message: '请选择申请单号', trigger: 'change' }
// ],
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' }
],

2
src/views/wms/purchasereceiptManage/developpurchasereceipt/developPurchasereceiptRequestMain/index.vue

@ -319,7 +319,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //

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

@ -319,7 +319,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //

2
src/views/wms/purchasereceiptManage/toolpurchasereceipt/toolPurchasereceiptRequestMain/index.vue

@ -319,7 +319,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //

10
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts

@ -29,6 +29,16 @@ export const PurchaseClaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 150
},
},
{
label: '供应商代码',
field: 'supplierCode',

28
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts

@ -96,6 +96,9 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
detail: {
dateFormat:'YYYY-MM-DD HH:mm:ss'
}
},
{
label: '供应商发票申请单号',
@ -115,7 +118,7 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.PURCHASECLAIM_REQUEST_STATUS,
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isTable: true,
isForm:false,
@ -203,8 +206,9 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
table: {
},
tableForm:{
multiple:false,//多选
isInpuFocusShow: true, // 开启查询弹窗
multiple: true,//多选
isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择物料代码',// 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
@ -227,7 +231,7 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isMainValue: false
}],
verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法
isShowTableFormSearch: false, //tableForm下方是否出现输入框
isShowTableFormSearch: true, //tableForm下方是否出现输入框
verificationParams: [{
key: 'itemCode',
action: '==',
@ -340,3 +344,19 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isTableForm: false,
}
]))
export const PurchaseClaimRequestAmount = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
isSearch: false,
isTable: true,
table: {
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 5
}
},
]))

102
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

@ -50,7 +50,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="false"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestMain.allSchemas"
@ -72,12 +72,17 @@
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseClaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas"
:detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="PurchaseClaimRequestDetailRules"
:apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail"
:apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail"
:apiPage="PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage"
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:detailButtonIsShowAddStatusArray="['1','2']"
:isChangeDetailDrawer="['2']"
@detailOpenForm="detailOpenForm"
/>
<!-- 导入 -->
<ImportForm
@ -90,6 +95,15 @@
:mode="2"
:extend="businessType"
/>
<BasicForm
ref="detailFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestAmount.allSchemas"
:isBusiness="false"
@success="submitFormDetail"
/>
</template>
<script setup lang="ts">
@ -98,7 +112,8 @@ import {
PurchaseClaimRequestMain,
PurchaseClaimRequestMainRules,
PurchaseClaimRequestDetailRules,
PurchaseClaimRequestDetail
PurchaseClaimRequestDetail,
PurchaseClaimRequestAmount
} from './PurchaseClaimRequestMain.data'
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain'
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail'
@ -118,6 +133,8 @@ const tableColumns = ref([
...PurchaseClaimRequestMain.allSchemas.tableColumns,
...PurchaseClaimRequestDetail.allSchemas.tableMainColumns
])
const detailAllSchemas = ref(PurchaseClaimRequestDetail.allSchemas)
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage //
})
@ -239,7 +256,7 @@ const butttondata = (row, $index) => {
}
return [
defaultButtons.mainListPlanSubBtn({
hide: isShowMainButton(row, ['0']),
hide: isShowMainButton(row, ['1']),
hasPermi: `wms:purchaseClaimRequest:sub`
}), //
defaultButtons.mainListPlanAppBtn({
@ -251,9 +268,12 @@ const butttondata = (row, $index) => {
hasPermi: `wms:purchaseClaimRequest:reject`
}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0','2']),
hide: isShowMainButton(row, ['1']),
hasPermi: `wms:purchaseClaimRequest:update`
}) //
}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPhasPermiermi:`wms:purchaseClaimRequest:close`}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4']),hasPhasPermiermi:`wms:purchaseClaimRequest:reAdd`}), //
]
}
@ -277,7 +297,29 @@ const buttonTableClick = async (val, row) => {
else if (val == 'delete') {
//
handleDelete(row.masterId)
}
}else if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
    await message.confirm('确认要重新添加吗?')
    tableObject.loading = true
    PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => {
      message.success(t('common.updateSuccess'))
      tableObject.loading = false
      buttonBaseClick('refresh',null)
    }).catch(err => {
      tableObject.loading = false
      console.log(err)
    })
  }
}
@ -338,13 +380,30 @@ const handleReject = async (masterId: number) => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
const openForm = async (type: string, row?: any) => {
tableData.value = [] //
if (row?.id) {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = false
item.componentProps.disabled = true
}
})
} else {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = true
item.componentProps.disabled = false
}
})
}
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const detailData = ref({})
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailData.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain')
}
@ -488,7 +547,32 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const detailFormRef = ref()
const detailOpenForm = (type, row, masterParmas) => {
//
if (masterParmas) {
detailFormRef.value.open(type, row, masterParmas)
}
}
//
const submitFormDetail =async (formType,data) => {
detailFormRef.value.formLoading = true
try {
if (formType === 'create') {
await PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail(data)
message.success(t('common.createSuccess'))
} else {
await PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail(data)
message.success(t('common.updateSuccess'))
}
console.log(detailRef.value.formRef.dialogVisible)
detailFormRef.value.dialogVisible = false
detailRef.value.updateList()
} catch {
detailFormRef.value.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {
getList()

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

@ -879,6 +879,7 @@ const openForm = async (type: string, row?: any) => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = false
item.componentProps.disabled = true
claimDetails(defaultSupplierCode.value)
}
//
if (item.field == 'orderType') {

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

@ -370,30 +370,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
disabled: true,
}
},
{
label: '索赔金额',
field: 'claimAmount',
formatter: accountantFormart,
table: {
width: 150
},
isTable:false,
isTableForm:false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2,
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2,
}
},
// {
// label: '调整价差',
// field: 'discountAmount',
@ -1592,6 +1569,28 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
slotFilter: true
}
},
{
label: '索赔总额',
field: 'claimAmount',
sort: 'custom',
table: {
width: 180
},
isTable: true,
isDetail: true,
isTableForm: false,
isForm: true,
isSearch: false,
sortTableDefault: 12,
form: {
component: 'InputNumber',
componentProps: {
precision: 5,
disabled: true,
}
},
},
]))
@ -2282,17 +2281,5 @@ export const ClaimDetails = useCrudSchemas(reactive<CrudSchema[]>([
}
},
//仅是主列表页面的筛选搜索条件
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 5,
}
}
]))

16
src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue

@ -28,7 +28,7 @@
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, t('ts.代码'), row.code)">
<el-button type="primary" link @click="openDetail(row, t('代码'), row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
@ -148,7 +148,7 @@ const butttondata = (row) =>{
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}),
{
label: t('ts.审核通过'),
label: t('审核通过'),
name: 'agree',
hide: isShowMainButton(row, ['1']),
type: 'primary',
@ -157,7 +157,7 @@ const butttondata = (row) =>{
hasPermi: 'wms:supplierinvoice-invoiced:agree'
},
{
label: t('ts.作废'),
label: t('作废'),
name: 'refuse',
hide: isShowMainButton(row, ['1']),
type: 'danger',
@ -194,7 +194,7 @@ const formsSuccess = async (formType,data) => {
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error(t('ts.失效时间要大于生效时间'))
message.error(t('失效时间要大于生效时间'))
return;
}
}
@ -234,11 +234,11 @@ const handleDelete = async (id: number) => {
const handleAgree = async (id : number) => {
try {
//
await message.confirm(t('ts.是否审批通过所选中数据?'))
await message.confirm(t('是否审批通过所选中数据?'))
tableObject.loading = true
//
await SupplierinvoiceInvoicedApi.agreeSupplierinvoiceInvoiced(id)
message.success(t('ts.审批通过成功!'))
message.success(t('审批通过成功!'))
tableObject.loading = false
//
await getList()
@ -252,11 +252,11 @@ const handleAgree = async (id : number) => {
const handleRefuse = async (id : number) => {
try {
//
await message.confirm(t('ts.是否审批拒绝所选中数据?'))
await message.confirm(t('是否审批拒绝所选中数据?'))
tableObject.loading = true
//
await SupplierinvoiceInvoicedApi.refuseSupplierinvoiceInvoiced(id)
message.success(t('ts.审批成功!'))
message.success(t('审批成功!'))
tableObject.loading = false
//
await getList()

Loading…
Cancel
Save