|
|
@@ -0,0 +1,145 @@
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div style="display:flex;align-items:center">
|
|
|
+ <el-input
|
|
|
+ :placeholder="$t('请输入搜索内容')"
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ v-model="params.content.where.condition"
|
|
|
+ style="width:200px"
|
|
|
+ size="mini"
|
|
|
+ class="input-with-select inline-16"
|
|
|
+ @keyup.native.enter="listData(params.content.pageNumber = 1)"
|
|
|
+ @clear="listData(params.content.pageNumber = 1)"
|
|
|
+ clearable>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 15px">
|
|
|
+ <tableDetail :layout="tablecols" :data="list" :opwidth="200" :custom="true" fixed-name="operation" height="calc(100vh - 460px)">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname === 'nominalpressure'">
|
|
|
+ {{tool.nominalPressureSet(scope.column.data[scope.column.columnname])}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'problem_description'">
|
|
|
+ <el-input v-if="nowRow == scope.column.data.rowindex" v-model="scope.column.data[scope.column.columnname]" :placeholder="$t(`请输入内容`)" size="mini"></el-input>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname] || '--'}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'processing'">
|
|
|
+ <el-input v-if="nowRow == scope.column.data.rowindex" v-model="scope.column.data[scope.column.columnname]" :placeholder="$t(`请输入内容`)" size="mini"></el-input>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname] || '--'}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'result'">
|
|
|
+ <el-input v-if="nowRow == scope.column.data.rowindex" v-model="scope.column.data[scope.column.columnname]" :placeholder="$t(`请输入内容`)" size="mini"></el-input>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname] || '--'}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'reason'">
|
|
|
+ <el-input v-if="nowRow == scope.column.data.rowindex" v-model="scope.column.data[scope.column.columnname]" :placeholder="$t(`请输入内容`)" size="mini"></el-input>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname] || '--'}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname]||scope.column.columnname === 'operation' ? scope.column.data[scope.column.columnname] : '--'}}</div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:opreation="scope">
|
|
|
+ <el-button type="text" size="mini" @click="saveClick(scope.data)" :disabled="data.status != '进行中'" v-if="isEdit && scope.data.rowindex == nowRow">{{$t(`保存`)}}</el-button>
|
|
|
+ <el-button type="text" size="mini" @click="editClick(scope.data)" :disabled="data.status != '进行中'" v-else>{{$t(`编辑`)}}</el-button>
|
|
|
+ </template>
|
|
|
+ </tableDetail>
|
|
|
+ <div class="container normal-panel" style="text-align:right;margin-bottom: -10px!important;">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="50"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ props: ["data"],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ options: [],
|
|
|
+ siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid,
|
|
|
+ params:{
|
|
|
+ "id": 2026012813264502,
|
|
|
+ "content": {
|
|
|
+ "sa_workorderid": this.$route.query.id,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 50,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ list:[],
|
|
|
+ tablecols:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ nowRow:-1,
|
|
|
+ isEdit:false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async listData(){
|
|
|
+ const res = await this.$api.requested(this.params)
|
|
|
+ this.list = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ editClick(data){
|
|
|
+ this.isEdit = true
|
|
|
+ this.nowRow = data.rowindex
|
|
|
+ },
|
|
|
+ async saveClick(data){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "20230215201903",
|
|
|
+ content: {
|
|
|
+ "sa_workorder_nodeid": data.sa_workorder_nodeid,
|
|
|
+ "sa_workorderid": this.data.sa_workorderid,
|
|
|
+ "iteminfos":[{
|
|
|
+ "sa_workorder_node_itemsid":data.sa_workorder_node_itemsid,
|
|
|
+ "problem_description":data.problem_description,
|
|
|
+ "processing":data.processing,
|
|
|
+ "result":data.result,
|
|
|
+ "reason":data.reason,
|
|
|
+ "qty":data.qty,
|
|
|
+ "itemid":data.itemid
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.isEdit = false
|
|
|
+ this.nowRow = -1
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.param.content.pageSize = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.listData(this.params.content.pageNumber = 1)
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).workMaterialsTable.tablecols
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+/* 强制所有单元格换行 */
|
|
|
+/deep/ .el-table .cell {
|
|
|
+ white-space: normal !important;
|
|
|
+}
|
|
|
+</style>
|