|
@@ -67,6 +67,10 @@
|
|
|
</a-button>
|
|
|
</template>
|
|
|
|
|
|
+ <template slot="status" slot-scope="text, record">
|
|
|
+ <a-switch :checked="record.status === '0' ? true : false" checked-children="启动" un-checked-children="停用" @click="changeStatus(record)"/>
|
|
|
+ </template>
|
|
|
+
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
|
|
|
@@ -173,7 +177,8 @@
|
|
|
{
|
|
|
title:'状态(0启用 1停用)',
|
|
|
align:"center",
|
|
|
- dataIndex: 'status_dictText'
|
|
|
+ dataIndex: 'status',
|
|
|
+ scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
|
{
|
|
|
title:'待办人',
|
|
@@ -241,6 +246,37 @@
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeStatus(record){
|
|
|
+ console.log(record.status)
|
|
|
+ const that = this
|
|
|
+ that.$confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: record.status ==='0'?'确定停用吗?':'确定启用吗?',
|
|
|
+ onOk() {
|
|
|
+ let httpurl = '';
|
|
|
+ let method = 'put';
|
|
|
+ httpurl+=that.url.edit;
|
|
|
+ if (record.status == 1) {
|
|
|
+ that.model = record
|
|
|
+ that.model.status = 0
|
|
|
+ } else {
|
|
|
+ that.model = record
|
|
|
+ that.model.status = 1
|
|
|
+ }
|
|
|
+ httpAction(httpurl,that.model,method).then((res)=>{
|
|
|
+ if(res.success){
|
|
|
+ that.$message.success(res.message);
|
|
|
+ that.modalFormOk()
|
|
|
+ }else{
|
|
|
+ that.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ // that.modalFormOk()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
initDictConfig(){
|
|
|
},
|
|
|
getSuperFieldList(){
|