| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud v-show="!detailVisible" :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | :upload-before="uploadBefore" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @row-dblclick="rowClick" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="$refs.crud.rowView(row,index)">查 看</el-button> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="rowClick(row)">查 看</el-button> |
| | | <el-button icon="el-icon-check" :size="size" :type="type" :disabled="row.state == 1" @click="handleSendorder(row)">派 单</el-button> |
| | | <el-button icon="el-icon-edit" :size="size" :type="type" :disabled="row.state >= 1" @click="$refs.crud.rowEdit(row,index)">编 辑</el-button> |
| | | <el-button icon="el-icon-delete" :size="size" :type="type" :disabled="row.state >= 1" @click="$refs.crud.rowDel(row,index)">删 除</el-button> |
| | |
| | | |
| | | <!-- 弹窗, 派单 --> |
| | | <sendorder v-if="sendorderVisible" ref="sendorder" @refreshOnLoad="refreshChange"></sendorder> |
| | | <repairsorder-detail v-if="detailVisible" ref="detailVisible" :detailInfo="detailInfo" @isDetail="isDetail"></repairsorder-detail> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | import option from "@/const/repairsorder/repairsorder"; |
| | | import {mapGetters} from "vuex"; |
| | | import sendorder from "./sendorder.vue" |
| | | import RepairsorderDetail from "@/views/repairsorder/repairsorderDetail"; |
| | | |
| | | export default { |
| | | components: { |
| | | RepairsorderDetail, |
| | | sendorder |
| | | }, |
| | | data() { |
| | |
| | | selectionList: [], |
| | | option: option, |
| | | data: [], |
| | | sendorderVisible: false |
| | | sendorderVisible: false, |
| | | detailVisible:false, |
| | | detailInfo:{}, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | if (!picUrls){ |
| | | row.picUrls = null |
| | | } |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | uploadBefore(file, done, loading,column) { |
| | | if (["image","video"].includes(file.type.split("/")[0])){ |
| | | done() |
| | | }else { |
| | | this.$message.warning('请上传图片或视频') |
| | | loading() |
| | | } |
| | | }, |
| | | handleSendorder(row) { |
| | | this.sendorderVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.sendorder.init(row) |
| | | }) |
| | | }, |
| | | //点击当前行事件 |
| | | rowClick(val){ |
| | | this.detailInfo = val |
| | | this.isDetail(); |
| | | }, |
| | | isDetail(){ |
| | | this.detailVisible = !this.detailVisible |
| | | } |
| | | } |
| | | }; |