|  |  | 
 |  |  |     <!-- 表格和分页 --> | 
 |  |  |     <template v-slot:table-wrap> | 
 |  |  |       <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> | 
 |  |  |         <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('新建分类信息表')" icon="el-icon-plus" v-permissions="['business:category:create']">新建</el-button></li> | 
 |  |  |         <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('新建货运配置',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:category:create']">新建</el-button></li> | 
 |  |  |         <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button></li> | 
 |  |  |       </ul> | 
 |  |  |       <el-table | 
 |  |  | 
 |  |  |         stripe | 
 |  |  |         @selection-change="handleSelectionChange" | 
 |  |  |       > | 
 |  |  |         <el-table-column type="selection" width="55"></el-table-column> | 
 |  |  |         <el-table-column prop="updateUser" label="更新人编码" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="updateTime" label="更新时间" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="remark" label="备注" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="name" label="单位名称" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column type="selection" :selectable="isChangeSelected" width="55"></el-table-column> | 
 |  |  |         <el-table-column  prop="icon" label="图标" min-width="100px"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-image v-if="row.iconFull" style="width: 50px; height: 50px; margin-right: 10px" :src="row.iconFull" | 
 |  |  |                       :preview-src-list="[row.iconFull]"> | 
 |  |  |             </el-image> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column prop="name" label="名称" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column  prop="isFixed" label="是否固定车辆" min-width="100px"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <span v-if="row.isFixed ==1" >是</span> | 
 |  |  |             <span v-else >否</span> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column  prop="detail" label="可选规格" min-width="200px"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |               <div v-if="row.detailList && row.detailList.length"> | 
 |  |  |                 <span v-for="(item,index) in row.detailList"> | 
 |  |  |                   {{item || ''}} | 
 |  |  |                   <span v-if="index < row.detailList.length-1" style="margin: 5px">|</span> | 
 |  |  |                 </span> | 
 |  |  |               </div> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column label="状态"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" | 
 |  |  |                        inactive-color="#ff4949" :active-value="0" :inactive-value="1"> | 
 |  |  |             <el-switch :disabled="row.isFixed ==1" @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" | 
 |  |  |             inactive-color="#ff4949" :active-value="0" :inactive-value="1"> | 
 |  |  |             </el-switch> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column prop="type" label="类型:0=品种配置;1=车辆类型配置;2=餐标配置;3=手续费配置;" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="detail" label="内容(车辆规格、餐标、手续费比例)" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="icon" label="图标(车辆类型使用)" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="isFixed" label="是否固定车辆(车辆类型使用):0=否;1=是;" min-width="100px"> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column prop="remark" label="描述" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="sortnum" label="排序码" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="updateUserName" label="操作人" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="updateTime" label="最近操作时间" min-width="150px"></el-table-column> | 
 |  |  |         <el-table-column | 
 |  |  |           v-if="containPermissions(['business:category:update', 'business:category:delete'])" | 
 |  |  |           label="操作" | 
 |  |  | 
 |  |  |           fixed="right" | 
 |  |  |         > | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-button type="text" @click="$refs.operaCategoryWindow.open('编辑分类信息表', row)" icon="el-icon-edit" v-permissions="['business:category:update']">编辑</el-button> | 
 |  |  |             <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button> | 
 |  |  |             <el-button type="text"   @click="$refs.operaCategoryWindow.open('编辑新建货运配置', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:category:update']">编辑</el-button> | 
 |  |  |             <el-button type="text"   @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">删除</el-button> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |       </el-table> | 
 |  |  | 
 |  |  |     return { | 
 |  |  |       // 搜索 | 
 |  |  |       searchForm: { | 
 |  |  |         id: '', | 
 |  |  |         deleted: '', | 
 |  |  |         status: '', | 
 |  |  |         createUser: '', | 
 |  |  |         createTime: '', | 
 |  |  |         updateUser: '', | 
 |  |  |         updateTime: '', | 
 |  |  |         remark: '', | 
 |  |  |         name: '', | 
 |  |  |         type: '', | 
 |  |  |         detail: '', | 
 |  |  |         icon: '', | 
 |  |  |         isFixed: '' | 
 |  |  |         type: 1 | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  | 
 |  |  |       'field.main': 'id' | 
 |  |  |     }) | 
 |  |  |     this.search() | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     isChangeSelected(row,index){ | 
 |  |  |       // if(row.isFixed ==1) { | 
 |  |  |       //   return false | 
 |  |  |       // } | 
 |  |  |       return true | 
 |  |  |     }, | 
 |  |  |     changeStatus (e, row) { | 
 |  |  |       this.working = true | 
 |  |  |       this.api.updateStatus({ id: row.id, status: e }) | 
 |  |  |         .then(res => { | 
 |  |  |           this.$tip.apiSuccess(res || '操作成功') | 
 |  |  |           this.search() | 
 |  |  |         }) | 
 |  |  |         .catch(e => { | 
 |  |  |           this.$tip.apiFailed(e) | 
 |  |  |         }) | 
 |  |  |         .finally(() => { | 
 |  |  |           this.working = false | 
 |  |  |         }) | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | </script> |