Commit edd9611e by 冒粤蓉

add checklist

1 parent 5f103c55
...@@ -48,6 +48,7 @@ const APPROVAL_API = { ...@@ -48,6 +48,7 @@ const APPROVAL_API = {
} }
// 试驾围栏审批接口 // 试驾围栏审批接口
const TEST_DRIVE_API = { const TEST_DRIVE_API = {
TEST_DRIVE_SEARCH: '/trialdrive/approval/searchFenceApp' TEST_DRIVE_SEARCH: '/trialdrive/approval/searchFenceApp',
UPDATE_FENCE_APPROVAL: '/trialdrive/approval/updateApproval'
} }
export { API, COMMON_API, SPECIALSHOP_API, VEHICLE_API, APPROVAL_API, REPORT_API, VEHICLEDOC_API, TEST_DRIVE_API } export { API, COMMON_API, SPECIALSHOP_API, VEHICLE_API, APPROVAL_API, REPORT_API, VEHICLEDOC_API, TEST_DRIVE_API }
...@@ -7,4 +7,9 @@ function getList (params) { ...@@ -7,4 +7,9 @@ function getList (params) {
return request(params, url) return request(params, url)
} }
export { getList } function updateFenceApproval (params) {
const url = TEST_DRIVE_API.UPDATE_FENCE_APPROVAL
return request(params, url, 'post')
}
export { getList, updateFenceApproval }
...@@ -34,22 +34,35 @@ ...@@ -34,22 +34,35 @@
> >
<span <span
class="dot" class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''" :class="scope.scope.approvalStatus ? USERSTATUS[scope.scope.approvalStatus].split(',')[1] : ''"
></span> ></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span> <span class="statusText">{{ scope.scope.approvalStatus ? USERSTATUS[scope.scope.approvalStatus].split(',')[0] : '--'}}</span>
</span> </span>
<span <span
slot="table-button" slot="table-button"
slot-scope="scope" slot-scope="scope"
> >
<el-button <template v-for="(j, idx) in testDriveTableParams.tableOption.btnList">
v-for="(j, idx) in testDriveTableParams.tableOption.btnList" <!-- approvalStatus为1也就是未审核状态才展示通过/驳回 -->
:key="idx" <template v-if="(j.pType == 'pass' || j.pType == 'reject') && scope.scope.approvalStatus == 1">
:type="j.type || 'text'" <el-button
size="mini" :key="idx"
plain :type="j.type || 'text'"
@click="btnClick(j.pType, scope.scope)" size="mini"
>{{j.name}}</el-button> plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</template>
<template v-if="(j.pType !== 'pass' && j.pType !== 'reject') && scope.scope.approvalStatus != 1">
<el-button
:key="idx"
:type="j.type || 'text'"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</template>
</template>
</span> </span>
</basic-table> </basic-table>
</div> </div>
...@@ -57,7 +70,7 @@ ...@@ -57,7 +70,7 @@
</template> </template>
<script> <script>
import { getList } from 'services/testDrive' import { getList, updateFenceApproval } from 'services/testDrive'
export default { export default {
data() { data() {
return { return {
...@@ -69,13 +82,13 @@ export default { ...@@ -69,13 +82,13 @@ export default {
label: '关键字:', label: '关键字:',
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'status', prop: 'keywords',
placeholder: '特约店编码|店名称', placeholder: '特约店编码|店名称',
}, },
{ {
label: '审核状态:', label: '审核状态:',
type: 'select', type: 'select',
prop: 'enableStatus', prop: 'approvalStatus',
placeholder: '请选择审核状态', placeholder: '请选择审核状态',
options: [{ options: [{
value: '1', value: '1',
...@@ -117,6 +130,9 @@ export default { ...@@ -117,6 +130,9 @@ export default {
}, { }, {
label: '店级别', label: '店级别',
prop: 'shopLevel' prop: 'shopLevel'
}, {
label: '审核结果',
prop: 'approvalResult'
} }
], ],
tableOption: { tableOption: {
...@@ -124,23 +140,28 @@ export default { ...@@ -124,23 +140,28 @@ export default {
btnList: [ btnList: [
{ {
name: '查看原围栏', name: '查看原围栏',
pType: 'viewOrigin' pType: 'view',
}, },
{ {
name: '查看修改后围栏', name: '查看修改后围栏',
pType: 'viewUpdatedData' pType: 'view',
}, },
{ {
name: '通过', name: '通过',
pType: 'pass' pType: 'pass',
}, },
{ {
name: '驳回', name: '驳回',
pType: 'reject' pType: 'reject',
} }
] ]
} }
}, },
approvalParams: {
id: '',
status: 2,
remark: ''
},
getListApi: getList, getListApi: getList,
// 弹窗 // 弹窗
testDriveVisible: false, testDriveVisible: false,
...@@ -161,41 +182,55 @@ export default { ...@@ -161,41 +182,55 @@ export default {
}, },
methods: { methods: {
btnClick(pType, scope) { btnClick(pType, scope) {
const { approvalId } = scope;
this.approvalParams.id = approvalId;
switch (pType) { switch (pType) {
case 'create': case 'pass':
this.approvalParams.status = 2;
delete this.approvalParams.remark;
this.updateFenceApproval();
break break
case 'edit': case 'reject':
this.approvalParams.status = 3;
this.showRejectRemarks();
break break
case 'view': case 'view':
let query = {
break fenceId: scope.bizId,
case 'delete': readonlyStatus: true
this.$confirm('是否要删除?', '提示', { };
confirmButtonText: '确定', const path = '/oEshield#/monitor/editFence';
cancelButtonText: '取消', history.pushState(query, path, path);
type: 'warning'
}).then(() => {
})
break
case 'unbind':
this.$confirm('是否要解绑, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
})
break
case 'import':
break
case 'export':
break break
} }
}, },
showRejectRemarks() {
this.$prompt('请输入驳回原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
this.approvalParams.remark = value;
this.updateFenceApproval();
}).catch(() => {
});
},
updateFenceApproval() {
updateFenceApproval(this.approvalParams).then(res => {
const { code, message } = res;
if(code == 200) {
this.$message({
type: 'success',
message: '操作成功!'
});
this.$refs.testDriveForm.refreshTable()
} else {
this.$message({
type: 'error',
message
});
}
})
},
handleConfirm(type) { handleConfirm(type) {
console.log(type) console.log(type)
switch (type) { switch (type) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!