Browse Source

修改模板开关

dev-warehouse
caoyizhong 2 years ago
parent
commit
76775a5c07
  1. 27
      src/option/basic/basicPrintTemplate.js
  2. 39
      src/views/basic/printTemplate/basicPrintTemplate.vue

27
src/option/basic/basicPrintTemplate.js

@ -199,6 +199,27 @@ export default {
trigger: "change" trigger: "change"
}] }]
}, },
{
label: "模板开关",
labelWidth: '100',
prop: "knifeSwitch",
type: "switch",
// search:true,
slot: true,
// addDisplay: true,
// editDisplay: false,
// viewDisplay: true,
dicData: [
{
label: "开启",
value: "1",
},
{
label: "关闭",
value: "0",
},
],
},
{ {
label: "模板文件", label: "模板文件",
fileText:'附件上传', fileText:'附件上传',
@ -253,15 +274,15 @@ export default {
// type: "input", // type: "input",
// }, // },
, ,
{ /*{
label: "开关", label: "开关",
labelWidth: '100', labelWidth: '100',
prop: "status", prop: "knifeSwitch",
type: "input", type: "input",
addDisplay: true, addDisplay: true,
editDisplay: true, editDisplay: true,
viewDisplay: true, viewDisplay: true,
}, },*/
] ]
} }

39
src/views/basic/printTemplate/basicPrintTemplate.vue

@ -38,10 +38,22 @@
</el-button> </el-button>
</template> </template>
<template #knifeSwitch="scope">
<!-- <span>{{scope.row.knifeSwitch}}</span>-->
<!-- <avue-switch :="scope.row.knifeSwitch == '1' ? true : false"-->
<!-- @click="rowState(scope.row)"></avue-switch>-->
<el-switch v-model="scope.row.knifeSwitch" active-text="开启"
inactive-text="关闭" @change="rowState(scope.row)"></el-switch>
</template>
<!-- <template slot="knifeSwitch"-->
<!-- slot-scope="scope">-->
<!-- </template>-->
<template #status="scope"> <!--<template #status="scope">
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="switChange(scope.row)"></el-switch> <el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="switChange(scope.row)"></el-switch>
</template> </template>-->
@ -103,6 +115,29 @@
} }
}, },
methods: { methods: {
//
rowState(row){
// console.log("row",row);
let aa ={
id: row.id,
knifeSwitch: row.knifeSwitch
}
this.$confirm("确定关闭该模板?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return update(aa);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowSave(row, done, loading) { rowSave(row, done, loading) {
console.log("row",row); console.log("row",row);
row.fileName = this.fileName; row.fileName = this.fileName;

Loading…
Cancel
Save