Commit dde248cb by qiaoyanqi

绩效

parent 584b2c46
<template> <template>
<div class="bill-achievements"> <div class="bill-achievements">
<vxe-table border ref="xTable" :data="tableData" :show-header="false"> <vxe-table
border
ref="xTable"
:data="tableData"
:show-header="false"
:cell-style="cellStyle"
>
<vxe-table-column <vxe-table-column
field="name" field="name"
title="name" title="name"
...@@ -11,6 +17,7 @@ ...@@ -11,6 +17,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<component <component
:is="scope.row.type" :is="scope.row.type"
:disabled="state == 'readOnly'"
:attr="{ field: 'value', row: scope.row, attr: scope.row.attr }" :attr="{ field: 'value', row: scope.row, attr: scope.row.attr }"
:detailData=" :detailData="
scope.row.attr && scope.row.attr.tableData scope.row.attr && scope.row.attr.tableData
...@@ -31,8 +38,9 @@ import vxeTableControl from "./components/vxe-table.vue"; ...@@ -31,8 +38,9 @@ import vxeTableControl from "./components/vxe-table.vue";
import radioGroupControl from "./components/radioGroupControl.vue"; import radioGroupControl from "./components/radioGroupControl.vue";
import inputControl from "./components/inputControl.vue"; import inputControl from "./components/inputControl.vue";
import textAreaControl from "./components/textAreaControl.vue"; import textAreaControl from "./components/textAreaControl.vue";
import input from "../util/bc_input.js";
export default { export default {
mixins: [vxeAchievements], mixins: [vxeAchievements, input],
components: { components: {
vxeTableControl, vxeTableControl,
dateControl, dateControl,
...@@ -128,12 +136,12 @@ export default { ...@@ -128,12 +136,12 @@ export default {
{ {
name: "单位(部门)职能概述", name: "单位(部门)职能概述",
type: "textAreaControl", type: "textAreaControl",
value: "xx", value: "",
}, },
{ {
name: "项目概况", name: "项目概况",
type: "textAreaControl", type: "textAreaControl",
value: "33", value: "",
}, },
{ {
name: "项目立项情况", name: "项目立项情况",
...@@ -656,7 +664,7 @@ export default { ...@@ -656,7 +664,7 @@ export default {
name: "填报人:", name: "填报人:",
type: "vxeTableControl", type: "vxeTableControl",
attr: { attr: {
border:'none', border: "none",
showHeader: false, showHeader: false,
addObj: { addObj: {
name: "", name: "",
...@@ -666,18 +674,18 @@ export default { ...@@ -666,18 +674,18 @@ export default {
{ {
person: "单位(部门)负责人:", person: "单位(部门)负责人:",
time: "填报时间:", time: "填报时间:",
} },
], ],
columns: [ columns: [
{ {
field: "person", field: "person",
title: "部门负责人", title: "部门负责人",
type: "inputControl" type: "inputControl",
}, },
{ {
field: "time", field: "time",
title: "填报时间", title: "填报时间",
type: "inputControl" type: "inputControl",
}, },
], ],
}, },
...@@ -686,34 +694,46 @@ export default { ...@@ -686,34 +694,46 @@ export default {
}; };
}, },
props: { props: {
define: { // define: {
type: Object, // type: Object,
default: () => {}, // default: () => {},
}, // },
context: { // context: {
type: Object, // type: Object,
default: () => {}, // default: () => {},
}, // },
}, },
watch: { watch: {
tableData: { tableData: {
handler(nv, ov) { handler(nv, ov) {
console.log(nv, ov); console.log(nv, ov);
if (this.define.config.field) { if (this.define.config.field) {
this.context.dataObject.setValue(this.define.config.field, nv); this.context.dataObject.setValue(
this.define.config.field.split(".")[1],
JSON.stringify(nv)
);
} }
}, },
deep: true, deep: true,
}, },
value: {
handler(nv, ov) {
console.log("value", nv, ov);
this.tableData = JSON.parse(nv);
},
deep: true,
},
}, },
computed: {}, computed: {},
methods: { methods: {
Primary() {
console.log(this.tableData);
},
updataTableData(nv, rowIndex) { updataTableData(nv, rowIndex) {
this.tableData[rowIndex].attr.tableData = nv; this.tableData[rowIndex].attr.tableData = nv;
}, },
cellStyle({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex }) {
return {
backgroundColor:this.state == 'readOnly'? "#F3F3F3":''
}
},
}, },
mounted() {}, mounted() {},
created() {}, created() {},
...@@ -736,10 +756,9 @@ export default { ...@@ -736,10 +756,9 @@ export default {
.rbcInputControl textarea.ivu-input { .rbcInputControl textarea.ivu-input {
max-width: inherit; max-width: inherit;
font-size: 14px; font-size: 14px;
vertical-align:revert; vertical-align: revert;
} }
.bill-achievements { .bill-achievements {
.vxe-table--render-default .vxe-body--column:not(.col--ellipsis) { .vxe-table--render-default .vxe-body--column:not(.col--ellipsis) {
padding: 0; padding: 0;
line-height: 44px; line-height: 44px;
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
" "
:placement="attr.column && attr.column.placement" :placement="attr.column && attr.column.placement"
v-model="attr.row[attr.field]" v-model="attr.row[attr.field]"
:disabled="disabled"
transfer
transfer-class-name="transferred-cell-element"
:readonly="true"
></DatePicker> ></DatePicker>
</div> </div>
</template> </template>
...@@ -22,6 +26,9 @@ export default { ...@@ -22,6 +26,9 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
disabled: {
require: false
}
}, },
watch: {}, watch: {},
computed: {}, computed: {},
......
<template> <template>
<div class="rbcInputControl"> <div class="rbcInputControl">
<Input v-model="attr.row[attr.field]"/> <Input v-model="attr.row[attr.field]" :disabled="disabled"/>
</div> </div>
</template> </template>
<script> <script>
...@@ -14,6 +14,9 @@ export default { ...@@ -14,6 +14,9 @@ export default {
attr:{ attr:{
type:Object, type:Object,
default:()=>{} default:()=>{}
},
disabled: {
require: false
} }
}, },
watch: {}, watch: {},
......
<template> <template>
<div class=""> <div class="">
<RadioGroup v-model="attr.row[attr.field]"> <RadioGroup v-model="attr.row[attr.field]" >
<Radio label="新增项目"></Radio>&nbsp;&nbsp;&nbsp; <Radio label="新增项目" :disabled="disabled"></Radio>&nbsp;&nbsp;&nbsp;
<Radio label="延续项目"></Radio> <Radio label="延续项目" :disabled="disabled"></Radio>
</RadioGroup> </RadioGroup>
</div> </div>
</template> </template>
...@@ -15,6 +15,9 @@ export default { ...@@ -15,6 +15,9 @@ export default {
attr:{ attr:{
type:Object, type:Object,
default:()=>{} default:()=>{}
},
disabled: {
require: false
} }
}, },
watch: {}, watch: {},
......
<template> <template>
<div class="rbcInputControl"> <div class="rbcInputControl">
<Input v-model="attr.row[attr.field]" type="textarea"/> <Input v-model="attr.row[attr.field]" type="textarea" :disabled="disabled"/>
</div> </div>
</template> </template>
<script> <script>
...@@ -14,6 +14,9 @@ export default { ...@@ -14,6 +14,9 @@ export default {
attr:{ attr:{
type:Object, type:Object,
default:()=>{} default:()=>{}
},
disabled: {
require: false
} }
}, },
watch: {}, watch: {},
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:span-method="spanMethods" :span-method="spanMethods"
:menu-config="tableMenu" :menu-config="tableMenu"
@menu-click="contextMenuClickEvent" @menu-click="contextMenuClickEvent"
:cell-style="cellStyle"
> >
<template v-for="(column, index) in attr.attr.columns"> <template v-for="(column, index) in attr.attr.columns">
<vxe-table-column <vxe-table-column
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<component <component
:disabled="disabled"
:is="column.type" :is="column.type"
:attr="{ field: column.field, row: scope.row, column: column }" :attr="{ field: column.field, row: scope.row, column: column }"
></component> ></component>
...@@ -44,11 +46,11 @@ export default { ...@@ -44,11 +46,11 @@ export default {
dateControl, dateControl,
radioGroupControl, radioGroupControl,
inputControl, inputControl,
textAreaControl textAreaControl,
}, },
data() { data() {
return { return {
tableMenu: { tableMenu: {
body: { body: {
options: [ options: [
[ [
...@@ -57,6 +59,7 @@ export default { ...@@ -57,6 +59,7 @@ export default {
], ],
], ],
}, },
visibleMethod: this.visibleMethod,
}, },
}; };
}, },
...@@ -69,10 +72,18 @@ export default { ...@@ -69,10 +72,18 @@ export default {
type: Array, type: Array,
default: () => {}, default: () => {},
}, },
disabled: {
require: false,
},
}, },
watch: {}, watch: {},
computed: {}, computed: {},
methods: { methods: {
cellStyle({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex }) {
return {
backgroundColor:this.disabled? "#F3F3F3":''
}
},
headerCellClassName({ column, columnIndex }) { headerCellClassName({ column, columnIndex }) {
if (column.property === "content") { if (column.property === "content") {
return "col-white"; return "col-white";
...@@ -97,18 +108,30 @@ export default { ...@@ -97,18 +108,30 @@ export default {
} }
} }
}, },
contextMenuClickEvent({ menu, row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }) { visibleMethod({ options, column }) {
console.log(menu, row, rowIndex, column, columnIndex); return this.disabled?false:true;
},
contextMenuClickEvent({
menu,
row,
rowIndex,
$rowIndex,
column,
columnIndex,
$columnIndex,
$event,
}) {
console.log(menu, row, rowIndex, column, columnIndex);
let detailXTable = this.$refs.detailXTable; let detailXTable = this.$refs.detailXTable;
switch (menu.code) { switch (menu.code) {
case "addRow": case "addRow":
detailXTable.insertAt(this.attr.attr.addObj,row); detailXTable.insertAt(this.attr.attr.addObj, row);
this.$emit('dataChange',detailXTable.tableFullData); this.$emit("dataChange", detailXTable.tableFullData);
break; break;
case "removeRow": case "removeRow":
if(detailXTable.tableFullData.length>1){ if (detailXTable.tableFullData.length > 1) {
detailXTable.remove(row); detailXTable.remove(row);
this.$emit('dataChange',detailXTable.tableFullData); this.$emit("dataChange", detailXTable.tableFullData);
} }
break; break;
default: default:
...@@ -122,9 +145,9 @@ export default { ...@@ -122,9 +145,9 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.detail-table { .detail-table {
margin-left:-11px; margin-left: -11px;
margin-top:-1px; margin-top: -1px;
width: calc(100% + 23px); width: calc(100% + 23px);
.vxe-header--column .col-white { .vxe-header--column .col-white {
background-color: #fff !important; background-color: #fff !important;
} }
......
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