| | |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="单据号"> |
| | | <j-input placeholder="请输入单据号" v-model="queryParam.num"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="保养类型"> |
| | | <j-dict-select-tag placeholder="请选择保养类型" v-model="queryParam.type" dictCode="maintenance_type" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
| | | <a-button @click="handleAdd" type="primary" icon="plus" v-has="'MaintenancePlan:add&edit&submit'">新增</a-button> |
| | | </div> |
| | | |
| | | <!-- table区域-begin --> |
| | |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)" v-if="record.status==='created'||record.status==='rejected'">编辑</a> |
| | | <a @click="handleEdit(record)" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'">编辑</a> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" v-if="record.status==='created'||record.status==='rejected'"> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'"> |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/> |
| | | <a-popconfirm title="提交后不可撤回,确定提交吗?" @confirm="() => handleSubmit(record)" v-if="record.status==='created'||record.status==='rejected'"> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'"/> |
| | | <a-popconfirm title="提交后不可撤回,确定提交吗?" @confirm="() => handleSubmit(record)" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'"> |
| | | <a>提交</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/> |
| | | <a-popconfirm title="通过后不可撤销,确定通过吗?" @confirm="() => handleAudit(record)" v-if="record.status==='submitted'"> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'"/> |
| | | <a-popconfirm title="通过后不可撤销,确定通过吗?" @confirm="() => handleAudit(record)" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'"> |
| | | <a>通过</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='submitted'"/> |
| | | <a-popconfirm title="确定驳回吗?" @confirm="() => handleReject(record)" v-if="record.status==='submitted'"> |
| | | <a-divider type="vertical" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'"/> |
| | | <a-popconfirm title="确定驳回吗?" @confirm="() => handleReject(record)" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'"> |
| | | <a>驳回</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='submitted'"/> |
| | | <a-popconfirm title="下发后不可撤销,确定下发吗?" @confirm="() => handleDistrbute(record)" v-if="record.status==='passed'"> |
| | | <a-divider type="vertical" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'"/> |
| | | <a-popconfirm title="下发后不可撤销,确定下发吗?" @confirm="() => handleDistrbute(record)" v-if="record.status==='passed'" v-has="'MaintenancePlan:distribute'"> |
| | | <a>下发</a> |
| | | </a-popconfirm> |
| | | <span v-if="record.status==='distributed'" style="font-size: 12px;font-style: italic;">已生成工单</span> |
| | | </span> |
| | | |
| | | </a-table> |
| | |
| | | this.superFieldList = fieldList |
| | | }, |
| | | handleSubmit(record){ |
| | | this.loading = true; |
| | | putAction(this.url.submit,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("操作成功"); |
| | | }else{ |
| | | this.$message.success("操作失败"); |
| | | |
| | | } |
| | | }) |
| | | }).finally(res=>{ |
| | | this.loadData(); |
| | | }) |
| | | }, |
| | | handleAudit(record){ |
| | | this.loading = true; |
| | | putAction(this.url.audit,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("操作成功"); |
| | | }else{ |
| | | this.$message.success("操作失败"); |
| | | } |
| | | }) |
| | | }).finally(res=>{ |
| | | this.loadData(); |
| | | }) |
| | | }, |
| | | handleDistrbute(record){ |
| | | this.loading = true; |
| | | putAction(this.url.distrbute,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("操作成功"); |
| | | }else{ |
| | | this.$message.success("操作失败"); |
| | | } |
| | | }) |
| | | }).finally(res=>{ |
| | | this.loadData(); |
| | | }) |
| | | }, |
| | | handleReject(record){ |
| | | this.loading = true; |
| | | putAction(this.url.reject,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("操作成功"); |
| | | }else{ |
| | | this.$message.success("操作失败"); |
| | | } |
| | | }) |
| | | }).finally(res=>{ |
| | | this.loadData(); |
| | | }) |
| | | } |
| | | } |
| | | } |