Commit f1548048 authored by 张伯涛's avatar 张伯涛

项目加停用

parent 5aa69a48
......@@ -56,6 +56,22 @@ export function projectBYID(params) {
})
}
// 获取所有数据字典类型
export function getDictType(dictType) {
return request({
url: '/dictmanage/getDictByType/' + dictType,
method: 'get'
})
}
/** 停用*/
export function proDeactivate(data) {
return request({
url: '/sysproject/blockUp',
method: 'put',
data
})
}
/** 项目表单查询 */
export function projectQuery(params) {
return request({
......
......@@ -82,6 +82,13 @@
style="margin-left: 10px"
@click="delProject(scope.row)"
>删除</el-link>
<el-link
v-if="scope.row.ZPROJECT || scope.row.ZFUND"
:underline="false"
type="danger"
style="margin-left: 10px "
@click="stopUsing(scope.row)"
>停用</el-link>
</template>
</el-table-column>
</el-table>
......@@ -104,17 +111,49 @@
</div>
</div>
</el-dialog>
<el-dialog width="50%" title="停用" :visible.sync="stopUsingDialog">
<el-form ref="stopUseForm" :model="stopUseForm">
<el-form-item
label="停用说明:"
prop="DEACTIVATEDESC"
:rules="[
{ required: true, message: '请选择停用说明', trigger: 'change' }
]"
>
<el-select v-model="stopUseForm.DEACTIVATEDESC" clearable placeholder="请选择停用说明">
<el-option
v-for="item in stopOtions"
:key="item.id"
:label="item.value"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="clickStopUse">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { projectQuery, projectDel, getDictAll, getPush } from '@/views/projectInfo/api'
import { projectQuery, projectDel, getDictAll, getPush, getDictType, proDeactivate } from '@/views/projectInfo/api'
import { Store } from '@/utils/storage'
import { storeKey } from '@/utils/auth'
export default {
name: 'ProjectInfo',
data() {
return {
stopOtions: [],
stopUseForm: {
DEACTIVATEDESC: '',
ZSTATE: '' // ’0‘停用状态
},
stopUseParams: {
},
stopUsingDialog: false,
jurisdiction: JSON.parse(Store.get(storeKey.user)).userId,
// 毛斌,殷绮华,许靖莉账号,有查看权限用户,可以修改,推送,删除
projectPerList: ['2017009369', '2017009368', '2016013051', '2017013969', '2017017971', '2017013968',
......@@ -158,12 +197,46 @@ export default {
}
},
mounted() {
this.findMap()
this.getProjectData()
},
created() {
this.getDictData()
},
methods: {
/** 停用操作*/
clickStopUse() {
this.$refs['stopUseForm'].validate((valide, object) => {
if (valide) {
const row = {
DEACTIVATEDESC: this.stopUseForm.DEACTIVATEDESC,
ZSTATE: '0'
}
const params = JSON.stringify(Object.assign(this.stopUseParams, row))
proDeactivate(params).then(res => {
if (res.code === '200') {
this.stopUsingDialog = false
this.$message({
type: 'success',
message: '停用成功!'
})
this.getProjectData()
} else {
this.$message({
type: 'success',
message: res.msg
})
}
})
}
})
},
findMap() {
const dictType = 'ZSTOPREASON'
getDictType(dictType).then(res => {
this.stopOtions = res.data
})
},
getDictData() {
getDictAll().then(res => {
this.COUNTRYList = res.data.ZCOUNTRY
......@@ -208,6 +281,13 @@ export default {
}
})
},
/** 停用操作*/
stopUsing(row) {
this.stopUseParams = JSON.parse(JSON.stringify(row))
this.stopUsingDialog = true
this.$refs.stopUseForm.clearValidate() // 清空验证
this.$refs.stopUseForm.resetFields() // 清空表单
},
/** 删除按钮 */
delProject(row) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment