|
@@ -63,7 +63,7 @@
|
|
|
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => statusChange(record)">
|
|
|
<a-switch :default-checked= "record.status == 0 ? true : false" @change="statusChange(record,$event)" />
|
|
|
</a-popconfirm> -->
|
|
|
- <a-switch :default-checked= "record.status == 0 ? true : false" @click="statusChange(record,$event)" />
|
|
|
+ <a-switch :checked= "record.status == 0 ? true : false" @click="statusChange(record,$event)" />
|
|
|
<!-- <a-switch checkedChildren="禁用" unCheckedChildren="启用" :default-checked= "record.status == 0 ? true : false" @change="statusChange(record,$event)" /> -->
|
|
|
</template>
|
|
|
|
|
@@ -120,6 +120,7 @@
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import CmmsSpotcheckContentModal from './modules/CmmsSpotcheckContentModal'
|
|
|
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
|
|
+ import { httpAction, getAction } from '@/api/manage'
|
|
|
|
|
|
export default {
|
|
|
name: 'CmmsSpotcheckContentList',
|
|
@@ -178,7 +179,7 @@
|
|
|
deleteBatch: "/cmmsSpotcheckContent/cmmsSpotcheckContent/deleteBatch",
|
|
|
exportXlsUrl: "/cmmsSpotcheckContent/cmmsSpotcheckContent/exportXls",
|
|
|
importExcelUrl: "cmmsSpotcheckContent/cmmsSpotcheckContent/importExcel",
|
|
|
-
|
|
|
+ edit: "/cmmsSpotcheckContent/cmmsSpotcheckContent/edit",
|
|
|
},
|
|
|
dictOptions:{},
|
|
|
superFieldList:[],
|
|
@@ -196,6 +197,12 @@
|
|
|
methods: {
|
|
|
initDictConfig(){
|
|
|
},
|
|
|
+ modalFormOk() {
|
|
|
+ // 新增/修改 成功时,重载列表
|
|
|
+ this.loadData();
|
|
|
+ //清空列表选中
|
|
|
+ this.onClearSelected()
|
|
|
+ },
|
|
|
getSuperFieldList(){
|
|
|
let fieldList=[];
|
|
|
fieldList.push({type:'string',value:'contentcode',text:'点检内容编号',dictCode:''})
|
|
@@ -206,6 +213,35 @@
|
|
|
},
|
|
|
statusChange(record,$event){
|
|
|
console.log(record.status,$event)
|
|
|
+ let text = record.status === "0" ? "停用" : "启用";
|
|
|
+ const that = this
|
|
|
+ that.$confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: "确认要" + text + "该内容吗?",
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|