|
@@ -34,18 +34,33 @@
|
|
|
</el-button>
|
|
|
</router-link>
|
|
|
<el-button type="danger" size="mini" icon="el-icon-s-check" style="margin-left: 10px;" :disabled="scope.row.status == '1' ? false : true" @click="handleDelete(scope)">
|
|
|
- {{ scope.row.status == '1' ? "未处理 " : "已处理" }}
|
|
|
+ {{ scope.row.status == '1' ? "处理 " : "已处理" }}
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
+ <el-dialog title="处理备注" :visible.sync="dialogFormVisible">
|
|
|
+ <el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
|
|
|
+ <el-form-item label="备注" prop="mark">
|
|
|
+ <el-input v-model="temp.mark" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false">
|
|
|
+ 取消
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="updateData()">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { fetchList, deleteAdvice, fetchAdvice } from '@/api/advice'
|
|
|
+import { fetchList, updateAdvice, fetchAdvice } from '@/api/advice'
|
|
|
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
|
|
import waves from '@/directive/waves'
|
|
|
|
|
@@ -70,7 +85,12 @@ export default {
|
|
|
listQuery: {
|
|
|
page: 1,
|
|
|
pageSize: 10
|
|
|
- }
|
|
|
+ },
|
|
|
+ temp: {
|
|
|
+ id: undefined,
|
|
|
+ mark: ''
|
|
|
+ },
|
|
|
+ dialogFormVisible: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -94,21 +114,20 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleDelete({ $index, row }) {
|
|
|
- console.log(row.id)
|
|
|
- this.$confirm('您确定要处理吗', '警告', {
|
|
|
- confirmButtonText: '是的',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
+ this.temp = Object.assign({}, row) // copy obj
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ },
|
|
|
+ async updateData() {
|
|
|
+ const tempData = Object.assign({}, this.temp)
|
|
|
+ const index = this.list.findIndex(v => v.id === this.temp.id)
|
|
|
+ await updateAdvice(tempData)
|
|
|
+ const rs = await fetchAdvice(tempData.id)
|
|
|
+ this.list.splice(index, 1, rs.data.info)
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '处理成功'
|
|
|
})
|
|
|
- .then(async() => {
|
|
|
- await deleteAdvice(row.id)
|
|
|
- const rs = await fetchAdvice(row.id)
|
|
|
- this.list.splice($index, 1, rs.data.info)
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '处理成功'
|
|
|
- })
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|