Browse Source

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

master_hella_20240701
liuchen864 7 months ago
parent
commit
8210761e1a
  1. 4
      src/api/qms/sampleCode/index.ts
  2. 3
      src/components/BasicForm/src/BasicForm.vue
  3. 13
      src/utils/disposition/defaultButtons.ts
  4. 8
      src/utils/formatTime.ts
  5. 15
      src/views/qms/sampleCode/sampleCode.data.ts
  6. 6
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  7. 1
      src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts
  8. 78
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  9. 204
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

4
src/api/qms/sampleCode/index.ts

@ -55,3 +55,7 @@ export const exportSampleCode = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/sample-code/get-import-template' }) return request.download({ url: '/qms/sample-code/get-import-template' })
} }
export const getSamplingScheme = async () => {
return await request.get({ url: `/qms/sampling-scheme/get-available-list`})
}

3
src/components/BasicForm/src/BasicForm.vue

@ -637,6 +637,9 @@ const handleAddTable = () => {
} }
// //
const inpuFocus = (headerItem, row, index) => { const inpuFocus = (headerItem, row, index) => {
emit('inpuFocus', headerItem, row, index)
opensearchTable( opensearchTable(
headerItem.field, headerItem.field,
headerItem.tableForm.searchField, headerItem.tableForm.searchField,

13
src/utils/disposition/defaultButtons.ts

@ -471,6 +471,19 @@ export function mainListPlanCloBtn(option:any) {
}) })
} }
// 主列表-上传质量报告
export function mainListPlanUploadQualityReportBtn(option:any) {
return __defaultBtnOption(option,{
label: '上传质量报告',
name: 'mainPlanUploadQualityReport',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-计划流程-提交审批按钮 // 主列表-计划流程-提交审批按钮
export function mainListPlanSubBtn(option:any) { export function mainListPlanSubBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

8
src/utils/formatTime.ts

@ -23,6 +23,14 @@ export function formatDate(date: Date | number, format?: string): string {
return dayjs(date).format(format) return dayjs(date).format(format)
} }
/**
* +
*/
export function addDay(date: Date | number,addDay:number) {
return dayjs(date).add(addDay,'day')
}
/** /**
* + * +
*/ */

15
src/views/qms/sampleCode/sampleCode.data.ts

@ -1,5 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from '@/api/qms/sampleCode/index'
// 表单校验 // 表单校验
export const SampleCodeRules = reactive({ export const SampleCodeRules = reactive({
@ -7,7 +8,7 @@ export const SampleCodeRules = reactive({
batchUpperLimiting: [required], batchUpperLimiting: [required],
available: [required], available: [required],
}) })
const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: 'id',
@ -21,6 +22,16 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
component: 'Select',
componentProps: {
options: samplingSchemeList,
optionsAlias: {
labelField: 'description',
valueField: 'code'
},
}
}
}, },
{ {
label: '批量下限', label: '批量下限',
@ -84,7 +95,7 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
}, },
{ {

6
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -237,7 +237,7 @@
<el-input v-model="formData.configuration.Receiver" placeholder="请输入收货人名称" clearable /> <el-input v-model="formData.configuration.Receiver" placeholder="请输入收货人名称" clearable />
</el-form-item> </el-form-item>
<!-- 在途库位 --> <!-- 在途库位 -->
<el-form-item label="联系电话" prop="PhoneNumber"> <el-form-item label="联系电话" prop="configuration.PhoneNumber">
<el-input v-model="formData.configuration.PhoneNumber" placeholder="请输入联系电话" clearable /> <el-input v-model="formData.configuration.PhoneNumber" placeholder="请输入联系电话" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -314,8 +314,8 @@ const rules = ref({
name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
PhoneNumber: [{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, 'configuration.PhoneNumber': [{ max: 11, message: '不得超过11个字符', trigger: 'blur' },
{message: '请输入联系电话', trigger: 'blur' ,validator:validateHanset}] {message: '请输入正确格式的电话', trigger: 'blur' ,validator:validateHanset}]
}) })
// //

1
src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts

@ -300,6 +300,7 @@ export const SupplierRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],
email: [ email: [
{ required: true, message: '请输入邮箱', trigger: 'blur' },
{ max: 128, message: '不得超过128个字符', trigger: 'blur' }, { max: 128, message: '不得超过128个字符', trigger: 'blur' },
{ validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'} { validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'}
], ],

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

@ -45,6 +45,8 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true"
:indexTableColumn="3"
@success="getList" @success="getList"
:rules="SupplierdeliverRequestMainRules" :rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" :formAllSchemas="SupplierdeliverRequestMain.allSchemas"
@ -99,6 +101,18 @@
@submitForm="submitFormLabel" @submitForm="submitFormLabel"
:isShowReduceButton="false" :isShowReduceButton="false"
/> />
<!-- 上传质量报告 -->
<BasicForm
ref="ploadQualityReportRef"
@success="getList"
:formAllSchemas="UploadQualityReport.allSchemas"
:tableAllSchemas="UploadQualityReport.allSchemas"
:tableData="ploadQualityReportTableData"
@handleAddTable="handleAddTableUploadQualityReport"
@handleDeleteTable="handleDeleteTableUploadQualityReport"
@submitForm="submitFormUploadQualityReport"
:isShowReduceButton="true"
/>
</template> </template>
@ -112,6 +126,7 @@ import {
SupplierdeliverRequestDetail, SupplierdeliverRequestDetail,
SupplierdeliverRequestDetailRules, SupplierdeliverRequestDetailRules,
SupplierdeliverRequestDetailLabel, SupplierdeliverRequestDetailLabel,
UploadQualityReport
} from './supplierdeliverRequestMain.data' } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
@ -138,17 +153,28 @@ const planArriveTimeStr = ref()
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
console.log("type:",type)
console.log("formField:",formField) console.log("formField:",formField)
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] // row[formField] = val[0][searchField]
if (formField == 'poNumber') { // if (formField == 'poNumber') {
row['poNumber'] = val[0]['poNumber'] // row['poNumber'] = val[0]['poNumber']
row['itemCode'] = val[0]['itemCode'] // row['itemCode'] = val[0]['itemCode']
row['poLine'] = val[0]['poLine'] // row['poLine'] = val[0]['poLine']
row['orderQty'] = val[0]['orderQty'] // row['orderQty'] = val[0]['orderQty']
row['uom'] = val[0]['uom'] // row['uom'] = val[0]['uom']
} // }
val.forEach(item=>{
const newRow = {...row}
newRow[formField] = item[searchField]
newRow['poNumber'] = item['poNumber']
newRow['itemCode'] = item['itemCode']
newRow['poLine'] = item['poLine']
newRow['orderQty'] = item['orderQty']
newRow['uom'] = item['uom']
tableData.value.push(newRow)
})
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -283,6 +309,7 @@ const isShowMainButtonLabel = (row, val) => {
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPlanUploadQualityReportBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
@ -326,6 +353,9 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPurPlanClo') { } else if (val == 'mainPurPlanClo') {
// //
handleClo(row.id) handleClo(row.id)
} else if (val == 'mainPlanUploadQualityReport') {
//
handleUploadQualityReport(row.id)
} else if (val == 'mainPlanSub') { } else if (val == 'mainPlanSub') {
// //
handleSub(row.id) handleSub(row.id)
@ -466,6 +496,38 @@ const handleOpe = async (id: number) => {
tableObject.loading = false tableObject.loading = false
} }
} }
const ploadQualityReportRef = ref()
const ploadQualityReportTableData = ref([])
/** 上传质量报告 */
const handleUploadQualityReport = async (id: number) => {
console.log('UploadQualityReport',UploadQualityReport.allSchemas)
// ploadQualityReportRef.value.dialogVisible = true
ploadQualityReportRef.value.open('create', null, null,'上传质量报告')// createLabel
const tableFormKeys = {}
UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
ploadQualityReportTableData.value = [tableFormKeys]
}
const handleAddTableUploadQualityReport = ()=>{
const tableFormKeys = {}
UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
ploadQualityReportTableData.value.push(tableFormKeys)
}
const handleDeleteTableUploadQualityReport = (item, index) => {
ploadQualityReportTableData.value.splice(index, 1)
}
const submitFormUploadQualityReport = (formType, data) => {
console.log("formType==",formType)
console.log("data==",data)
ploadQualityReportRef.value.dialogVisible = false
// formLabelRef.value.formLoading = false
// formLabelRef.value.dialogVisible = false
}
/** 提交审批按钮操作 */ /** 提交审批按钮操作 */
const handleSub = async (id: number) => { const handleSub = async (id: number) => {

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

@ -224,20 +224,20 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
width: 150 width: 150
}, },
}, },
{ // {
label: '业务类型', // label: '业务类型',
field: 'businessType', // field: 'businessType',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
value: 'SupplierDeliver', // value: 'SupplierDeliver',
componentProps: { // componentProps: {
disabled: true, // disabled: true,
} // }
} // }
}, // },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
@ -322,29 +322,29 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
isForm: false isForm: false
}, },
{ // {
label: '部门', // label: '部门',
field: 'departmentCode', // field: 'departmentCode',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { // formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name // return userDeptArray.find((account) => account.id == cellValue)?.name
}, // },
form: { // form: {
value: userDept.id, // value: userDept.id,
component: 'Select', // component: 'Select',
api: () => userDeptArray, // api: () => userDeptArray,
componentProps: { // componentProps: {
disabled: true, // disabled: true,
optionsAlias: { // optionsAlias: {
labelField: 'name', // labelField: 'name',
valueField: 'id' // valueField: 'id'
} // }
} // }
} // }
}, // },
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -528,9 +528,9 @@ export const SupplierdeliverRequestMainRules = reactive({
planArriveTime: [ planArriveTime: [
{ required: true, message: '请输入计划到货时间', trigger: 'blur' } { required: true, message: '请输入计划到货时间', trigger: 'blur' }
], ],
departmentCode: [ // departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' } // { required: true, message: '请输入部门', trigger: 'blur' }
], // ],
autoCommit: [ autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' } { required: true, message: '请选择是否自动提交', trigger: 'change' }
], ],
@ -586,19 +586,19 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 150 width: 150
}, },
tableForm: { tableForm: {
disabled: true disabled: false
} }
}, },
{ // {
label: '替代批次', // label: '替代批次',
field: 'altBatch', // field: 'altBatch',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
isTableForm: false, // isTableForm: false,
isForm: false // isForm: false
}, // },
{ {
label: '到货日期', label: '到货日期',
field: 'arriveDate', field: 'arriveDate',
@ -1014,6 +1014,19 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
])) ]))
// 批次校验
const validateBatch = (rule: any, value: any, callback: any) => {
const reg = /^[_a-zA-Z0-9]+$/;
if (value == '' || value == undefined || value == null) {
callback();
} else {
if (!reg.test(value)) {
callback(new Error('英文字母、数字或下划线'));
} else {
callback();
}
}
}
//表单校验 //表单校验
export const SupplierdeliverRequestDetailRules = reactive({ export const SupplierdeliverRequestDetailRules = reactive({
// packingNumber: [ // packingNumber: [
@ -1022,6 +1035,7 @@ export const SupplierdeliverRequestDetailRules = reactive({
batch: [ batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }, { required: true, message: '请输入批次', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateBatch, trigger: 'change' }
], ],
produceDate: [ produceDate: [
{ required: true, message: '请输入生产日期', trigger: 'blur' } { required: true, message: '请输入生产日期', trigger: 'blur' }
@ -1089,19 +1103,19 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
valueFormat: 'x', valueFormat: 'x',
} }
}, },
{ // {
label: '替代批次', // label: '替代批次',
field: 'altBatch', // field: 'altBatch',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
isTableForm: false, // isTableForm: false,
isForm: false, // isForm: false,
tableForm:{ // tableForm:{
disabled:true // disabled:true
} // }
}, // },
{ {
label: '到货日期', label: '到货日期',
field: 'arriveDate', field: 'arriveDate',
@ -1562,3 +1576,65 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
isForm: false isForm: false
}, },
])) ]))
export const UploadQualityReport = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '上传质检报告',
field: 'uploadFile',
sort: 'custom',
isTable:false,
isTableForm:false,
form: {
component: 'UploadFile',
componentProps: {
upData:{
tableId: '',
tableName: ''
},
limit:1,
}
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isForm:false,
isTableForm:true,
table: {
width: 150,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isForm:false,
isTableForm:true,
table: {
width: 150,
},
},
{
label: '数量',
field: 'orderQty',
table: {
width: 150
},
isForm:false,
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isForm:false,
table: {
width: 150
},
},
]))
Loading…
Cancel
Save