| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- <!-- -->
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>维修单列表
- </h2>
- <div class="m-core">
- <el-form :inline="true"
- :model="searchForm">
- <el-form-item>
- <el-input v-model.trim="searchForm.search"
- @keyup.enter.native="search"
- placeholder='维修单号/学生姓名/编号'></el-input>
- </el-form-item>
- <el-form-item>
- <el-select placeholder="维修技师"
- v-model="searchForm.employeeId"
- clearable
- filterable>
- <el-option v-for="(item,index) in employeeList"
- :label="item.userName"
- :value="item.userId"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select placeholder="请选择分部"
- v-model="searchForm.organIdList"
- clearable>
- <el-option v-for="(item,index) in organList"
- :label="item.name"
- :value="item.id"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select placeholder="请选择乐器类型"
- v-model="searchForm.subjectId"
- clearable
- filterable>
- <el-option v-for="(item,index) in soundLists"
- :label="item.name"
- :value="item.id"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select placeholder="维修状态"
- v-model="searchForm.repairStatus"
- clearable>
- <el-option label="已完成"
- value="1"></el-option>
- <el-option label="维修中"
- value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select placeholder="维修类型"
- v-model="searchForm.type"
- clearable>
- <el-option label="线上"
- value="1"></el-option>
- <el-option label="线下"
- value="0"></el-option>
- </el-select>
- </el-form-item>
- <br />
- <el-form-item label="送修日期">
- <el-date-picker v-model.trim="searchForm.timer"
- style="width:400px;"
- type="daterange"
- value-format="yyyy-MM-dd"
- :picker-options="{
- firstDayOfWeek: 1
- }"
- range-separator="至"
- start-placeholder="送修开始日期"
- end-placeholder="送修结束日期"></el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="danger"
- @click="search">搜索</el-button>
- <el-button @click="onReSet"
- type="primary">重置</el-button>
- </el-form-item>
- </el-form>
- <div class="tableWrap">
- <el-table style="width: 100%"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- :data="tableList">
- <el-table-column align="center"
- prop="organName"
- label="分部"></el-table-column>
- <el-table-column align="center"
- prop="transNo"
- label="维修单号"
- width="160"></el-table-column>
- <el-table-column align="center"
- prop="studentName"
- label="学生姓名"></el-table-column>
- <el-table-column align="center"
- prop="studentId"
- label="学生编号"></el-table-column>
- <el-table-column align="center"
- prop="employeeName"
- label="维修技师"></el-table-column>
- <el-table-column align="center"
- prop="subjectName"
- label="乐器种类"></el-table-column>
- <el-table-column align="center"
- prop="type"
- label="维修类型">
- <template slot-scope="scope">{{scope.row.type?'线上':'线下'}}</template>
- </el-table-column>
- <el-table-column align="center"
- prop="instrumentNo"
- label="乐器编号"></el-table-column>
- <el-table-column align="center"
- prop="createTime"
- label="送修日期">
- <template slot-scope="scope">{{scope.row.createTime | formatTimer}}</template>
- </el-table-column>
- <el-table-column align="center"
- prop="finishTime"
- label="完成日期">
- <template slot-scope="scope">{{scope.row.finishTime | formatTimer}}</template></el-table-column>
- <el-table-column align="center"
- prop="repairStatus"
- label="状态">
- <template slot-scope="scope">{{scope.row.repairStatus?'已完成':'维修中'}}</template></el-table-column>
- <el-table-column align="center"
- label="操作">
- <template slot-scope="scope">
- <el-button type="text"
- @click="showDetail(scope.row)">详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination :total="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList" />
- </div>
- </div>
- <el-dialog title="维修单详情"
- :close-on-click-modal="false"
- :visible.sync="repairVisible"
- width="600px">
- <el-form :model="visibleForm" :inline="true">
- <el-row>
- <el-col :span="12">
- <el-form-item label="维修单号:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.transNo}}</p>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="乐器编号:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.instrumentNo}}</p>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="学生姓名:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.studentName}}</p>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="归属乐团:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.studentSchool}}</p>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="联系人:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.contactName}}</p>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="联系方式:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.contactMobile}}</p>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="邮寄地址:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.address}}</p>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="取件方式:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.sendType=='0'?'自取':'邮寄'}}</p>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="维修服务费:">
- <p v-if="activeRow"
- class="visibleCell">{{activeRow.amount}}元</p>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="问题描述及解决方案:" style="width: 100%; margin-bottom: 0"></el-form-item>
- <el-input type='textarea'
- v-if="activeRow"
- style="width: 100%"
- :rows="3"
- v-model="activeRow.description"
- :disabled="activeRow&&Boolean(activeRow.finishTime)"></el-input>
- <el-form-item label="收费组成:" style="width: 100%; margin-bottom: 0" v-if="activeRow && activeRow.feeList"></el-form-item>
- <el-input type='textarea'
- v-if="activeRow && activeRow.feeList"
- style="width: 100%"
- :rows="3"
- v-model="activeRow.feeList"
- :disabled="true"></el-input>
- <el-form-item label="商品列表:" style="width: 100%; margin-bottom: 0"></el-form-item>
- <el-table style="width: 100%" v-if="activeRow"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- :data="activeRow.goodsList">
- <el-table-column align="center" prop="name" label="商品名"></el-table-column>
- <el-table-column align="center" prop="groupPurchasePrice" label="商品价格(元)" ></el-table-column>
- </el-table>
- </el-form>
- <span slot="footer"
- class="dialog-footer">
- <el-button type="danger"
- v-if="!(activeRow&&Boolean(activeRow.finishTime))"
- v-permission="'studentRepair/repairSuccess'"
- @click="repairEnd('save',activeRow)">保存</el-button>
- <el-button type="primary"
- v-permission="'studentRepair/repairSuccess'"
- v-if="!(activeRow&&activeRow.finishTime)"
- @click="repairEnd('end',activeRow)">完成维修</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import axios from "axios";
- import { getToken } from "@/utils/auth";
- import pagination from "@/components/Pagination/index";
- import load from "@/utils/loading";
- import { getEmployeeOrgan, getSoundTree } from "@/api/buildTeam";
- import { findTechnician, studentRepairList, repairSuccess } from "@/api/repairManager"
- export default {
- components: { pagination },
- data () {
- return {
- searchForm: {
- search: null,
- employeeId: null,
- organIdList: null,
- repairStatus: null,
- subjectId: null,
- time: []
- },
- repairVisible: false,
- employeeList: [],
- tableList: [],
- organList: [],
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50] // 选择限制显示条数
- },
- soundLists: [],
- soundList: [],
- isInit: false,
- visibleForm: {},
- activeRow: null
- };
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created () { },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted () {
- findTechnician().then(res => {
- if (res.code == 200) {
- this.employeeList = res.data;
- }
- });
- getEmployeeOrgan().then(res => {
- if (res.code == 200) {
- this.organList = res.data;
- }
- });
- // 获取声部
- getSoundTree({ tenantId: 1, rows: 9999 }).then(res => {
- if (res.code == 200) {
- if (res.code == 200) {
- this.soundList = res.data.rows;
- this.getSound();
- }
- }
- })
- if (!this.isInit) {
- this.init();
- }
- },
- activated () {
- this.init();
- },
- methods: {
- init () {
- this.isInit = true;
- this.getList()
- },
- getList () {
- let obj = JSON.parse(JSON.stringify(this.searchForm));
- obj.page = this.rules.page;
- obj.rows = this.rules.limit;
- if (this.searchForm.timer && this.searchForm.timer.length > 0) {
- obj.startTime = this.searchForm.timer[0];
- obj.endTime = this.searchForm.timer[1];
- }
- delete obj.timer;
- studentRepairList(obj).then(res => {
- if (res.code == 200) {
- this.isInit = false;
- this.tableList = res.data.rows;
- this.rules.total = res.data.total
- }
- })
- },
- getSound () {
- // soundLists
- // soundList
- this.soundLists = [];
- for (let i in this.soundList) {
- if (this.soundList[i].subjects.length > 0) {
- this.soundLists = this.soundLists.concat(this.soundList[i].subjects)
- }
- }
- },
- onReSet () {
- this.searchForm = {
- search: null,
- employeeId: null,
- organIdList: null,
- repairStatus: null,
- subjectId: null,
- time: []
- }
- this.search();
- },
- search () {
- this.rules.page = 1;
- this.getList()
- },
- showDetail (row) {
- let goodsList = row.goodsJson ? JSON.parse(row.goodsJson) : []
- row.goodsList = goodsList
- this.activeRow = row;
- console.log(row)
- this.repairVisible = true;
- },
- repairEnd (str, row) {
- let repairStatus = null;
- if (str && str == 'end') {
- repairStatus = 1
- }
- repairSuccess({ repairStatus: repairStatus, id: row.id, description: row.description }).then(res => {
- if (res.code == 200) {
- if (str && str == 'end') {
- this.$message.success('完成维修')
- } else {
- this.$message.success('保存成功')
- }
- this.repairVisible = false;
- this.getList();
- }
- })
- }
- },
- watch: {
- repairVisible (val) {
- if (!val) {
- this.activeRow = null;
- }
- }
- }
- };
- </script>
- <style lang='scss' scoped>
- .visibleCell {
- // width: 180px;
- }
- </style>
|