Browse Source

20240807需求修改

master
songguoqiang 3 months ago
parent
commit
2b6953b75c
  1. 53
      src/api/lab/hardness/hardnessFour/index.ts
  2. 120
      src/views/lab/hardness/hardnessFour/hardnessFour.data.ts
  3. 225
      src/views/lab/hardness/hardnessFour/index.vue
  4. 1
      src/views/lab/hardness/three/hardnessThree.data.ts
  5. 2
      src/views/lab/hardness/three/index.vue
  6. 1
      src/views/lab/hardness/two/hardnessTwo.data.ts
  7. 2
      src/views/lab/hardness/two/index.vue
  8. 10
      src/views/lab/platscale/platscale.data.ts
  9. 10
      src/views/lab/platscaledata/platscale.data.ts
  10. 4
      src/views/lab/stretch/stretchthousandnew/stretchThousandnew.data.ts
  11. 4
      src/views/lab/stretch/stretchthreehundred/stretchthreehundred.data.ts
  12. 25
      src/views/tjanalysis/platscale/index.vue

53
src/api/lab/hardness/hardnessFour/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface HardnessFourVO {
sydw: string
standard: string
cz: string
guig: string
testUser: string
testDate: string
testYd: string
auditStatus: string
}
// 查询实验室-洛氏硬度列表
export const getHardnessFourPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/hardness-four/senior', data })
} else {
return await request.get({ url: `/lab/hardness-four/page`, params })
}
}
// 查询实验室-洛氏硬度详情
export const getHardnessFour = async (id: number) => {
return await request.get({ url: `/lab/hardness-four/get?id=` + id })
}
// 新增实验室-洛氏硬度
export const createHardnessFour = async (data: HardnessFourVO) => {
return await request.post({ url: `/lab/hardness-four/create`, data })
}
// 修改实验室-洛氏硬度
export const updateHardnessFour = async (data: HardnessFourVO) => {
return await request.put({ url: `/lab/hardness-four/update`, data })
}
// 删除实验室-洛氏硬度
export const deleteHardnessFour = async (id: number) => {
return await request.delete({ url: `/lab/hardness-four/delete?id=` + id })
}
// 导出实验室-洛氏硬度 Excel
export const exportHardnessFour = async (params) => {
return await request.download({ url: `/lab/hardness-four/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/hardness-four/get-import-template' })
}

120
src/views/lab/hardness/hardnessFour/hardnessFour.data.ts

@ -0,0 +1,120 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const HardnessFourRules = reactive({
})
export const HardnessFour = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '批次号',
field: 'batchNo',
sort: 'custom',
isSearch: true,
},
{
label: '送样单位',
field: 'sydw',
sort: 'custom',
isSearch: false,
isTable:true,
},
{
label: '标准',
field: 'standard',
sort: 'false',
isSearch: false,
},
{
label: '材质',
field: 'cz',
sort: 'custom',
isSearch: false,
},
{
label: '规格',
field: 'guig',
sort: 'custom',
isSearch: false,
},
{
label: '实验人',
field: 'testUser',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
dictClass: 'number'
},
{
label: '硬度',
field: 'testYd',
sort: 'custom',
isSearch: false,
},
{
label: '实验日期',
field: 'testDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'YYYY-MM-DD'
}
},
},
{
label: '审核状态',
field: 'auditStatus',
sort: 'custom',
isSearch: true,
table: {
fixed: 'right'
},
isForm:false,
dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number'
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
fixed: 'right'
}
}
]))

225
src/views/lab/hardness/hardnessFour/index.vue

@ -0,0 +1,225 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HardnessFour.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HardnessFour.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<el-button v-if="row.auditStatus!='1'" type="text" @click="auditStatus(row)">确认</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="HardnessFourRules"
:formAllSchemas="HardnessFour.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HardnessFourApi.updateHardnessFour"
:apiCreate="HardnessFourApi.createHardnessFour"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HardnessFour,HardnessFourRules } from './hardnessFour.data'
import * as HardnessFourApi from '@/api/lab/hardness/hardnessFour'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'HardnessFour' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HardnessFour.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: HardnessFourApi.getHardnessFourPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await HardnessFourApi.updateHardnessFour(data)
message.success('操作成功')
//
await getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicHardnessFour')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HardnessFourApi.deleteHardnessFour(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await HardnessFourApi.exportHardnessFour(setSearchParams)
download.excel(data, '实验室-洛氏硬度.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室洛氏硬度导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await HardnessFourApi.importTemplate()
})
</script>

1
src/views/lab/hardness/three/hardnessThree.data.ts

@ -138,6 +138,7 @@ export const HardnessThree = useCrudSchemas(reactive<CrudSchema[]>([
width: 120, width: 120,
fixed: 'right' fixed: 'right'
}, },
isForm:false,
dictType: DICT_TYPE.LAB_AUDIT_STATUS, dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number' dictClass: 'number'
}, },

2
src/views/lab/hardness/three/index.vue

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<el-button type="text" @click="auditStatus(row)">确认</el-button> <el-button v-if="row.auditStatus!='1'" type="text" @click="auditStatus(row)">确认</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>

1
src/views/lab/hardness/two/hardnessTwo.data.ts

@ -147,6 +147,7 @@ export const HardnessTwo = useCrudSchemas(reactive<CrudSchema[]>([
width: 120, width: 120,
fixed: 'right' fixed: 'right'
}, },
isForm:false,
dictType: DICT_TYPE.LAB_AUDIT_STATUS, dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number' dictClass: 'number'
}, },

2
src/views/lab/hardness/two/index.vue

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<el-button type="text" @click="auditStatus(row)">确认</el-button> <el-button v-if="row.auditStatus!='1'" type="text" @click="auditStatus(row)">确认</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>

10
src/views/lab/platscale/platscale.data.ts

@ -90,25 +90,25 @@ export const Platscale = useCrudSchemas(reactive<CrudSchema[]>([
label: '品种', label: '品种',
field: 'pz', field: 'pz',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }
}, },
{ {
label: '供货单位', label: '使用单位',
field: 'ghdw', field: 'ghdw',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }
}, },
{ {
label: '运输单位', label: '发货单位',
field: 'ysdw', field: 'ysdw',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }

10
src/views/lab/platscaledata/platscale.data.ts

@ -90,25 +90,25 @@ export const Platscale = useCrudSchemas(reactive<CrudSchema[]>([
label: '品种', label: '品种',
field: 'pz', field: 'pz',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }
}, },
{ {
label: '供货单位', label: '使用单位',
field: 'ghdw', field: 'ghdw',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }
}, },
{ {
label: '运输单位', label: '发货单位',
field: 'ysdw', field: 'ysdw',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }

4
src/views/lab/stretch/stretchthousandnew/stretchThousandnew.data.ts

@ -34,7 +34,7 @@ export const StretchThousandnew = useCrudSchemas(reactive<CrudSchema[]>([
label: '编号', label: '编号',
field: 'bhNo', field: 'bhNo',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }
@ -124,7 +124,7 @@ export const StretchThousandnew = useCrudSchemas(reactive<CrudSchema[]>([
label: '尺寸', label: '尺寸',
field: 'deviceCc', field: 'deviceCc',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }

4
src/views/lab/stretch/stretchthreehundred/stretchthreehundred.data.ts

@ -52,7 +52,7 @@ export const Stretch300 = useCrudSchemas(reactive<CrudSchema[]>([
label: '材质', label: '材质',
field: 'cz', field: 'cz',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }
@ -61,7 +61,7 @@ export const Stretch300 = useCrudSchemas(reactive<CrudSchema[]>([
label: '规格', label: '规格',
field: 'guig', field: 'guig',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
table: { table: {
width: 150 width: 150
} }

25
src/views/tjanalysis/platscale/index.vue

@ -9,6 +9,20 @@
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-form-item label="发货单位" prop="ysdw">
<el-input
v-model="queryParams.ysdw"
placeholder="请输入发货单位"
clearable
/>
</el-form-item>
<el-form-item label="品种" prop="pz">
<el-input
v-model="queryParams.pz"
placeholder="请输入品种"
clearable
/>
</el-form-item>
<el-form-item label="日期" prop="dateRange"> <el-form-item label="日期" prop="dateRange">
<el-date-picker <el-date-picker
v-model="queryParams.dateRange" v-model="queryParams.dateRange"
@ -31,8 +45,8 @@
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="dataList.dList" border="true" highlight-current-row="true"> <el-table v-loading="loading" :data="dataList.dList" border="true" highlight-current-row="true">
<el-table-column label="序号" type="index" width="80" align="center" /> <el-table-column label="序号" type="index" width="80" align="center" />
<el-table-column label="供货单位(使用单位)" prop="ghdw" align="center" :show-overflow-tooltip="true" /> <el-table-column label="使用单位" prop="ghdw" align="center" :show-overflow-tooltip="true" />
<el-table-column label="运输单位" prop="ysdw" align="center" :show-overflow-tooltip="true" /> <el-table-column label="发货单位" prop="ysdw" align="center" :show-overflow-tooltip="true" />
<el-table-column label="品种" prop="pz" align="center" :show-overflow-tooltip="true" /> <el-table-column label="品种" prop="pz" align="center" :show-overflow-tooltip="true" />
<el-table-column label="总净重(t)" prop="jz" align="center" :show-overflow-tooltip="true" /> <el-table-column label="总净重(t)" prop="jz" align="center" :show-overflow-tooltip="true" />
</el-table> </el-table>
@ -66,7 +80,9 @@ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
dateRange: [], dateRange: [],
ghdw: '' ghdw:'',
ysdw:'',
pz:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
@ -76,6 +92,8 @@ const handleQuery = async () => {
const resetQuery = async () => { const resetQuery = async () => {
queryParams.dateRange = [] queryParams.dateRange = []
queryParams.ghdw ='' queryParams.ghdw =''
queryParams.ysdw =''
queryParams.pz =''
getList() getList()
} }
@ -89,7 +107,6 @@ const getList = async (page) => {
dataList.dList = res.list dataList.dList = res.list
dataList.total = res.total dataList.total = res.total
} }
console.log('23',dataList.total);
loading.value = false loading.value = false
} }

Loading…
Cancel
Save