Compare commits
	
		
			4 Commits
		
	
	
		
			75c1a042e1
			...
			27f2b505ff
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 27f2b505ff | ||
|   | 4362bcf887 | ||
|   | c036fa3153 | ||
|   | e33bda2f9a | 
| @ -63,3 +63,12 @@ export function updateCustomerAndCar(data){ | ||||
|     data | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| // 分类查询工单分页
 | ||||
| export function getPageType(params){ | ||||
|   return request({ | ||||
|     url: preUrl + "/pageType", | ||||
|     method: "get", | ||||
|     params | ||||
|   }) | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-select ref="otherSelected" v-model="otherSelected" clearable @blur="$emit('input-blur', $event)"> | ||||
|     <el-select ref="otherSelected" v-model="otherSelected" clearable filterable :filter-method="searchByName" @blur="$emit('input-blur', $event)"> | ||||
|       <el-option v-for="other in otherList" :key="other.id" :label="other.name" :value="other.id" v-show="false"/> | ||||
|       <el-table v-loading="loading" :data="otherList" :stripe="true" :show-overflow-tooltip="true" @row-click="rowClick"> | ||||
|         <el-table-column label="序号" align="center"> | ||||
| @ -8,20 +8,21 @@ | ||||
|             <span>{{ scope.$index + 1 }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column | ||||
|           width="180" | ||||
|           align="right"> | ||||
|           <template slot="header" slot-scope="scope"> | ||||
|             <el-input | ||||
|               v-model="queryParams.name" | ||||
|               size="mini" | ||||
|               @keyup.enter.native="getPage" | ||||
|               placeholder="输入关键字搜索"/> | ||||
|           </template> | ||||
|           <template slot-scope="scope"> | ||||
|             {{scope.row.name}} | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="名称" prop="name" width="180"/> | ||||
| <!--        <el-table-column--> | ||||
| <!--          width="180"--> | ||||
| <!--          align="right">--> | ||||
| <!--          <template slot="header" slot-scope="scope">--> | ||||
| <!--            <el-input--> | ||||
| <!--              v-model="queryParams.name"--> | ||||
| <!--              size="mini"--> | ||||
| <!--              @keyup.enter.native="getPage"--> | ||||
| <!--              placeholder="输入关键字搜索"/>--> | ||||
| <!--          </template>--> | ||||
| <!--          <template slot-scope="scope">--> | ||||
| <!--            {{scope.row.name}}--> | ||||
| <!--          </template>--> | ||||
| <!--        </el-table-column>--> | ||||
|         <el-table-column label="价格" prop="price" :show-overflow-tooltip="true" width="180"/> | ||||
|       </el-table> | ||||
|       <pagination @pagination="getPage" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | ||||
| @ -71,6 +72,10 @@ export default { | ||||
|     rowClick(row){ | ||||
|       this.$emit("selected", row) | ||||
|       this.$refs.otherSelected.blur() | ||||
|     }, | ||||
|     async searchByName(val){ | ||||
|       this.queryParams.name = val | ||||
|       await this.getPage() | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-select ref="projectSelect" v-model="projectSelected" clearable @blur="$emit('input-blur', $event)"> | ||||
|     <el-select ref="projectSelect" v-model="projectSelected" clearable filterable :filter-method="searchByName" @blur="$emit('input-blur', $event)"> | ||||
|       <el-option v-for="project in projectList" :key="project.id" :label="project.name" :value="project.id" v-show="false"/> | ||||
|       <el-table v-loading="loading" :data="projectList" :stripe="true" :show-overflow-tooltip="true" @row-click="rowClick"> | ||||
|         <el-table-column label="序号" align="center"> | ||||
| @ -8,21 +8,21 @@ | ||||
|             <span>{{ scope.$index + 1 }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
| <!--        <el-table-column label="商品名称" prop="name" :show-overflow-tooltip="true" width="180" />--> | ||||
|         <el-table-column | ||||
|           width="180" | ||||
|           align="right"> | ||||
|           <template slot="header" slot-scope="scope"> | ||||
|             <el-input | ||||
|               v-model="queryParams.name" | ||||
|               size="mini" | ||||
|               @keyup.enter.native="listPage" | ||||
|               placeholder="输入关键字搜索"/> | ||||
|           </template> | ||||
|           <template slot-scope="scope"> | ||||
|             {{scope.row.name}} | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="商品名称" prop="name" :show-overflow-tooltip="true" width="180" /> | ||||
| <!--        <el-table-column--> | ||||
| <!--          width="180"--> | ||||
| <!--          align="right">--> | ||||
| <!--          <template slot="header" slot-scope="scope">--> | ||||
| <!--            <el-input--> | ||||
| <!--              v-model="queryParams.name"--> | ||||
| <!--              size="mini"--> | ||||
| <!--              @keyup.enter.native="listPage"--> | ||||
| <!--              placeholder="输入关键字搜索"/>--> | ||||
| <!--          </template>--> | ||||
| <!--          <template slot-scope="scope">--> | ||||
| <!--            {{scope.row.name}}--> | ||||
| <!--          </template>--> | ||||
| <!--        </el-table-column>--> | ||||
|         <el-table-column label="规格" prop="spec" :show-overflow-tooltip="true" width="180"/> | ||||
|         <el-table-column label="商品编码" prop="code" :show-overflow-tooltip="true" width="180"/> | ||||
|       </el-table> | ||||
| @ -73,6 +73,10 @@ export default { | ||||
|     rowClick(row){ | ||||
|       this.$emit("selected", row) | ||||
|       this.$refs.projectSelect.blur() | ||||
|     }, | ||||
|     async searchByName(val){ | ||||
|       this.queryParams.name = val | ||||
|       await this.listPage() | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
							
								
								
									
										74
									
								
								src/views/repair/Components/WorkerChoose.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								src/views/repair/Components/WorkerChoose.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,74 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-select :loading="selectLoading" v-model="workerSelected" multiple clearable filterable :filter-method="changeQuery" @visible-change="handleChange"> | ||||
|       <el-option v-for="worker in workerList" | ||||
|                  :key="worker.id" | ||||
|                  :label="worker.userName + ' ' + (worker.isLeads === '0' ? '维修工' : '班组长') + ' ' + getWorkType(worker.workType)" | ||||
|                  :value="worker.id"/> | ||||
|     </el-select> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| 
 | ||||
| import {getWorkerPage} from '@/api/repair/repairworker' | ||||
| import {DICT_TYPE} from "@/utils/dict"; | ||||
| export default { | ||||
|   name: "WorkerChoose", | ||||
|   props:{ | ||||
|     value:{ | ||||
|       type: [Object,Array] | ||||
|     } | ||||
|   }, | ||||
|   data(){ | ||||
|     return{ | ||||
|       selectLoading: true, | ||||
|       workerSelected: null, | ||||
|       workerList:[], | ||||
|       queryParams:{ | ||||
|         pageNo: 1, | ||||
|         pageSize: 10, | ||||
|         userName: null | ||||
|       }, | ||||
|     } | ||||
|   }, | ||||
|   watch:{ | ||||
|     workerSelected(val){ | ||||
|       const list = this.workerList.filter(item => val.includes(item.id)) | ||||
|       this.$emit("input", list) | ||||
|       // this.$emit('input-blur') | ||||
|     } | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.listWorker() | ||||
|   }, | ||||
|   methods:{ | ||||
|     async listWorker(){ | ||||
|       this.selectLoading = true | ||||
|       try{ | ||||
|         const res = await getWorkerPage(this.queryParams) | ||||
|         this.workerList = res.data.records | ||||
|       }finally { | ||||
|         this.selectLoading = false | ||||
|       } | ||||
|     }, | ||||
|     async changeQuery(val){ | ||||
|       this.queryParams.userName = val | ||||
|       await this.listWorker() | ||||
|     }, | ||||
|     handleChange(val){ | ||||
|       if (!val){ | ||||
|         this.$emit('input-blur') | ||||
|       } | ||||
|     }, | ||||
|     getWorkType(val){ | ||||
|       const data = this.getDictDatas(DICT_TYPE.REPAIR_WORK_TYPE) | ||||
|       return data.find(item => item.value === val).label | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped lang="scss"> | ||||
| 
 | ||||
| </style> | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-select ref="ticketSelect" v-model="ticketSelected" clearable> | ||||
|     <el-select ref="ticketSelect" v-model="ticketSelected" clearable filterable :filter-method="searchByNo"> | ||||
|       <el-option v-for="ticket in ticketList" :key="ticket.id" :label="ticket.ticketNo" :value="ticket.id" v-show="false"/> | ||||
|       <el-table v-loading="loading" :data="ticketList" :stripe="true" :show-overflow-tooltip="true" @row-click="rowClick"> | ||||
|         <el-table-column label="序号" align="center"> | ||||
| @ -38,7 +38,8 @@ export default { | ||||
|       queryParams:{ | ||||
|         pageNo: 1, | ||||
|         pageSize: 10, | ||||
|         ticketsStatus: "01" | ||||
|         ticketsStatus: "01", | ||||
|         ticketNo: null | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
| @ -61,6 +62,10 @@ export default { | ||||
|       this.ticketSelected = row.id | ||||
|       this.$emit("selected", row.id) | ||||
|       this.$refs.ticketSelect.blur() | ||||
|     }, | ||||
|     async searchByNo(val){ | ||||
|       this.queryParams.ticketNo = val | ||||
|       await this.listTicket() | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -62,9 +62,9 @@ | ||||
|       </el-table-column> | ||||
|       <el-table-column align="center" label="施工人员" width="180" prop="repair"> | ||||
|         <div v-if="scope.row.id" class="item" slot-scope="scope"> | ||||
|           <StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.repair" | ||||
|                        :select-width="'15rem'" :is-get="scope.row.id"/> | ||||
|           <span class="item__txt">{{ scope.row.repair ? scope.row.repair.name : scope.row.repair }}</span> | ||||
|           <WorkerChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.repair" | ||||
|                         :select-width="'15rem'"/> | ||||
|           <span class="item__txt">{{ scope.row.repair ? getRepairName(scope.row.repair) : scope.row.repair }}</span> | ||||
|         </div> | ||||
|       </el-table-column> | ||||
|       <el-table-column align="center" label="销售人员" width="180" prop="sale"> | ||||
| @ -132,10 +132,12 @@ import request from "@/utils/request"; | ||||
| import {getOtherByName} from "@/api/repair/other"; | ||||
| import {getProjectByName} from "@/api/repair/project"; | ||||
| import {getWaresByName} from "@/api/repair/wares"; | ||||
| import WorkerChoose from "@/views/repair/Components/WorkerChoose.vue"; | ||||
| 
 | ||||
| export default { | ||||
|   name: "TicketItem", | ||||
|   components: { | ||||
|     WorkerChoose, | ||||
|     OtherForm, | ||||
|     OtherChoose, ProjectChoose, RepairProjectForm, WaresForm, ServerChoose, StaffChoose, PartChoose | ||||
|   }, | ||||
| @ -183,6 +185,7 @@ export default { | ||||
|   watch: { | ||||
|     list: { | ||||
|       handler(val) { | ||||
|         // console.log(val) | ||||
|         this.$emit("tableData", val) | ||||
|         const coupons = val.filter(item => item.coupon).map(item => item.coupon) | ||||
|         if (coupons && coupons.length > 0) { | ||||
| @ -192,7 +195,7 @@ export default { | ||||
|       deep: true | ||||
|     }, | ||||
|     inListData(val) { | ||||
|       console.log(val) | ||||
|       // console.log(val) | ||||
|       if (val && val.length > 0) { | ||||
|         val.forEach(item => { | ||||
|           item = { | ||||
| @ -281,7 +284,7 @@ export default { | ||||
|     }, | ||||
|     /** 保存数据 */ | ||||
|     save(row) { | ||||
|       // TODO 有BUG 更新表格 | ||||
|       // console.log(row) | ||||
|       if (row.id) { | ||||
|         row.itemStatus = (row.repair && this.itemType === 'project') ? "02" : "01" | ||||
|         row.totalPrice = row.count * row.price * (row.discount / 10) | ||||
| @ -387,8 +390,8 @@ export default { | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     getCouponName(id) { | ||||
|       // this. | ||||
|     getRepairName(data) { | ||||
|       return data.map(item => item.userName).join(',') | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -31,7 +31,7 @@ | ||||
|       <el-table-column align="center" label="单价" width="180" prop="itemPrice"/> | ||||
|       <el-table-column align="center" label="折扣" width="180" prop="itemDiscount"/> | ||||
|       <el-table-column align="center" label="金额" width="180" prop="itemMoney"/> | ||||
|       <el-table-column align="center" label="施工人员" width="180" prop="repairName"/> | ||||
|       <el-table-column align="center" label="施工人员" width="180" prop="repairNames"/> | ||||
|       <el-table-column align="center" label="销售人员" width="180" prop="saleName"/> | ||||
|       <el-table-column align="center" label="备注" width="180" prop="remark"/> | ||||
|     </el-table> | ||||
|  | ||||
							
								
								
									
										113
									
								
								src/views/repair/tickets/Components/TicketManagerItem.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										113
									
								
								src/views/repair/tickets/Components/TicketManagerItem.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,113 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <!-- 搜索 --> | ||||
|     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> | ||||
|       <el-form-item label="关键字" prop="ticketNo"> | ||||
|         <el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.ticketNo"/> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="时间" prop="searchTimeArray"> | ||||
|         <el-date-picker | ||||
|           value-format="yyyy-MM-dd HH:mm:ss" | ||||
|           v-model="queryParams.searchTimeArray" | ||||
|           type="daterange" | ||||
|           range-separator="至" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item> | ||||
|         <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | ||||
|         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|     <!-- 操作 --> | ||||
|     <el-row :gutter="10" class="mb8"> | ||||
|       <!-- todo 待补充 --> | ||||
|       <right-toolbar :showSearch.sync="showSearch"></right-toolbar> | ||||
|     </el-row> | ||||
|     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | ||||
|       <el-table-column label="序号" align="center"> | ||||
|         <template scope="scope"> | ||||
|           <span>{{ scope.$index + 1 }}</span> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="订单编号" align="center" prop="ticketNo" width="200"/> | ||||
|       <el-table-column label="维修类别" align="center" prop="repairType" width="180"> | ||||
|         <template slot-scope="scope"> | ||||
|           <dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="scope.row.repairType"/> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="客户名称" align="center" prop="userName" width="180"/> | ||||
|       <el-table-column label="车牌号" align="center" prop="carNo" width="180"/> | ||||
|       <el-table-column label="车系" align="center" prop="carBrandName" width="180"/> | ||||
|       <el-table-column label="手机号" align="center" prop="userMobile" width="180"/> | ||||
|       <el-table-column label="操作" fixed="right" align="center" width="180"> | ||||
|         <template slot-scope="scope"> | ||||
|           <el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)" | ||||
|           >查看 | ||||
|           </el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <!-- 分页组件 --> | ||||
|     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | ||||
|                 @pagination="listTickets" | ||||
|     /> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import {getPageType} from "@/api/repair/tickets/Tickets"; | ||||
| 
 | ||||
| export default { | ||||
|   name: "TicketManagerItem", | ||||
|   props:{ | ||||
|     // 是否展示了页面,是才请求 | ||||
|     isShow:{ | ||||
|       type: Boolean, | ||||
|     }, | ||||
|     isFinish:{ | ||||
|       type: Boolean, | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       queryParams: { | ||||
|         ticketNo: null, | ||||
|         searchTimeArray: [], | ||||
|         isFinish: this.isFinish ? "1" : "0" | ||||
|       }, | ||||
|       showSearch: true, | ||||
|       loading: false, | ||||
|       list: [], | ||||
|       total: 0 | ||||
|     } | ||||
|   }, | ||||
|   mounted() { | ||||
|     if(this.isShow){ | ||||
|       this.listTickets() | ||||
|     } | ||||
|   }, | ||||
|   methods:{ | ||||
|     async listTickets(){ | ||||
|       const res = await getPageType(this.queryParams) | ||||
|       if (res.data){ | ||||
|         this.list = res.data.records | ||||
|         this.total = res.data.total | ||||
|       } | ||||
|     }, | ||||
|     handleQuery(){ | ||||
| 
 | ||||
|     }, | ||||
|     resetQuery(){ | ||||
| 
 | ||||
|     }, | ||||
|     handleShow(row){ | ||||
| 
 | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped lang="scss"> | ||||
| 
 | ||||
| </style> | ||||
| @ -552,8 +552,8 @@ export default { | ||||
|           itemPrice: item.price, | ||||
|           itemDiscount: item.discount, | ||||
|           itemMoney: item.totalPrice, | ||||
|           repairId: item?.repair?.id, | ||||
|           repairName: item?.repair?.name, | ||||
|           repairIds: item?.repair.map(i => i.userId).join(','), | ||||
|           repairNames: item?.repair.map(i => i.userName).join(','), | ||||
|           saleId: item?.sale?.id, | ||||
|           saleName: item?.sale?.name, | ||||
|           itemTypeId: item?.type?.id, | ||||
|  | ||||
							
								
								
									
										34
									
								
								src/views/repair/tickets/TicketManager.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								src/views/repair/tickets/TicketManager.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| <template> | ||||
|   <div class="app-container"> | ||||
|     <el-tabs v-model="activeTab"> | ||||
|       <el-tab-pane label="待完成工单" name="unFinish"> | ||||
|         <TicketManagerItem :is-show="activeTab === 'unFinish'" :is-finish="false"/> | ||||
|       </el-tab-pane> | ||||
|       <el-tab-pane label="已完成工单" name="finish"> | ||||
|         <TicketManagerItem :is-show="activeTab === 'finish'" :is-finish="true"/> | ||||
|       </el-tab-pane> | ||||
|       <el-tab-pane label="领料申请单" name="getApply"> | ||||
|       </el-tab-pane> | ||||
|       <el-tab-pane label="退料申请单" name="backApply"> | ||||
|       </el-tab-pane> | ||||
|     </el-tabs> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import TicketManagerItem from "@/views/repair/tickets/Components/TicketManagerItem.vue"; | ||||
| 
 | ||||
| export default { | ||||
|   name: "TicketManager", | ||||
|   components: {TicketManagerItem}, | ||||
|   data(){ | ||||
|     return{ | ||||
|       activeTab: 'unFinish' | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped lang="scss"> | ||||
| 
 | ||||
| </style> | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user