yxk_gk_master/components/system/chooseCheckProject.vue

111 lines
3.1 KiB
Vue
Raw Permalink Normal View History

2025-08-28 15:18:09 +08:00
<template>
<view class="dialog_out" >
<view class="dialog_container">
<uni-icons type="closeempty" size="40" class="close_icon" @click="choose()"></uni-icons>
<view class="dialog_title">选择检验项目</view>
<view class="search_container">
<view class="search_text">
<input type="search" placeholder="请输入名称" v-model="search_data.name"/>
</view>
<button @click="search(1)" type="primary">查询</button>
</view>
<view class="table_container">
<t-table border=0>
<t-tr font-size="18">
<t-th>检验项目代码</t-th>
<t-th>检验项目名称</t-th>
<t-th>检验标准</t-th>
<t-th>检验方法</t-th>
<t-th>检验仪器</t-th>
<t-th>操作</t-th>
</t-tr>
<span @click="choose(items)" v-for="items in tableList" :key="items.userId" class="t-tr-span">
<t-tr font-size="17" >
<t-td>{{items.code}}</t-td>
<t-td>{{items.name}}</t-td>
<t-td>{{items.norm}}</t-td>
<t-td>{{items.method}}</t-td>
<t-td>{{items.instrumentName}}</t-td>
<t-td style="color: #007AFF;" ><button @click="choose(items)" type="primary" plain="true">选择</button></t-td>
</t-tr>
</span>
<view v-if="show_nodata" class="nodata" style="text-align: center;font-size: 18px;color: #999;line-height: 40px;">暂无数据</view>
</t-table>
<uni-pagination show-icon="true" :pageSize="search_data.pagesize" :total="total_pages" :current="search_data.pageno" class="pagination" @change="changePages"></uni-pagination>
</view>
</view>
</view>
</template>
<script>
import 'static/css/chooseDialog.css'
import uniIcons from '@/components/uni-icons/uni-icons.vue'
import tTable from '@/components/t-table/t-table.vue';
import tTh from '@/components/t-table/t-th.vue';
import tTr from '@/components/t-table/t-tr.vue';
import tTd from '@/components/t-table/t-td.vue';
import uniPagination from '@/components/uni-pagination/uni-pagination.vue';
export default {
components: {
tTable,
tTh,
tTr,
tTd,
uniIcons,
uniPagination
},
props: {
},
data() {
return {
search_data:{
name:"",
pageno:1,//当前页数
pagesize:4,//1页几条数据
},
tableList: [],
total_pages: 0, //总页数
show_nodata: false,
}
},
mounted(){
this.search()
},
methods: {
search(n) {
if(n==1){
this.search_data.pageno=1;
}
this.$http.request({
url: '/apis/mes/checkProject/checkOfList',
method: 'post',
params: this.search_data,
}).then(res => {
if (res) {
if (res.data.code == 0) {
this.tableList = res.data.data ? res.data.data.datas : []
if (this.tableList.length == 0) {
this.show_nodata = true
}
this.total_pages = res.data.data ? res.data.data.totalPages * this.search_data.pagesize : 0
}
}
});
},
changePages(e) {
this.search_data.pageno = e.current;
this.search();
},
//点击选择
choose(val){
this.$emit("change", val);
}
},
}
</script>