修改状态流程

This commit is contained in:
yulixing 2019-08-05 15:09:28 +08:00
parent f6fde6c070
commit dd8e50744f
3 changed files with 64 additions and 4 deletions

View File

@ -209,8 +209,9 @@
<el-button <el-button
type="primary" type="primary"
@click="submit('adForm')" @click="submit('adForm')"
v-if="writeable"
>提交</el-button> >提交</el-button>
<el-button @click="resetForm('adForm')">重置</el-button> <el-button @click="resetForm('adForm')" v-if="writeable">重置</el-button>
<el-button @click="goBack">返回</el-button> <el-button @click="goBack">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -237,7 +238,7 @@ export default {
return { return {
//common //common
writeable: true, writeable: false,
companyid: 0, companyid: 0,
allGame: [], allGame: [],
gameList: [], gameList: [],
@ -295,6 +296,10 @@ export default {
this.modeList = modeList this.modeList = modeList
this.typeList = typeList this.typeList = typeList
const areaListRes = await this.getAdAreaList() const areaListRes = await this.getAdAreaList()
areaListRes.adAreaList.map(item => { areaListRes.adAreaList.map(item => {
this.areaList[item.area_id] = item.name this.areaList[item.area_id] = item.name
@ -349,6 +354,11 @@ export default {
this.adForm.gameid = this.gameList[0] ? this.gameList[0].game_id : '' this.adForm.gameid = this.gameList[0] ? this.gameList[0].game_id : ''
this.changeGame() this.changeGame()
} }
// 广
this.writeable = (this.adForm.status === 2 || !hasAd) ? true : false
}, },
methods: { methods: {
// common // common

View File

@ -36,6 +36,10 @@
label="暂停" label="暂停"
:value="3" :value="3"
/> />
<el-option
label="已删除"
:value="4"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -151,6 +155,11 @@
type="info" type="info"
v-if="scope.row.status === 3" v-if="scope.row.status === 3"
>暂停</el-tag> >暂停</el-tag>
<el-tag
type="info"
effect="plain"
v-if="scope.row.status === 4"
>已删除</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -167,6 +176,13 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.stop="stop(scope.row)"
v-if="scope.row.status === 1"
>暂停</el-button>
<el-button
type="text"
size="small"
v-if="scope.row.status !== 4"
@click.stop="del(scope.row)" @click.stop="del(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>
@ -336,6 +352,7 @@ export default {
}) })
}) })
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
}, },
@ -436,6 +453,29 @@ export default {
this.$message.info('操作已取消!') this.$message.info('操作已取消!')
}) })
}, },
stop(row) {
this.$confirm(`是否暂停广告:【${row.name}】?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
const data = JSON.parse(JSON.stringify(row))
data.status = 3
data.begin_time = this.formDate(null, null, data.begin_time)
data.end_time = this.formDate(null, null, data.end_time)
try {
const result = await this.updateAd(data)
this.$message.success('状态修改成功!')
this.refreshData()
} catch (err) {
console.log(err)
}
})
.catch(() => {
this.$message.info('操作已取消!')
})
},
// pagination // pagination
sizeChange(val) { sizeChange(val) {
this.pageSize = val this.pageSize = val

View File

@ -35,6 +35,10 @@
label="暂停" label="暂停"
:value="3" :value="3"
/> />
<el-option
label="已删除"
:value="4"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -162,6 +166,11 @@
type="info" type="info"
v-if="scope.row.status === 3" v-if="scope.row.status === 3"
>暂停</el-tag> >暂停</el-tag>
<el-tag
type="info"
effect="plain"
v-if="scope.row.status === 4"
>已删除</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -185,18 +194,19 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
v-if="scope.row.status === 0 || scope.row.status === 3" v-if="scope.row.status === 0"
@click.stop="refuse(scope.row)" @click.stop="refuse(scope.row)"
>拒绝</el-button> >拒绝</el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.stop="stop(scope.row)" @click.stop="stop(scope.row)"
v-if="scope.row.status === 0 || scope.row.status === 1" v-if="scope.row.status === 1"
>暂停</el-button> >暂停</el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
v-if="scope.row.status !== 4"
@click.stop="del(scope.row)" @click.stop="del(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>