Browse Source

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

intex_online20241228
ljlong_2630 3 months 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 }) 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)详情 // 查询客户销售开票子信息表(WMS)详情
export const getCustomerSaleInvoiceDetail = async (id: number) => { export const getCustomerSaleInvoiceDetail = async (id: number) => {
@ -49,8 +60,22 @@ export const deleteCustomerSaleInvoiceDetail = async (id: number) => {
} }
// 导出客户销售开票子信息表(WMS) Excel // 导出客户销售开票子信息表(WMS) Excel
export const exportCustomerSaleInvoiceDetail = async (params) => { export const exportCustomerSaleInvoiceRequestDetail = async (params) => {
return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, 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 }) return await request.delete({ url: `/wms/customer-sale-invoice-main/delete?id=` + id })
} }
// 导出客户销售开票主信息表(WMS) Excel // 导出设备制造商 Excel
export const exportCustomerSaleInvoiceMain = async (params) => { 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 = () => { export const importTemplate = () => {
return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' }) return request.download({ url: '/wms/customer-sale-invoice-main/get-import-template' })
@ -62,9 +75,27 @@ export const importTemplate = () => {
export const getCustomerSaleInvoiceRecodeMainPage = async (params) => { export const getCustomerSaleInvoiceRecodeMainPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
// const data = {...params} const data = {...params}
// return await request.post({ url: '/wms/customer-sale-invoice-main/senior', data }) return await request.post({ url: '/wms/customer-sale-invoice-record-main/senior', data })
} else { } else {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/page`, params }) 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) => { 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) => { 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) => { 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) => { 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 // 导出采购索赔子 Excel
export const exportPurchaseClaimRequestDetailExcel = async (params) => { export const exportPurchaseClaimRequestDetailExcel = async (params) => {
if (params.isSearch) { if (params.isSearch) {
const data = {...params} 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 { } 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 }) 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) => { export const subPurchaseClaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseClaim-request-main/sub?id=` + id }) 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, required: false,
default: 8 default: 8
}, },
//
isChangeDetailDrawer:{
type:Array,
required: false,
default: () => []
},
}) })
const allSchemas = ref(props.allSchemas) const allSchemas = ref(props.allSchemas)
const detailAllSchemasRef = ref(props.detailAllSchemas) 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) => { 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 // form
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {

5
src/utils/dict.ts

@ -283,6 +283,7 @@ export enum DICT_TYPE {
CONTAINER_STATUS = 'container_status', // 容器状态 CONTAINER_STATUS = 'container_status', // 容器状态
PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型 PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型
PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型 PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型
PACK_DATA_SOURCE = 'pack_data_source', // 物料包装数据来源
TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因 TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因
PURCHASERECEIPT_SOURCE_TYPE = 'purchasereceipt_source_type', //采购收货数据来源 PURCHASERECEIPT_SOURCE_TYPE = 'purchasereceipt_source_type', //采购收货数据来源
PLAN_PRODUCTION_TYPE = 'plan_production_type', // 生产计划类型 PLAN_PRODUCTION_TYPE = 'plan_production_type', // 生产计划类型
@ -410,5 +411,7 @@ export enum DICT_TYPE {
RECEIVE_STATUS = 'receive_status', // 收货确认状态 RECEIVE_STATUS = 'receive_status', // 收货确认状态
LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典) LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典)
CUSTOMER_STATEMENT_TYPE = 'customer_statement_type', // wms客户对账单 模具分摊状态 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 [ return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:outerApiHis:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'wms:outerApiHis:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:outerApiHis:delete'}), // // 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' fixed: 'left'
}, },
}, },
{
label: '顺引代码',
field: 'shunyinCode',
isSearch: true,
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
},
{ {
label: '名称', label: '名称',
field: 'name', field: 'name',
@ -294,6 +304,9 @@ export const CustomerRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'}
], ],
shunyinCode: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [ name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { 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: '层级', label: '层级',
field: 'layer', field: 'layer',
sort: 'custom', sort: 'custom',
isTable:false,
// form: { // form: {
// component: 'Input', // component: 'Input',
// componentProps: { // componentProps: {

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

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

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

@ -357,6 +357,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if('itemCode'==formField){ if('itemCode'==formField){
setV['itemName'] = val[0]['name']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
} }
if('packUnit'==formField){ 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: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',
@ -56,7 +74,8 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120
},form: { },
form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
disabled: true disabled: true
@ -231,10 +250,25 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
field: 'dataSource', field: 'dataSource',
sort: 'custom', sort: 'custom',
isForm:false, isForm:false,
dictType: DICT_TYPE.PACK_DATA_SOURCE,
dictClass: 'string',
table: { table: {
width: 180 width: 180
}, },
}, },
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
isTable:true,
isTableForm:true,
isForm:true,
isDetail:true
},
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

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

@ -167,14 +167,13 @@
v-else-if="item.ParamCode == 'Project'" v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'" :disabled="formData.priority==0&&formType=='update'"
/> />
<el-input key="物料" <el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value">
v-model="item.Value" <template #suffix>
placeholder="请输入物料,多个物料以逗号分隔" <el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
clearable <Icon icon="ep:search" class="mr-5px" />
style="flex: 1" </el-button>
v-else-if="item.ParamCode == 'ItemCode'" </template>
:disabled="formData.priority==0&&formType=='update'" </el-input>
/>
</el-form-item> </el-form-item>
<!-- 选择供应商和客户 --> <!-- 选择供应商和客户 -->
<el-form-item key="供应商和客户formItem" label="客户" class="err-240" v-if="index == 1"> <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 { Transactiontype } from '@/views/wms/basicDataManage/documentSetting/transactiontype/transactiontype.data'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as ProductionlineApi from '@/api/wms/productionline' 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 { Customer, CustomerRules } from '@/views/wms/basicDataManage/customerManage/customer/customer.data'
import * as CustomerApi from '@/api/wms/customer' import * as CustomerApi from '@/api/wms/customer'
@ -605,7 +606,7 @@ const options = reactive({
{ value: 'ItemType', label: '物料类型' }, { value: 'ItemType', label: '物料类型' },
{ value: 'ItemGroup', label: '物料分组' }, { value: 'ItemGroup', label: '物料分组' },
{ value: 'ItemCode', label: '物料' }, { value: 'ItemCode', label: '物料' },
{ value: 'Project', label: '项目' }, // { value: 'Project', label: '' },
{ value: 'AbcClass', label: 'ABC类' }, { value: 'AbcClass', label: 'ABC类' },
{ value: 'ItemStatus', label: '物料状态' } { 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 = ()=>{ const searchTransactionType = ()=>{
searchTableRef.value.open( searchTableRef.value.open(
@ -960,6 +976,14 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
} }
return 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'?'':'' // let searchTableTitle = warehouseType.value == 'WarehouseCode'?'':warehouseType.value == 'AreaCode'?'':warehouseType.value == 'LocationGroupCode'?'':warehouseType.value == 'LocationCode'?'':''
console.log('searchTableSuccess',formField, searchField, val, type, row) console.log('searchTableSuccess',formField, searchField, val, type, row)
console.log(val.map(item=>(item['code'])).join(',')) 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'" v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'" :disabled="formData.priority==0&&formType=='update'"
/> />
<el-input key="物料" <el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value">
v-model="item.Value" <template #suffix>
placeholder="请输入物料,多个物料以逗号分隔" <el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
clearable <Icon icon="ep:search" class="mr-5px" />
style="flex: 1" </el-button>
v-else-if="item.ParamCode == 'ItemCode'" </template>
:disabled="formData.priority==0&&formType=='update'" </el-input>
/>
</el-form-item> </el-form-item>
<!-- 选择重量体积还是面积 --> <!-- 选择重量体积还是面积 -->
<!-- <el-form-item key="重量体积或面积formItem" label="" label-width="0" class="err-240" v-if="index == 2">--> <!-- <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 * as TransactiontypeApi from '@/api/wms/transactiontype'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as ProductionlineApi from '@/api/wms/productionline' 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 { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -792,7 +792,7 @@ const options = reactive({
{ value: 'ItemType', label: '物料类型' }, { value: 'ItemType', label: '物料类型' },
{ value: 'ItemGroup', label: '物料分组' }, { value: 'ItemGroup', label: '物料分组' },
{ value: 'ItemCode', label: '物料' }, { value: 'ItemCode', label: '物料' },
{ value: 'Project', label: '项目' }, // { value: 'Project', label: '' },
{ value: 'AbcClass', label: 'ABC类' }, { value: 'AbcClass', label: 'ABC类' },
{ value: 'ItemStatus', label: '物料状态' } { 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 = ()=>{ const searchTransactionType = ()=>{
searchTableRef.value.open( searchTableRef.value.open(
@ -1108,6 +1125,14 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
} }
return 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'?'':'' // let searchTableTitle = warehouseType.value == 'WarehouseCode'?'':warehouseType.value == 'AreaCode'?'':warehouseType.value == 'LocationGroupCode'?'':warehouseType.value == 'LocationCode'?'':''
console.log('searchTableSuccess',formField, searchField, val, type, row) console.log('searchTableSuccess',formField, searchField, val, type, row)
console.log(val.map(item=>(item['code'])).join(',')) 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'"> <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> <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" /> <Icon icon="ep:search" class="mr-5px" />
</el-button> </el-button>
</template> </template>
@ -1045,6 +1045,7 @@ const blurWarehouse = async ({module='config',type})=>{
return return
} }
let verifyRes = [] let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){ if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
// //
verifyRes = await WarehouseApi.verifyWarehouse({ verifyRes = await WarehouseApi.verifyWarehouse({
@ -1059,13 +1060,13 @@ const blurWarehouse = async ({module='config',type})=>{
console.log('库区verifyRes',verifyRes) console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){ }else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
// //
let verifyRes = await LocationgroupApi.verifyLocationgroup({ verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue code:warehouseValue
}) })
console.log('库位组verifyRes',verifyRes) console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){ }else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
// //
let verifyRes = await LocationApi.verifyLocation({ verifyRes = await LocationApi.verifyLocation({
code:warehouseValue code:warehouseValue
}) })
console.log('库位verifyRes',verifyRes) 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 = JSON.parse(data.condition)
formData.value.condition.forEach((item, index) => { formData.value.condition.forEach((item, index) => {
if ((item.Operator == 'IN' || item.Operator == 'NOT IN')&& !Array.isArray(item.Value)) { 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, CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data' } from '../moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' 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({ export const CustomerSaleInvoiceMainRules = reactive({
customerStatementNumber: [required], customerStatementNumber: [required],
@ -25,12 +41,13 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false, isForm: false,
}, },
{ {
label: '状态', label: '申请单号',
field: 'status',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, field: 'requestNumber',
// 0:新增1:已发布2已作废 table:{
width:150
}
}, },
{ {
label: '客户对账单', label: '客户对账单',
@ -52,6 +69,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isMainValue: false isMainValue: false
}] }]
} }
},
table:{
width:180
} }
}, },
{ {
@ -59,10 +79,30 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'customerCode', field: 'customerCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isDetail:false,
form: { form: {
componentProps: { componentProps: {
disabled:true 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: { componentProps: {
disabled: true disabled: true
} }
},
isDetail:false,
table:{
width:150
} }
}, },
{ {
@ -83,6 +127,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
@ -114,12 +161,18 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '金税票号', label: '金税票号',
field: 'goldenTaxInvoiceNumber', field: 'goldenTaxInvoiceNumber',
sort: 'custom', sort: 'custom',
table:{
width:150
}
}, },
{ {
label: '开票日期', label: '开票日期',
@ -141,6 +194,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
table:{
width:180
}
}, },
{ {
@ -153,13 +209,22 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
search: { isTable:false,
component: 'DatePicker', isDetail:true,
componentProps: { detail: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat : 'YYYY-MM-DD HH:mm:ss'
type: 'daterange', },
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] isForm: false,
} },
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isTable:false,
isDetail:true,
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
}, },
isForm: false, isForm: false,
}, },
@ -237,22 +302,6 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: true, 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: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
precision: 2, precision: 2,

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

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -45,8 +45,11 @@
:detailAllSchemasRules="CustomerSaleInvoiceDetailRules" :detailAllSchemasRules="CustomerSaleInvoiceDetailRules"
:apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail" :apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail"
:apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail" :apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage" :apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceRecordDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail" :apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` })]"
@buttonBaseClick="detailButtonBaseClick"
:Echo="Echo" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
@ -84,7 +87,28 @@ const { tableObject, tableMethods } = useTable({
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = 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 ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(() => {
@ -108,8 +132,8 @@ const Echo = []
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), // defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-record-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), // defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -149,7 +173,7 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) 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`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {
} finally { } finally {
@ -182,7 +206,27 @@ const searchFormClick = (searchData) => {
} }
getList() // 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 () => { onMounted(async () => {
getList() 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, CustomerStatementMain,
} from '../moldAllocation/customerStatement/customerStatementMain.data' } from '../moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' 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({ export const CustomerSaleInvoiceMainRules = reactive({
customerStatementNumber: [required], customerStatementNumber: [required],
customerCode: [required], customerCode: [required],
customerName: [required], customerName: [required],
mainBeforeTaxAmount: [required], beforeTaxAmount: [required],
taxRate: [required], taxRate: [required],
mainTaxAmount: [required], taxAmount: [required],
mainAdTaxAmount: [required], adTaxAmount: [required],
}) })
export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -23,6 +38,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
table:{
width:180
}
}, },
{ {
label: '状态', label: '状态',
@ -31,6 +49,18 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
isForm:false, isForm:false,
// 0:新增1:已发布2已作废 // 0:新增1:已发布2已作废
dictType: DICT_TYPE.CUSTOMER_SALE_INVOICE_TYPE,
dictClass: 'string',
table:{
width:120
},
search:{
component:'Select',
componentProps: {
multiple:true,
}
},
}, },
{ {
label: '客户对账单', label: '客户对账单',
@ -46,12 +76,21 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '客户对账单信息', // 查询弹窗标题 searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类 searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法 searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [
{
key: 'status',
value: [5],
isMainValue: false
},
{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] }]
} }
},
table:{
width:180
} }
}, },
{ {
@ -63,6 +102,26 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled:true 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: { componentProps: {
disabled: true disabled: true
} }
},
isDetail:false,
table:{
width:150
} }
}, },
{ {
label: '未税金额', label: '未税金额',
field: 'mainBeforeTaxAmount', field: 'beforeTaxAmount',
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
@ -98,28 +164,37 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '税额', label: '税额',
field: 'mainTaxAmount', field: 'taxAmount',
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '价税合计金额', label: '价税合计金额',
field: 'mainAdTaxAmount', field: 'adTaxAmount',
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
},
table:{
width:150
} }
}, },
{ {
label: '金税票号', label: '金税票号',
field: 'goldenTaxInvoiceNumber', field: 'goldenTaxInvoiceNumber',
sort: 'custom', sort: 'custom',
table:{
width:150
}
}, },
{ {
label: '开票日期', label: '开票日期',
@ -134,6 +209,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -141,12 +219,17 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
table:{
width:180
}
}, },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
table:{
width:150
}
}, },
{ {
label: '创建时间', label: '创建时间',
@ -161,7 +244,20 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x',
}
},
isForm: false, isForm: false,
table:{
width:180
}
}, },
{ {
label: '操作', label: '操作',
@ -248,23 +344,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
form: { form: {
componentProps: { componentProps: {
enterSearch: true, type: 'InputNumber',
isSearchList: true, // 开启查询弹窗 precision: 2,
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本 disabled: true
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
precision: 2, precision: 2,
disabled: true
} }
}, },
{ {
@ -274,11 +362,13 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
form: { form: {
componentProps: { componentProps: {
type: 'InputNumber',
disabled: true disabled: true
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
disabled: true
} }
}, },
{ {
@ -325,12 +415,15 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
form: { form: {
componentProps: { componentProps: {
type: 'InputNumber',
precision: 2,
disabled: true disabled: true
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
precision: 2, precision: 2,
disabled: true
} }
}, },
{ {
@ -348,5 +441,14 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
type: 'InputNumber', 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> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search ref="seachRef" :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @onChange="onSearchChange"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -39,35 +39,7 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <CustomerSaleInvoiceBasicForm ref="formRef" @getList="getList" @buttonBaseClick="buttonBaseClick"/>
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=>{
})
}
"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
@ -81,6 +53,11 @@
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage" :apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail" :apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo" :Echo="Echo"
:detailButtonIsShowAddStatusArray="['0']"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` })]"
@buttonBaseClick="detailButtonBaseClick"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
@ -91,6 +68,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import CustomerSaleInvoiceBasicForm from './CustomerSaleInvoiceBasicForm.vue'
import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules,CustomerSaleInvoiceDetailRules,CustomerSaleInvoiceDetail} from './customerSaleInvoiceRequestMain.data' import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules,CustomerSaleInvoiceDetailRules,CustomerSaleInvoiceDetail} from './customerSaleInvoiceRequestMain.data'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain' import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
import * as CustomerSaleInvoiceDetailApi from '@/api/wms/customerSaleInvoiceDetail' 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 * as AreabasicApi from '@/api/wms/areabasic'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { status } from 'nprogress'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
defineOptions({ name: 'customerSaleInvoiceMain' }) defineOptions({ name: 'customerSaleInvoiceMain' })
@ -126,66 +105,27 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const detailButtonBaseClick = async (val, item,tableObject) => {
nextTick(async () => { if (val == 'export') {
if (type == 'tableForm') { //
if(formField == 'itemCode') { console.log('子表导出',val, tableObject)
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) try {
if(itemCodes.length>0){ //
itemCodes = itemCodes.map(item=>(item['itemCode'])) await message.exportConfirm()
message.warning(`物料${itemCodes.join(',')}已经存在`) //
} loadStart()
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) const excelTitle = ref(route.meta.title)
if(val.length==0) return const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRequestDetail(tableObject.params)
val.forEach(item=>{ download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) } catch {
row[formField] = item[searchField]
newRow['uom'] = item['customerUom'] } finally {
newRow['id'] = item['id'] loadDone()
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 searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
@ -210,9 +150,9 @@ const Echo = []
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-main:create` }), // defaultButtons.defaultAddBtn({hasPermi:`wms:customer-sale-invoice-request-main:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), // defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-request-main:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), // defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -264,77 +204,19 @@ const butttondata = (row,$index) => {
return [] return []
} }
return [ return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), // defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:publish`}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:`wms:customer-sale-invoice-request-main:update`}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), // defaultButtons.mainListCancelBtn({hide: isShowMainButton(row,['0']),hasPermi:'wms:customer-sale-invoice-request-main:cancel'}), //
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`}), //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { // if (val == 'mainPlanPub') { //
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') { //
await message.confirm('确认要发布吗?') await message.confirm('确认要发布吗?')
tableObject.loading = true tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.masterId).then(() => { CustomerSaleInvoiceMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
buttonBaseClick('refresh',null) buttonBaseClick('refresh',null)
@ -342,29 +224,28 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false tableObject.loading = false
console.log(err) console.log(err)
}) })
} else if (val == 'mainPlanRes') { // } else if (val == 'cancel') { //
await message.confirm('确认要重置吗?') try {
tableObject.loading = true await message.confirm('确认要作废吗?')
CustomerSaleInvoiceMainApi.resetting(row.masterId).then(() => { tableObject.loading = true
await CustomerSaleInvoiceMainApi.nodeAbrogate(row.id)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false //
//exportLoading.value = true
} catch {
} finally {
//
buttonBaseClick('refresh',null) buttonBaseClick('refresh',null)
}).catch(err => { }
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: any) => {
tableData.value = [] // formRef.value.openForm(type,row)
formRef.value.open(type, row)
} }
/** 详情操作 */ /** 详情操作 */
@ -373,20 +254,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,'planDeliverMain') 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 () => { 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() const importFormRef = ref()
@ -547,7 +298,43 @@ const searchFormClick = (searchData) => {
} }
getList() // 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 () => { onMounted(async () => {
getList() getList()

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

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

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

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

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

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

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

@ -27,6 +27,9 @@ export const ProductredressRequestMainRules = reactive({
workshopCode: [ workshopCode: [
{ required: true, message: '请选择车间代码', trigger: 'change' } { required: true, message: '请选择车间代码', trigger: 'change' }
], ],
productionLineCode: [
{ required: true, message: '请选择生产线', trigger: 'change' }
],
workStationCode: [ workStationCode: [
{ required: true, message: '请选择工位代码', trigger: 'change' } { required: true, message: '请选择工位代码', trigger: 'change' }
], ],
@ -961,15 +964,5 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
isForm: false 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 sortTableDefault:1
}, },
{ // {
label: '申请单号', // label: '申请单号',
field: 'requestNumber', // field: 'requestNumber',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 180 // width: 180
}, // },
sortTableDefault:2 // sortTableDefault:2
}, // },
{ // {
label: '任务单号', // label: '任务单号',
field: 'jobNumber', // field: 'jobNumber',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 180 // width: 180
}, // },
sortTableDefault:3 // sortTableDefault:3
}, // },
{ {
label: '发货单号', label: '发货单号',
field: 'asnNumber', field: 'asnNumber',
@ -83,7 +83,7 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
isSearch: true, isSearch: false,
sortSearchDefault:2, sortSearchDefault:2,
isTable:false isTable:false
}, },
@ -411,15 +411,15 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
sortTableDefault:12, sortTableDefault:12,
}, },
{ // {
label: '发货数量', // label: '发货数量',
field: 'shippedQty', // field: 'shippedQty',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
sortTableDefault:12, // sortTableDefault:12,
}, // },
{ {
label: '收货数量', label: '收货数量',
field: 'qty', field: 'qty',
@ -516,9 +516,9 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验 // 表单校验
export const PurchasereceiptRecordMainRules = reactive({ export const PurchasereceiptRecordMainRules = reactive({
requestNumber: [ // requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' } // { required: true, message: '请选择申请单号', trigger: 'change' }
], // ],
supplierCode: [ supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' } { required: true, message: '请选择供应商代码', trigger: 'change' }
], ],

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

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

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

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

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

@ -319,7 +319,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), // // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), // // defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(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 width: 150
}, },
}, },
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 150
},
},
{ {
label: '供应商代码', label: '供应商代码',
field: 'supplierCode', field: 'supplierCode',

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

@ -96,6 +96,9 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
detail: {
dateFormat:'YYYY-MM-DD HH:mm:ss'
}
}, },
{ {
label: '供应商发票申请单号', label: '供应商发票申请单号',
@ -115,7 +118,7 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
dictType: DICT_TYPE.PURCHASECLAIM_REQUEST_STATUS, dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
isForm:false, isForm:false,
@ -203,8 +206,9 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
table: { table: {
}, },
tableForm:{ tableForm:{
multiple:false,//多选 multiple: true,//多选
isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择物料代码',// 输入框占位文本 searchListPlaceholder: '请选择物料代码',// 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题 searchTitle: '供应商物料信息', // 查询弹窗标题
@ -227,7 +231,7 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isMainValue: false isMainValue: false
}], }],
verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法 verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法
isShowTableFormSearch: false, //tableForm下方是否出现输入框 isShowTableFormSearch: true, //tableForm下方是否出现输入框
verificationParams: [{ verificationParams: [{
key: 'itemCode', key: 'itemCode',
action: '==', action: '==',
@ -340,3 +344,19 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isTableForm: false, 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 <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="false" :isOpenSearchTable="true"
fieldTableColumn="itemCode" fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules" :rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestMain.allSchemas" :formAllSchemas="PurchaseClaimRequestMain.allSchemas"
@ -72,12 +72,17 @@
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="PurchaseClaimRequestMain.allSchemas" :allSchemas="PurchaseClaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas" :detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="PurchaseClaimRequestDetailRules" :detailAllSchemasRules="PurchaseClaimRequestDetailRules"
:apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail" :apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail"
:apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail" :apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail"
:apiPage="PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage" :apiPage="PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage"
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" :apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:detailButtonIsShowAddStatusArray="['1','2']"
:isChangeDetailDrawer="['2']"
@detailOpenForm="detailOpenForm"
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
@ -90,6 +95,15 @@
:mode="2" :mode="2"
:extend="businessType" :extend="businessType"
/> />
<BasicForm
ref="detailFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestAmount.allSchemas"
:isBusiness="false"
@success="submitFormDetail"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -98,7 +112,8 @@ import {
PurchaseClaimRequestMain, PurchaseClaimRequestMain,
PurchaseClaimRequestMainRules, PurchaseClaimRequestMainRules,
PurchaseClaimRequestDetailRules, PurchaseClaimRequestDetailRules,
PurchaseClaimRequestDetail PurchaseClaimRequestDetail,
PurchaseClaimRequestAmount
} from './PurchaseClaimRequestMain.data' } from './PurchaseClaimRequestMain.data'
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain' import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain'
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail' import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail'
@ -118,6 +133,8 @@ const tableColumns = ref([
...PurchaseClaimRequestMain.allSchemas.tableColumns, ...PurchaseClaimRequestMain.allSchemas.tableColumns,
...PurchaseClaimRequestDetail.allSchemas.tableMainColumns ...PurchaseClaimRequestDetail.allSchemas.tableMainColumns
]) ])
const detailAllSchemas = ref(PurchaseClaimRequestDetail.allSchemas)
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage // getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage //
}) })
@ -239,7 +256,7 @@ const butttondata = (row, $index) => {
} }
return [ return [
defaultButtons.mainListPlanSubBtn({ defaultButtons.mainListPlanSubBtn({
hide: isShowMainButton(row, ['0']), hide: isShowMainButton(row, ['1']),
hasPermi: `wms:purchaseClaimRequest:sub` hasPermi: `wms:purchaseClaimRequest:sub`
}), // }), //
defaultButtons.mainListPlanAppBtn({ defaultButtons.mainListPlanAppBtn({
@ -251,9 +268,12 @@ const butttondata = (row, $index) => {
hasPermi: `wms:purchaseClaimRequest:reject` hasPermi: `wms:purchaseClaimRequest:reject`
}), // }), //
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0','2']), hide: isShowMainButton(row, ['1']),
hasPermi: `wms:purchaseClaimRequest:update` 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') { else if (val == 'delete') {
// //
handleDelete(row.masterId) 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 formRef = ref()
const openForm = async (type: string, row?: number) => { const openForm = async (type: string, row?: any) => {
tableData.value = [] // 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) formRef.value.open(type, row)
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const detailData = ref({})
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailData.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain') detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain')
} }
@ -488,7 +547,32 @@ const searchFormClick = (searchData) => {
} }
getList() // 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 () => { onMounted(async () => {
getList() 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') { if (item.field == 'supplierCode') {
item.componentProps.isSearchList = false item.componentProps.isSearchList = false
item.componentProps.disabled = true item.componentProps.disabled = true
claimDetails(defaultSupplierCode.value)
} }
// //
if (item.field == 'orderType') { 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, 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: '调整价差', // label: '调整价差',
// field: 'discountAmount', // field: 'discountAmount',
@ -1592,6 +1569,28 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
slotFilter: true 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" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <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> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
@ -148,7 +148,7 @@ const butttondata = (row) =>{
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}),
{ {
label: t('ts.审核通过'), label: t('审核通过'),
name: 'agree', name: 'agree',
hide: isShowMainButton(row, ['1']), hide: isShowMainButton(row, ['1']),
type: 'primary', type: 'primary',
@ -157,7 +157,7 @@ const butttondata = (row) =>{
hasPermi: 'wms:supplierinvoice-invoiced:agree' hasPermi: 'wms:supplierinvoice-invoiced:agree'
}, },
{ {
label: t('ts.作废'), label: t('作废'),
name: 'refuse', name: 'refuse',
hide: isShowMainButton(row, ['1']), hide: isShowMainButton(row, ['1']),
type: 'danger', type: 'danger',
@ -194,7 +194,7 @@ const formsSuccess = async (formType,data) => {
}); });
if(isHave){ if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error(t('ts.失效时间要大于生效时间')) message.error(t('失效时间要大于生效时间'))
return; return;
} }
} }
@ -234,11 +234,11 @@ const handleDelete = async (id: number) => {
const handleAgree = async (id : number) => { const handleAgree = async (id : number) => {
try { try {
// //
await message.confirm(t('ts.是否审批通过所选中数据?')) await message.confirm(t('是否审批通过所选中数据?'))
tableObject.loading = true tableObject.loading = true
// //
await SupplierinvoiceInvoicedApi.agreeSupplierinvoiceInvoiced(id) await SupplierinvoiceInvoicedApi.agreeSupplierinvoiceInvoiced(id)
message.success(t('ts.审批通过成功!')) message.success(t('审批通过成功!'))
tableObject.loading = false tableObject.loading = false
// //
await getList() await getList()
@ -252,11 +252,11 @@ const handleAgree = async (id : number) => {
const handleRefuse = async (id : number) => { const handleRefuse = async (id : number) => {
try { try {
// //
await message.confirm(t('ts.是否审批拒绝所选中数据?')) await message.confirm(t('是否审批拒绝所选中数据?'))
tableObject.loading = true tableObject.loading = true
// //
await SupplierinvoiceInvoicedApi.refuseSupplierinvoiceInvoiced(id) await SupplierinvoiceInvoicedApi.refuseSupplierinvoiceInvoiced(id)
message.success(t('ts.审批成功!')) message.success(t('审批成功!'))
tableObject.loading = false tableObject.loading = false
// //
await getList() await getList()

Loading…
Cancel
Save