Browse Source

Merge remote-tracking branch 'origin/master_hella' into master_hella

master_hella_20240701
gaojs 6 months ago
parent
commit
e285a7146b
  1. 5
      src/api/qms/inspectionScheme/index.ts
  2. 5
      src/api/wms/subjectAccount/index.ts
  3. 22
      src/views/qms/inspectionScheme/index.vue
  4. 14
      src/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data.ts
  5. 9
      src/views/wms/basicDataManage/subject/subjectAccount/index.vue
  6. 68
      src/views/wms/basicDataManage/subject/subjectAccount/subjectAccount.data.ts

5
src/api/qms/inspectionScheme/index.ts

@ -30,3 +30,8 @@ export const enableInspectionScheme = async (id: number) => {
export const disableInspectionScheme = async (id: number) => {
return await request.disable({ url: `/qms/inspection-scheme/disable?id=` + id })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-scheme/get-import-template' })
}

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

@ -52,8 +52,13 @@ export const deleteSubjectAccount = async (id: number) => {
// 导出科目账户配置 Excel
export const exportSubjectAccount = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/subject-account/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/subject-account/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {

22
src/views/qms/inspectionScheme/index.vue

@ -49,6 +49,8 @@
@submitForm="submitForm"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/inspection-scheme/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
@ -60,6 +62,8 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue'
import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue";
import * as SampleCodeApi from "@/api/qms/sampleCode";
defineOptions({ name: 'InspectionScheme' })
@ -86,7 +90,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:type-template:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:agv-locationrelation:import'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:inspection-scheme:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:agv-locationrelation:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -240,9 +244,25 @@ const searchFormClick = (searchData) => {
getList() //
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '检验方案导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await InspectionSchemeApi.importTemplate()
})
</script>

14
src/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data.ts

@ -62,6 +62,20 @@ export const QadCostcentre = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
table: {
width: 120
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '备注',

9
src/views/wms/basicDataManage/subject/subjectAccount/index.vue

@ -80,6 +80,15 @@ const tableColumns = ref(SubjectAccount.allSchemas.tableColumns)
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
if (formField === 'costecentreCode') {
setV['costecentreId'] = val[0]['costcentreId']
setV['costcentreCode'] = val[0]['costcentreCode']
setV['costecentreType'] = val[0]['costcentreType']
}
if( formField === 'projectCode'){
setV['projectId'] = val[0]['projectId']
setV['projectCode'] = val[0]['projectCode']
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})

68
src/views/wms/basicDataManage/subject/subjectAccount/subjectAccount.data.ts

@ -1,5 +1,9 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as QadCostcentreApi from '@/api/wms/qadCostcentre'
import { QadCostcentre } from '../qadCostcentre/qadCostcentre.data'
import * as QadProjectApi from '@/api/wms/qadProject'
import { QadProject } from '../qadProject/qadProject.data'
// 表单校验
export const SubjectAccountRules = reactive({
@ -35,13 +39,12 @@ export const SubjectAccount = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '成本中心ID111',
label: '成本中心ID',
field: 'costecentreId',
sort: 'custom',
isSearch: false,
isTable:false,
disabled:true,
from:{
form:{
componentProps:{
disabled:true
}
@ -52,12 +55,33 @@ export const SubjectAccount = useCrudSchemas(reactive<CrudSchema[]>([
field: 'costecentreCode',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'costcentreCode', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: QadCostcentre.allSchemas, // 查询弹窗所需类
searchPage: QadCostcentreApi.getQadCostcentrePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '成本中心类型',
field: 'costecentreType',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '项目ID',
@ -66,7 +90,7 @@ export const SubjectAccount = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable:false,
disabled:true,
from:{
form:{
componentProps:{
disabled:true
}
@ -77,17 +101,41 @@ export const SubjectAccount = useCrudSchemas(reactive<CrudSchema[]>([
field: 'projectCode',
sort: 'custom',
isSearch: false,
},
{
label: '科目',
field: 'address',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'projectCode', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: QadProject.allSchemas, // 查询弹窗所需类
searchPage: QadProjectApi.getQadProjectPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
table: {
width: 120
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '备注',

Loading…
Cancel
Save