|
|
@@ -0,0 +1,144 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="addBtn((drawerVisible = true))"
|
|
|
+ >{{ $t(btnTitle)}}</el-button
|
|
|
+ >
|
|
|
+ <el-drawer
|
|
|
+ :title="$t(drawerTitle)"
|
|
|
+ :visible.sync="drawerVisible"
|
|
|
+ size="80%"
|
|
|
+ direction="rtl"
|
|
|
+ append-to-body
|
|
|
+ :show-close="false"
|
|
|
+ @close="onClose">
|
|
|
+ <div class="drawer__panel" style="margin-bottom: 0 !important;">
|
|
|
+ <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
|
|
|
+ v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)"
|
|
|
+ size="small" class="input-with-select inline-16 layout_search__panel" clearable>
|
|
|
+ </el-input>
|
|
|
+ <table-detail :layout="tablecols" :checkbox="true" :data="list" :custom="true" :width="true" :height="tableHieght" minHeight="200px" fixedName="operation"
|
|
|
+ @selectionChange="selectionChange" style="margin-top: 10px">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname == 'nominalpressure'">
|
|
|
+ {{tool.nominalPressureSet(scope.column.data[[scope.column.columnname]])}}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </table-detail>
|
|
|
+ <div class="container normal-panel" style="text-align:right;padding-bottom: 0!important;">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[50, 100, 150, 200]"
|
|
|
+ :page-size="50"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ @click="drawerVisible = false"
|
|
|
+ class="normal-btn-width inline-16"
|
|
|
+ >{{ $t("取 消") }}</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="onSubmit"
|
|
|
+ class="normal-btn-width"
|
|
|
+ :disabled="selectList.length == 0"
|
|
|
+ >{{ $t("确 定") }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "btnAdd",
|
|
|
+ props:['btnTitle','drawerTitle','param','tablecols','sa_workorderid'],
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ drawerVisible:false,
|
|
|
+ tableHieght:'calc(100vh - 240px)',
|
|
|
+ list:[],
|
|
|
+ currentPage:0,
|
|
|
+ total:0,
|
|
|
+ loading:false,
|
|
|
+ selectList:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ addBtn(){
|
|
|
+ this.drawerVisible = true
|
|
|
+ this.selectList = []
|
|
|
+ this.listData(this.param.content.pageNumber = 1)
|
|
|
+ },
|
|
|
+ async listData(){
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
+ console.log(res.data,'data')
|
|
|
+ this.list = res.data
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ this.total = res.total
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.param.content.pageSize = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ selectionChange(select){
|
|
|
+ console.log(select)
|
|
|
+ this.selectList = select
|
|
|
+ },
|
|
|
+ async onSubmit(){
|
|
|
+ let iteminfos = this.selectList.map(item =>{
|
|
|
+ return {
|
|
|
+ "sa_workorder_node_itemsid":0,
|
|
|
+ "problem_description":item.problem_description,
|
|
|
+ "processing":item.processing,
|
|
|
+ "result":item.result,
|
|
|
+ "reason":item.reason,
|
|
|
+ "qty":item.qty,
|
|
|
+ "itemid":item.itemid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id:20230215201903,
|
|
|
+ content:{
|
|
|
+ sa_workorder_nodeid:0,
|
|
|
+ sa_workorderid:this.sa_workorderid,
|
|
|
+ iteminfos:iteminfos
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.code == 0){
|
|
|
+ this.tool.showMessage(res,()=>{})
|
|
|
+ }else {
|
|
|
+ this.drawerVisible = false
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onClose(){}
|
|
|
+ },
|
|
|
+
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|