Commit 6ae4536d by zhaopanyu

zpy 实验室药品管理 实验室管理修改

parent a34b7e02
...@@ -17,7 +17,7 @@ export function editInst(data) { ...@@ -17,7 +17,7 @@ export function editInst(data) {
}); });
} }
//查看仪器列表 //查看仪器列表
export function getList(query) { export function getListyq(query) {
return request({ return request({
url: "/schoolInstrument/list", url: "/schoolInstrument/list",
method: "get", method: "get",
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694586094638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11336" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M896 554.666667h-42.666667v298.666666H170.666667v-298.666666H128l384-384 384 384z m-640-8.533334V768h512v-221.866667l-256-256-256 256z m174.933333-76.8h170.666667v85.333334h-170.666667v-85.333334z" fill="#444444" p-id="11337"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694586094638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11336" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M896 554.666667h-42.666667v298.666666H170.666667v-298.666666H128l384-384 384 384z m-640-8.533334V768h512v-221.866667l-256-256-256 256z m174.933333-76.8h170.666667v85.333334h-170.666667v-85.333334z" fill="#444444" p-id="11337"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694585200349" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2468" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M375.754979 682.621159a68.262116 68.262116 0 1 0 136.524232 0 68.262116 68.262116 0 0 0-136.524232 0z" fill="#768197" p-id="2469"></path><path d="M580.541327 819.14539a68.262116 68.262116 0 1 0 136.524231 0 68.262116 68.262116 0 0 0-136.524231 0z" fill="#FFFFFF" p-id="2470"></path><path d="M977.280744 852.320779L703.413135 360.35571a43.756016 43.756016 0 0 1-11.399773-28.601827V57.203653h34.19932c17.133791 0 28.533564-11.468035 28.533564-28.601826S743.346473 0 726.212682 0H292.611722c-17.065529 0-28.533564 11.468035-28.533565 28.601827s11.399773 28.601827 28.533565 28.601826h34.267582V331.753883c0 11.468035 0 22.936071-5.734018 28.670089L47.277677 852.252516a133.862009 133.862009 0 0 0 0 114.407307c22.799547 34.335844 57.067129 57.203653 102.734485 57.203653h724.534098c40.0016 0 79.866676-22.867809 102.734484-57.203653 17.065529-34.335844 17.065529-80.071462 0-114.407307zM634.946233 57.203653V331.753883c0 22.936071 5.734018 40.069862 17.065529 62.937671l40.0016 68.671688H332.54506l39.933337-74.405706a110.584628 110.584628 0 0 0 17.133791-57.203653V57.203653h245.334045z m291.0014 880.922605c-11.399773 17.133791-28.533564 28.601827-51.401373 28.601827H150.012162c-22.867809 0-40.0016-11.468035-51.401373-28.601827a52.083994 52.083994 0 0 1 0-57.203653l205.468968-366.089727h422.132925l205.468969 366.089727c0 17.133791 0 40.069862-5.734018 57.203653z" fill="#768197" p-id="2471"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694585200349" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2468" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M375.754979 682.621159a68.262116 68.262116 0 1 0 136.524232 0 68.262116 68.262116 0 0 0-136.524232 0z" fill="#768197" p-id="2469"></path><path d="M580.541327 819.14539a68.262116 68.262116 0 1 0 136.524231 0 68.262116 68.262116 0 0 0-136.524231 0z" fill="#FFFFFF" p-id="2470"></path><path d="M977.280744 852.320779L703.413135 360.35571a43.756016 43.756016 0 0 1-11.399773-28.601827V57.203653h34.19932c17.133791 0 28.533564-11.468035 28.533564-28.601826S743.346473 0 726.212682 0H292.611722c-17.065529 0-28.533564 11.468035-28.533565 28.601827s11.399773 28.601827 28.533565 28.601826h34.267582V331.753883c0 11.468035 0 22.936071-5.734018 28.670089L47.277677 852.252516a133.862009 133.862009 0 0 0 0 114.407307c22.799547 34.335844 57.067129 57.203653 102.734485 57.203653h724.534098c40.0016 0 79.866676-22.867809 102.734484-57.203653 17.065529-34.335844 17.065529-80.071462 0-114.407307zM634.946233 57.203653V331.753883c0 22.936071 5.734018 40.069862 17.065529 62.937671l40.0016 68.671688H332.54506l39.933337-74.405706a110.584628 110.584628 0 0 0 17.133791-57.203653V57.203653h245.334045z m291.0014 880.922605c-11.399773 17.133791-28.533564 28.601827-51.401373 28.601827H150.012162c-22.867809 0-40.0016-11.468035-51.401373-28.601827a52.083994 52.083994 0 0 1 0-57.203653l205.468968-366.089727h422.132925l205.468969 366.089727c0 17.133791 0 40.069862-5.734018 57.203653z" fill="#768197" p-id="2471"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694585790298" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4238" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M821.8 767.8H107.9c-5.5 0-10-4.5-10-10V108.2c0-5.5 4.5-10 10-10h713.9c5.5 0 10 4.5 10 10v649.6c0 5.5-4.5 10-10 10z" fill="#EEEEEE" p-id="4239"></path><path d="M755.9 306.2v-67.7c0-0.4-0.1-0.8-0.2-1.1v-2.7h-0.4c-2.5-12.9-17.4-22.9-35.6-22.9H217.2c-18.2 0-33.1 10-35.6 22.9h-0.6v96.1h0.2V350c0 0.4-0.2 0.8-0.2 1.1v146.2c0 0.4 0.1 0.8 0.2 1.1v2.6h0.4c2.5 13 17.4 23 35.6 23h502.6c18.2 0 33.1-10 35.6-22.9h0.5V326.5h-0.2v-19.2c0-0.3 0.2-0.7 0.2-1.1z" fill="#5B5144" p-id="4240"></path><path d="M727.8 320.9v-59.3c0-0.3-0.1-0.7-0.1-1v-2.3h-0.3c-2.3-11.3-15.7-20.1-32.1-20.1H241.6c-16.4 0-29.9 8.7-32.1 20.1h-0.5v84.1h0.1v16.8c0 0.3-0.1 0.7-0.1 1v127.9c0 0.3 0.1 0.7 0.1 1v2.3h0.3c2.3 11.3 15.7 20.1 32.1 20.1h453.6c16.4 0 29.9-8.7 32.1-20.1h0.5V338.7h-0.1v-16.8c0-0.3 0.2-0.6 0.2-1z" fill="#3BCDAE" p-id="4241"></path><path d="M781.5 512.1c-0.1-11.3-12.4-20.4-27.6-20.4h-578c-15.2 0-27.6 9.1-27.6 20.4h633.2z" fill="#FCE38A" p-id="4242"></path><path d="M354.2 492.6c0-11.2-1.9-20.4-4.2-20.4h-87.5c-2.3 0-4.2 9.1-4.2 20.4h95.9z" fill="#FFFFFF" p-id="4243"></path><path d="M781.5 511.6c-0.1 11.3-12.4 20.4-27.6 20.4h-578c-15.2 0-27.6-9.1-27.6-20.4h633.2z" fill="#EEDBC3" p-id="4244"></path><path d="M447.9 334.8H256.4v-31.2h191.5v31.2zM384 396.7H256.4v-31.2H384v31.2z" fill="#FFFFFF" p-id="4245"></path><path d="M303.6 480.8h320.8v157.4H303.6z" fill="#78909C" p-id="4246"></path><path d="M290.5 480.8h350.9l37.1-24.9H253.4zM265.2 638.3h413.3v16H265.2z" fill="#B0BEC5" p-id="4247"></path><path d="M606 887.6V582.3c0-21 18-38.2 40-38.2h240c22 0 40 17.2 40 38.2v305.3c0 21-18 38.2-40 38.2H646c-22 0-40-17.2-40-38.2z" fill="#FFCCBC" p-id="4248"></path><path d="M878.4 732.1l-87.5-85.4v170.7l87.5-85.3z m-87.5 28.6H653.7v-57.3h137.1v57.3z" fill="#FD0000" p-id="4249"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694585790298" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4238" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M821.8 767.8H107.9c-5.5 0-10-4.5-10-10V108.2c0-5.5 4.5-10 10-10h713.9c5.5 0 10 4.5 10 10v649.6c0 5.5-4.5 10-10 10z" fill="#EEEEEE" p-id="4239"></path><path d="M755.9 306.2v-67.7c0-0.4-0.1-0.8-0.2-1.1v-2.7h-0.4c-2.5-12.9-17.4-22.9-35.6-22.9H217.2c-18.2 0-33.1 10-35.6 22.9h-0.6v96.1h0.2V350c0 0.4-0.2 0.8-0.2 1.1v146.2c0 0.4 0.1 0.8 0.2 1.1v2.6h0.4c2.5 13 17.4 23 35.6 23h502.6c18.2 0 33.1-10 35.6-22.9h0.5V326.5h-0.2v-19.2c0-0.3 0.2-0.7 0.2-1.1z" fill="#5B5144" p-id="4240"></path><path d="M727.8 320.9v-59.3c0-0.3-0.1-0.7-0.1-1v-2.3h-0.3c-2.3-11.3-15.7-20.1-32.1-20.1H241.6c-16.4 0-29.9 8.7-32.1 20.1h-0.5v84.1h0.1v16.8c0 0.3-0.1 0.7-0.1 1v127.9c0 0.3 0.1 0.7 0.1 1v2.3h0.3c2.3 11.3 15.7 20.1 32.1 20.1h453.6c16.4 0 29.9-8.7 32.1-20.1h0.5V338.7h-0.1v-16.8c0-0.3 0.2-0.6 0.2-1z" fill="#3BCDAE" p-id="4241"></path><path d="M781.5 512.1c-0.1-11.3-12.4-20.4-27.6-20.4h-578c-15.2 0-27.6 9.1-27.6 20.4h633.2z" fill="#FCE38A" p-id="4242"></path><path d="M354.2 492.6c0-11.2-1.9-20.4-4.2-20.4h-87.5c-2.3 0-4.2 9.1-4.2 20.4h95.9z" fill="#FFFFFF" p-id="4243"></path><path d="M781.5 511.6c-0.1 11.3-12.4 20.4-27.6 20.4h-578c-15.2 0-27.6-9.1-27.6-20.4h633.2z" fill="#EEDBC3" p-id="4244"></path><path d="M447.9 334.8H256.4v-31.2h191.5v31.2zM384 396.7H256.4v-31.2H384v31.2z" fill="#FFFFFF" p-id="4245"></path><path d="M303.6 480.8h320.8v157.4H303.6z" fill="#78909C" p-id="4246"></path><path d="M290.5 480.8h350.9l37.1-24.9H253.4zM265.2 638.3h413.3v16H265.2z" fill="#B0BEC5" p-id="4247"></path><path d="M606 887.6V582.3c0-21 18-38.2 40-38.2h240c22 0 40 17.2 40 38.2v305.3c0 21-18 38.2-40 38.2H646c-22 0-40-17.2-40-38.2z" fill="#FFCCBC" p-id="4248"></path><path d="M878.4 732.1l-87.5-85.4v170.7l87.5-85.3z m-87.5 28.6H653.7v-57.3h137.1v57.3z" fill="#FD0000" p-id="4249"></path></svg>
\ No newline at end of file
<template> <template>
<div> <div class="app-container">
<el-form <el-form :model="queryForm" ref="queryForm" size="small" :inline="true" @submit.native.prevent label-width="78px">
:model="queryForm"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="仪器名称"> <el-form-item label="仪器名称">
<el-input <el-input v-model="queryForm.instrumentName" placeholder="请输入" clearable></el-input>
v-model="queryForm.name"
placeholder="请输入"
clearable
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="仪器分类"> <el-form-item label="仪器分类">
<el-select <treeselect v-model="queryForm.instrumentTypeId" :options="equiList" :normalizer="normalizer"
v-model="queryForm.name" placeholder="选择分类编码" clearable style="width: 192px" />
placeholder="请选择"
clearable
>
<el-option> </el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="变更日期"> <el-form-item label="变更日期">
<el-date-picker <el-date-picker v-model="queryForm.startTime" type="date" placeholder="选择开始日期" value-format="yyyy-MM-dd">
v-model="queryForm.name" </el-date-picker>
type="daterange" <el-date-picker v-model="queryForm.endTime" type="date" placeholder="选择结束日期" value-format="yyyy-MM-dd">
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search"
size="mini"
@click="getList"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 表格 --> <!-- 表格 -->
<el-table stripe :data="tableData" border style="width: 98%"> <el-table stripe :data="tableData" border style="width: 98%">
<el-table-column <el-table-column align="center" type="index" label="序号" width="55" />
align="center" <el-table-column align="center" prop="instrumentName" label="仪器名称" />
type="index" <el-table-column align="center" prop="instrumentTypeName" label="仪器分类" />
label="序号" <el-table-column align="center" prop="variationType" label="仪器型号" />
width="55" <el-table-column align="center" prop="variationType" label="变动类型" />
/> <el-table-column align="center" prop="variationNum" label="变动数量" />
<el-table-column align="center" prop="name" label="仪器名称" /> <el-table-column align="center" prop="oldStockNum" label="旧库存数量" />
<el-table-column align="center" prop="name" label="仪器分类" /> <el-table-column align="center" prop="newStockNum" label="新库存数量" />
<el-table-column align="center" prop="name" label="仪器型号" /> <el-table-column align="center" prop="variationTime" label="变更时间" />
<el-table-column align="center" prop="name" label="变动类型" /> <el-table-column align="center" prop="remark" label="备注" />
<el-table-column align="center" prop="name" label="变动数量" />
<el-table-column align="center" prop="name" label="旧库存数量" />
<el-table-column align="center" prop="name" label="新库存数量" />
<el-table-column align="center" prop="name" label="变更时间" />
<el-table-column align="center" prop="name" label="备注" />
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryForm.pageNum" :limit.sync="queryForm.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryForm.pageNum"
:limit.sync="queryForm.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import {
getListrk,
} from '@/api/smartSchool/InstrumentDrugAdministration/instrumentManagement';
import {
getList,//查看列表
} from '@/api/smartSchool/InstrumentDrugAdministration/instrumentClassification';
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: 'instrumentDetails', name: 'instrumentDetails',
components: { Treeselect },
data() { data() {
return { return {
queryForm: { queryForm: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: '' instrumentName: "",
instrumentTypeId: "",
daterange: "",
startTime: "",
endTime: "",
}, },
//表格数据 //表格数据
tableData: [ tableData: [
{
name: 111222
}
], ],
equiList: [],
// 总计 // 总计
total: 0 total: 0
} }
}, },
created() {
this.getList();
this.getListequ();
},
methods: { methods: {
// 搜索 // 搜索
getList() {}, getList() {
getListrk({ ...this.queryForm }).then(res => {
if (res.code == 200) {
this.total = res.total;
this.tableData = res.rows;
console.log(this.tableData);
this.loading = false
}
})
},
getListequ() {
this.loading = true;
getList(this.queryForm).then(response => {
this.equiList = this.handleTree(response.rows, "id", 'parentId', 'children');
console.log('this.tableData', this.tableData);
this.loading = false;
})
},
/** 转换分类编码数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.instrumentTypeName,
children: node.children
};
},
// 重置 // 重置
resetQuery() {} resetQuery() {
this.queryForm = {
pageNum: 1,
pageSize: 10,
instrumentName: "",
instrumentTypeId: "",
startTime: "",
endTime: "",
},
this.getList();
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style scoped></style>
.el-form { \ No newline at end of file
margin-top: 15px;
margin-left: 10px;
}
.el-table {
margin-left: 10px;
}
</style>
\ No newline at end of file
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="labName" label="实验室" /> <el-table-column align="center" prop="labName" label="实验室" />
<el-table-column align="center" prop="chapterContent" label="章节内容" /> <el-table-column align="center" prop="chapterContent" label="章节内容" />
<el-table-column align="center" prop="schoolAccessoryList" label="附件"> <el-table-column align="center" prop="schoolAccessoryList" label="附件" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(accessory, index) in scope.row.accessoryList" :key="index"> <div v-for="(accessory, index) in scope.row.accessoryList" :key="index">
<a :href="baseUrl + accessory.accessoryUrl" target="_blank">{{ accessory.accessoryName }}</a> <a :href="baseUrl + accessory.accessoryUrl" target="_blank">{{ accessory.accessoryName }}</a>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<template v-else-if="scope.row.applyState === '1' && scope.row.state === '0'"> <template v-else-if="scope.row.applyState === '1' && scope.row.state === '0'">
<div> <div>
<el-button @click="handleLook(scope.row)" type="text" size="small">查看</el-button> <el-button @click="handleLook(scope.row)" type="text" size="small">查看</el-button>
<el-button size="small" type="text" @click="upload.open = true">上传附件</el-button> <el-button size="small" type="text" @click="handleUpload(scope.row)">上传附件</el-button>
</div> </div>
</template> </template>
<template v-else> <template v-else>
...@@ -166,11 +166,13 @@ ...@@ -166,11 +166,13 @@
</el-dialog> </el-dialog>
<!-- 导入弹出框 --> <!-- 导入弹出框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <el-dialog :title="upload.title" :visible.sync="opendr" width="400px" append-to-body>
<FileUploadlab @input="getFileList" :limit="1" :value="fileList"></FileUploadlab> <el-form ref="postForm" :model="postForm" label-width="110px">
<FileUploadlab @input="getFileList" :limit="1" :value="fileList"></FileUploadlab>
</el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button> <el-button type="primary" @click="submitFileForm()"> 确 定 </el-button>
<el-button @click="upload.open = false">取 消</el-button> <el-button @click="cancel = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -223,6 +225,11 @@ export default { ...@@ -223,6 +225,11 @@ export default {
form: { form: {
}, },
postForm: {
id: '',
accessoryUrl: '',
accessoryName: '',
},
upload: { upload: {
// 是否显示弹出层(用户导入) // 是否显示弹出层(用户导入)
open: false, open: false,
...@@ -242,6 +249,7 @@ export default { ...@@ -242,6 +249,7 @@ export default {
isEdit: true, isEdit: true,
total: 0, total: 0,
dialogTableVisible: false, dialogTableVisible: false,
opendr: false,
} }
}, },
created() { created() {
...@@ -293,58 +301,84 @@ export default { ...@@ -293,58 +301,84 @@ export default {
this.getList(); this.getList();
}, },
//提交按钮 //提交按钮
submitFileForm(data) { submitFileForm() {
console.log("getFileList", data);
// 将 fileList 中的数据转换成 schoolAccessoryList 格式的数组 // 将 fileList 中的数据转换成 schoolAccessoryList 格式的数组
const schoolAccessoryList = this.fileList.map(item => ({ const schoolAccessoryList = this.fileList.map(item => ({
accessoryUrl: item.originalFilename, accessoryUrl: item.fjlj,
accessoryName: item.url accessoryName: item.fjmc
})); }));
// 定义请求的参数对象 // 定义请求的参数对象
const params = { const params = {
id: this.form.id, id: this.postForm.id,
schoolAccessoryList: schoolAccessoryList schoolAccessoryList: schoolAccessoryList
}; };
console.log(params);
// 发送上传文件列表请求 // 发送上传文件列表请求
uploadFilelist(params).then(response => { uploadFilelist(params).then(response => {
console.log(params); console.log(params);
this.opendr = false;
this.getList();
console.log("schoolAccessoryList", schoolAccessoryList); console.log("schoolAccessoryList", schoolAccessoryList);
}); });
}, },
//上传附件按钮操作 //上传附件按钮操作
handleUpload() { handleUpload(row) {
console.log(row);
this.postForm.id = row.id;
this.opendr = true;
}, },
//取消按钮 //取消按钮
cancle() { cancle() {
this.dialogTableVisible = false; this.dialogTableVisible = false;
this.opendr = false;
}, },
//上传按钮 //上传按钮
// getFileList(data) {
// console.log('data', data);
// this.fileList = data;
// if (this.fileList.length !== 0) {
// const file = data[0]; // 获取第一个文件的信息
// console.log('file', file);
// this.accessoryUrl = file.originalFilename;
// this.accessoryName = file.url;
// console.log(this.accessoryUrl, this.accessoryName);
// } else {
// this.form.accessoryUrl = '';
// this.form.accessoryName = '';
// }
// },
getFileList(data) { getFileList(data) {
console.log('data', data); console.log('data', data);
this.fileList = data; this.fileList = data;
if (this.fileList.length !== 0) { console.log(this.fileList);
const file = data[0]; // 获取第一个文件的信息 if (this.fileList.length != 0) {
console.log('file', file); this.postForm.accessoryUrl = data[0].fjlj;
this.accessoryUrl = file.originalFilename; this.postForm.accessoryName = data[0].fjmc;
this.accessoryName = file.url; console.log('this.postForm', this.postForm);
console.log(this.accessoryUrl, this.accessoryName);
} else { } else {
this.form.accessoryUrl = ''; this.postForm.accessoryUrl = '';
this.form.accessoryName = ''; this.postForm.accessoryName = '';
}
}
}, },
} }
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
\ No newline at end of file .el-table__column--ellipsis .cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
\ No newline at end of file
...@@ -51,7 +51,13 @@ ...@@ -51,7 +51,13 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="schoolAccessoryList" label="实验结果" /> <el-table-column align="center" prop="schoolAccessoryList" label="实验结果" width="200px">
<template slot-scope="scope">
<div v-for="(accessory, index) in scope.row.accessoryList" :key="index">
<a :href="baseUrl + accessory.accessoryUrl" target="_blank">{{ accessory.accessoryName }}</a>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="declareState" label="申报状态"> <el-table-column align="center" prop="declareState" label="申报状态">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div>{{ selectDictLabel(dict.type.declare_state, row.declareState) }}</div> <div>{{ selectDictLabel(dict.type.declare_state, row.declareState) }}</div>
...@@ -263,11 +269,13 @@ ...@@ -263,11 +269,13 @@
</el-dialog> </el-dialog>
<!-- 导入弹出框 --> <!-- 导入弹出框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <el-dialog :title="upload.title" :visible.sync="opendr" width="400px" append-to-body>
<FileUploadlab @input="getFileList" :limit="1" :value="fileList"></FileUploadlab> <el-form ref="postForm" :model="postForm" label-width="110px">
<FileUploadlab @input="getFileList" :limit="1" :value="fileList"></FileUploadlab>
</el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button> <el-button type="primary" @click="submitFileForm()"> 确 定 </el-button>
<el-button @click="upload.open = false">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<pagination v-show="total > 0" :total="total" :page.sync="queryForm.pageNum" :limit.sync="queryForm.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryForm.pageNum" :limit.sync="queryForm.pageSize"
...@@ -343,12 +351,19 @@ export default { ...@@ -343,12 +351,19 @@ export default {
url: process.env.VUE_APP_BASE_API + '/school/student/importData' url: process.env.VUE_APP_BASE_API + '/school/student/importData'
}, },
schoolTeacherExperimentApplyLabsList: [], schoolTeacherExperimentApplyLabsList: [],
schoolAccessoryList: [],
//级部 //级部
gradeList: [], gradeList: [],
gradeLists: [], gradeLists: [],
total: 0, total: 0,
postForm: {
id: '',
accessoryUrl: '',
accessoryName: '',
},
dialogTableVisible: false, dialogTableVisible: false,
open: false, open: false,
opendr: false,
rules: { rules: {
sub: [ sub: [
{ required: true, message: "学科不能为空", trigger: "blur" } { required: true, message: "学科不能为空", trigger: "blur" }
...@@ -394,7 +409,12 @@ export default { ...@@ -394,7 +409,12 @@ export default {
getApplylist(this.queryForm) getApplylist(this.queryForm)
.then(response => { .then(response => {
this.tableData = response.rows; this.tableData = response.rows;
this.tableData = response.rows.map(item => {
item.accessoryList = item.schoolAccessoryList; // 将附件信息赋值给accessoryList属性
return item;
});
console.log('response', response); console.log('response', response);
console.log(response.rows.a);
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}) })
...@@ -503,39 +523,38 @@ export default { ...@@ -503,39 +523,38 @@ export default {
getFileList(data) { getFileList(data) {
console.log('data', data); console.log('data', data);
this.fileList = data; this.fileList = data;
if (this.fileList.length !== 0) { console.log(this.fileList);
const file = data[0]; // 获取第一个文件的信息 if (this.fileList.length != 0) {
console.log('file', file); this.postForm.accessoryUrl = data[0].fjlj;
this.accessoryUrl = file.accessoryUrl; this.postForm.accessoryName = data[0].fjmc;
this.accessoryName = file.accessoryName; console.log('this.postForm', this.postForm);
setTimeout(() => {
console.log(this.accessoryUrl, this.accessoryName);
}, 100); // 等待100毫秒后再打印
} else { } else {
this.form.accessoryUrl = ''; this.postForm.accessoryUrl = '';
this.form.accessoryName = ''; this.postForm.accessoryName = '';
} }
}, },
//提交按钮 //提交按钮
submitFileForm(data) { submitFileForm() {
console.log("getFileList", data);
// 将 fileList 中的数据转换成 schoolAccessoryList 格式的数组 // 将 fileList 中的数据转换成 schoolAccessoryList 格式的数组
const schoolAccessoryList = this.fileList.map(item => ({ const schoolAccessoryList = this.fileList.map(item => ({
accessoryUrl: item.originalFilename, accessoryUrl: item.fjlj,
accessoryName: item.url accessoryName: item.fjmc
})); }));
// 定义请求的参数对象 // 定义请求的参数对象
const params = { const params = {
id: this.form.id, id: this.postForm.id,
schoolAccessoryList: schoolAccessoryList schoolAccessoryList: schoolAccessoryList
}; };
console.log(params);
// 发送上传文件列表请求 // 发送上传文件列表请求
getResult(params).then(response => { getResult(params).then(response => {
console.log(params); console.log(params);
this.opendr = false;
this.getList();
console.log("schoolAccessoryList", schoolAccessoryList); console.log("schoolAccessoryList", schoolAccessoryList);
}); });
}, },
...@@ -688,18 +707,23 @@ export default { ...@@ -688,18 +707,23 @@ export default {
}, },
//上传附件按钮操作 //上传附件按钮操作
handleResult() { handleResult(row) {
console.log(row);
this.upload.title = '实验结果' this.upload.title = '实验结果'
this.upload.open = true this.opendr = true;
this.postForm.id = row.id;
}, },
//取消按钮 //取消按钮
cancel() { cancel() {
this.dialogTableVisible = false; this.dialogTableVisible = false;
this.open = false; this.open = false;
this.opendr = false;
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -38,16 +38,12 @@ ...@@ -38,16 +38,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="证书照片" align="center" prop="schoolAccessoryList"> <el-table-column label="证书照片" align="center" prop="schoolAccessoryList">
<!-- <template slot-scope="scope">
<ListImage :image-url="pev + scope.row.accessoryUrl"></ListImage>
</template> -->
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <ListImage :image-url="pev+scope.row.picUrl"></ListImage> --> <el-image style="width: 100px; height: 100px" :src="scope.row.pictureUrl"
<!-- previewSrcList 开启预览大图的功能。--> :preview-src-list="scope.row.previewUrls"></el-image>
<el-image style="width: 100px; height: 100px" :src="scope.row.url" :preview-src-list="srcList">
</el-image>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注1" align="center" prop="remark1" /> <el-table-column label="备注1" align="center" prop="remark1" />
<el-table-column label="备注2" align="center" prop="remark2" /> <el-table-column label="备注2" align="center" prop="remark2" />
<el-table-column label="备注3" align="center" prop="remark3" /> <el-table-column label="备注3" align="center" prop="remark3" />
...@@ -118,14 +114,16 @@ ...@@ -118,14 +114,16 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="证书照片"> <el-form-item prop="schoolAccessoryList" label="证书照片">
<el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*" <el-form-item prop="schoolAccessoryList" label="证书照片">
:show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" <el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
:http-request="uploadImage" :disabled="nowType == 2 ? true : false"> :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"
<img v-if="imageUrl" :src="imageUrl" style="width: 178px; height: 178px;" class="avatar" alt="" /> :http-request="uploadImage">
<!-- :preview-src-list="[imageUrl]"--> <img v-if="form.schoolAccessoryList && form.schoolAccessoryList.length > 0"
<i v-else class="el-icon-plus avatar-uploader-icon"></i> :src="form.schoolAccessoryList[0].accessoryUrl" class="avatar" />
</el-upload> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
...@@ -156,7 +154,10 @@ ...@@ -156,7 +154,10 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog ref="previewDialog" title="预览图片" :visible.sync="previewDialogVisible">
<el-image style="width: 100%; max-height: 80vh; object-fit: contain" :src="previewImageUrl"
fit="contain"></el-image>
</el-dialog>
</div> </div>
</template> </template>
...@@ -178,6 +179,8 @@ export default { ...@@ -178,6 +179,8 @@ export default {
components: { picAvatar }, components: { picAvatar },
data() { data() {
return { return {
//缩略图
srcList: [],
// 图片路径 // 图片路径
imageUrl: undefined, imageUrl: undefined,
pev: process.env.VUE_APP_BASE_API, pev: process.env.VUE_APP_BASE_API,
...@@ -185,6 +188,7 @@ export default { ...@@ -185,6 +188,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
previewImageUrl: '',
//获取子组件传来的信息 //获取子组件传来的信息
pic: [], pic: [],
// 图片路径 // 图片路径
...@@ -199,6 +203,7 @@ export default { ...@@ -199,6 +203,7 @@ export default {
dialogTitle: '', //弹窗标题 dialogTitle: '', //弹窗标题
dialogVisible: false, dialogVisible: false,
nowOption: null, nowOption: null,
uploadedFiles: [],
form: { form: {
schoolYear: '', schoolYear: '',
teacherId: '', teacherId: '',
...@@ -210,9 +215,10 @@ export default { ...@@ -210,9 +215,10 @@ export default {
remark1: '', remark1: '',
remark2: '', remark2: '',
remark3: '', remark3: '',
schoolAccessoryList: '', schoolAccessoryList: [],
}, },
previewDialogVisible: false,
teacherList: [], teacherList: [],
rules: {}, rules: {},
nowType: 0, // 0新增、1编辑、2查看 nowType: 0, // 0新增、1编辑、2查看
...@@ -232,15 +238,25 @@ export default { ...@@ -232,15 +238,25 @@ export default {
this.getTeacher(); this.getTeacher();
}, },
methods: { methods: {
handlePreview(url) {
this.previewImageUrl = url;
this.$refs.previewDialog.open();
},
//获取列表数据 //获取列表数据
getList() { getList() {
getCompetition(this.queryForm).then(response => { getCompetition(this.queryForm).then(response => {
this.competitionData = response.rows; this.competitionData = response.rows;
console.log('response', response); console.log('response', response);
this.total = response.total this.total = response.total;
this.loading = false this.loading = false;
})
this.competitionData.forEach(item => {
item.previewUrls = [item.schoolAccessoryList.map(accessory => accessory.accessoryUrl)];
item.pictureUrl = item.schoolAccessoryList.map(accessory => accessory.accessoryUrl);
});
});
}, },
//获取图片信息 //获取图片信息
getSchoolInfoPic(val) { getSchoolInfoPic(val) {
this.pic = val this.pic = val
...@@ -277,14 +293,19 @@ export default { ...@@ -277,14 +293,19 @@ export default {
.then(response => { .then(response => {
this.uploadLoading = false this.uploadLoading = false
this.$modal.msgSuccess('上传成功') this.$modal.msgSuccess('上传成功')
this.imageUrl = this.pev + response.url this.imageUrl = process.env.VUE_APP_BASE_API + response.url
this.form.avatar = response.url // 添加以下代码将文件信息添加到 uploadedFiles 数组中
this.uploadedFiles.push({
accessoryUrl: process.env.VUE_APP_BASE_API + response.url,
accessoryName: fileData.name
})
}) })
.catch(error => { .catch(error => {
this.uploadLoading = false this.uploadLoading = false
}) })
}, },
//重置 //重置
resetQuery() { resetQuery() {
...@@ -330,10 +351,13 @@ export default { ...@@ -330,10 +351,13 @@ export default {
const id = row.id const id = row.id
getCompetitionxq(id).then(response => { getCompetitionxq(id).then(response => {
if (response.code == 200) { if (response.code == 200) {
console.log(response);
Object.keys(this.form).forEach(key => { Object.keys(this.form).forEach(key => {
if (response.data[key]) { if (response.data[key]) {
this.$set(this.form, key, response.data[key]); this.$set(this.form, key, response.data[key]);
}
if (response.data.schoolAccessoryList && response.data.schoolAccessoryList.length > 0) {
this.imageUrl = response.data.schoolAccessoryList[0].accessoryUrl; // 将图片地址赋值给 imageUrl
} }
}) })
...@@ -353,11 +377,19 @@ export default { ...@@ -353,11 +377,19 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function () {
let fileList = []; // 添加这行代码定义 fileList 变量
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != "") { if (this.form.id != "") {
// 清空原有图片
this.form.schoolAccessoryList = [];
for (let i = 0; i < this.uploadedFiles.length; i++) {
const file = this.uploadedFiles[i];
this.form.schoolAccessoryList.push({
accessoryUrl: file.accessoryUrl,
accessoryName: file.accessoryName
});
}
updateCompetition(this.form).then(({ code }) => { updateCompetition(this.form).then(({ code }) => {
if (code == 200) { if (code == 200) {
this.$modal.msgSuccess('修改成功') this.$modal.msgSuccess('修改成功')
...@@ -368,12 +400,14 @@ export default { ...@@ -368,12 +400,14 @@ export default {
this.$modal.msgError("修改失败"); this.$modal.msgError("修改失败");
}); });
} else { } else {
for (let i = 0; i < fileList.length; i++) { // 清空原有图片
const file = fileList[i]; this.form.schoolAccessoryList = [];
// 将照片信息添加到 schoolAccessoryList 数组中
for (let i = 0; i < this.uploadedFiles.length; i++) {
const file = this.uploadedFiles[i];
this.form.schoolAccessoryList.push({ this.form.schoolAccessoryList.push({
accessoryUrl: file.url, accessoryUrl: file.accessoryUrl,
accessoryName: file.name accessoryName: file.accessoryName
}); });
} }
...@@ -389,6 +423,7 @@ export default { ...@@ -389,6 +423,7 @@ export default {
}); });
}, },
cancel() { cancel() {
this.dialogVisible = false; this.dialogVisible = false;
}, },
......
...@@ -236,7 +236,8 @@ export default { ...@@ -236,7 +236,8 @@ export default {
getProductCategory().then(((res) => { getProductCategory().then(((res) => {
if (res.code == 200) { if (res.code == 200) {
this.sbflOptions = res.data; this.sbflOptions = res.data;
// console.log('this.sbflOptions', this.sbflOptions); // console.log(this.sbflOptions);
console.log('this.sbflOptions', this.sbflOptions);
} }
})) }))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment