Commit a4fc00eb by 史敦盼

收集资料配置修改

1 parent 7e8a916e
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-11 14:53:40 * @Date: 2024-03-11 14:53:40
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-06-19 17:25:07 * @LastEditTime: 2024-06-24 09:39:43
--> -->
<!-- 示例 <!-- 示例
columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => { columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => {
...@@ -81,18 +81,28 @@ ...@@ -81,18 +81,28 @@
v-for="items in item.actionButtons" v-for="items in item.actionButtons"
:key="items.title" :key="items.title"
v-bind="items" v-bind="items"
:icon="typeof items.icon == 'function' ? items.icon(scope.row) : items.icon" :icon="
typeof items.icon == 'function'
? items.icon(scope.row)
: items.icon
"
:disabled=" :disabled="
items.disabledCallback items.disabledCallback
? items.disabledCallback(scope.row, items.title) ? items.disabledCallback(scope.row, items.title)
: false : false
" "
@click="item.callback(scope.row, items.title ? items.title : 'titleChange')" @click="
item.callback(
scope.row,
items.title ? items.title : 'titleChange',
)
"
> >
<span v-if="items.titleChange">{{items.titleChange(scope.row, items)}}</span> <span v-if="items.titleChange">{{
items.titleChange(scope.row, items)
}}</span>
<span v-else-if="!items.circle">{{ items.title }}</span> <span v-else-if="!items.circle">{{ items.title }}</span>
</el-button </el-button>
>
</template> </template>
</el-table-column> </el-table-column>
<!-- 普通渲染 --> <!-- 普通渲染 -->
...@@ -206,9 +216,13 @@ export default { ...@@ -206,9 +216,13 @@ export default {
return [10, 20, 50, 100, 200] return [10, 20, 50, 100, 200]
}, },
}, },
queryImmediate: {
type: Boolean,
default: true,
},
}, },
components: { components: {
Functional Functional,
}, },
data() { data() {
return { return {
...@@ -235,7 +249,9 @@ export default { ...@@ -235,7 +249,9 @@ export default {
}, },
}, },
created() { created() {
if (this.queryImmediate) {
this.queryData() this.queryData()
}
}, },
methods: { methods: {
indexMethod(index) { indexMethod(index) {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
:visible.sync="showDialog" :visible.sync="showDialog"
width="80%" width="80%"
@close="handleClose()" @close="handleClose()"
@open="handleOpen()"
> >
<table-config <table-config
ref="searchTable" ref="searchTable"
...@@ -11,10 +12,17 @@ ...@@ -11,10 +12,17 @@
:columns="columns" :columns="columns"
id-key="elementId" id-key="elementId"
@selection-change="selectionChange" @selection-change="selectionChange"
:query-immediate="false"
> >
</table-config> </table-config>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-if="title == '督查清单'" type="primary" @click="handleSubmit" size="mini" >保 存</el-button > <el-button
v-if="title == '督查清单'"
type="primary"
@click="handleSubmit"
size="mini"
>保 存</el-button
>
<el-button @click="handleClose()" size="mini">取 消</el-button> <el-button @click="handleClose()" size="mini">取 消</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -41,43 +49,40 @@ export default { ...@@ -41,43 +49,40 @@ export default {
}, },
}, },
watch: { watch: {
prjCodeDetail(v){ // prjCodeDetail(v){
this.query.queryParam.prjCode = v // this.query.queryParam.prjCode = v
this.search() // this.search()
// },
}, },
}, data() {
data(){
return { return {
query: { query: {
url: collectDataConfiguration, url: collectDataConfiguration,
method: 'post', method: 'post',
queryParam: { queryParam: {
prjCode: '' prjCode: '',
}, },
}, },
selectId: '' selectId: '',
} }
}, },
computed: { computed: {
columns() { columns() {
let arr = [ let arr = [
{ label: '序号', type: 'index', prop: '序号',width: '80px' }, { label: '序号', type: 'index', prop: '序号', width: '80px' },
{ label: '单位', prop: 'manageDeptName', width: '150px' }, { label: '单位', prop: 'manageDeptName', width: '150px' },
{ label: '项目名称', prop: 'prjName', }, { label: '项目名称', prop: 'prjName' },
{ label: '项目经理', prop: 'projectManager', width: '200px' }, { label: '项目经理', prop: 'projectManager', width: '200px' },
] ]
if(this.title != '督查清单'){ if (this.title != '督查清单') {
arr = [ arr = [
{ label: '序号', type: 'index',prop: '序号', width: '80px' }, { label: '序号', type: 'index', prop: '序号', width: '80px' },
{ label: '单位', prop: 'manageDeptName', width: '150px' }, { label: '单位', prop: 'manageDeptName', width: '150px' },
{ label: '项目名称', prop: 'prjName', }, { label: '项目名称', prop: 'prjName' },
{ label: '项目经理', prop: 'projectManager', width: '200px' }, { label: '项目经理', prop: 'projectManager', width: '200px' },
] ]
}else{ } else {
arr = [ arr = [{ type: 'selection', prop: 'selection', width: '55px' }, ...arr]
{ type: 'selection',prop: 'selection', width: '55px' },
...arr,
]
} }
return [...arr] return [...arr]
}, },
...@@ -88,35 +93,40 @@ export default { ...@@ -88,35 +93,40 @@ export default {
set(value) { set(value) {
this.$emit('update:visible', value) this.$emit('update:visible', value)
}, },
} },
}, },
methods: { methods: {
handleClose() { handleClose() {
this.showDialog = false this.showDialog = false
this.query.queryParam.prjCode = ''
}, },
async search(){ handleOpen() {
this.query.queryParam.prjCode = this.prjCodeDetail
this.search()
},
async search() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.searchTable.queryData() this.$refs.searchTable.queryData()
}) })
}, },
selectionChange(data) { selectionChange(data) {
let idArr = [] let idArr = []
data.forEach(item => { data.forEach((item) => {
idArr.push(item.prjCode) idArr.push(item.prjCode)
}) })
this.selectId = idArr.join(',') this.selectId = idArr.join(',')
}, },
handleSubmit(){ handleSubmit() {
this.$emit('selectTabel', this.selectId) this.$emit('selectTabel', this.selectId)
this.handleClose() this.handleClose()
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/elementui.scss'; @import '@/styles/elementui.scss';
::v-deep .el-dialog__body{ ::v-deep .el-dialog__body {
height: 36vh; height: 36vh;
} }
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-11 14:53:40 * @Date: 2024-03-11 14:53:40
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-22 17:17:18 * @LastEditTime: 2024-06-24 09:40:41
--> -->
<!-- 示例 <!-- 示例
columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => { columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => {
...@@ -87,12 +87,18 @@ ...@@ -87,12 +87,18 @@
? items.disabledCallback(scope.row, items.title) ? items.disabledCallback(scope.row, items.title)
: false : false
" "
@click="item.callback(scope.row, items.title ? items.title : 'titleChange')" @click="
item.callback(
scope.row,
items.title ? items.title : 'titleChange',
)
"
> >
<span v-if="items.titleChange">{{items.titleChange(scope.row, items.title)}}</span> <span v-if="items.titleChange">{{
items.titleChange(scope.row, items.title)
}}</span>
<span v-else-if="!items.circle">{{ items.title }}</span> <span v-else-if="!items.circle">{{ items.title }}</span>
</el-button </el-button>
>
</template> </template>
</el-table-column> </el-table-column>
<!-- 普通渲染 --> <!-- 普通渲染 -->
...@@ -196,6 +202,10 @@ export default { ...@@ -196,6 +202,10 @@ export default {
return [10, 20, 50, 100, 200] return [10, 20, 50, 100, 200]
}, },
}, },
queryImmediate: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
...@@ -222,7 +232,9 @@ export default { ...@@ -222,7 +232,9 @@ export default {
}, },
}, },
created() { created() {
if (this.queryImmediate) {
this.queryData() this.queryData()
}
}, },
methods: { methods: {
indexMethod(index) { indexMethod(index) {
...@@ -233,17 +245,18 @@ export default { ...@@ -233,17 +245,18 @@ export default {
clearSelection() { clearSelection() {
this.$refs.tableConfig.clearSelection() this.$refs.tableConfig.clearSelection()
}, },
handleToText(item, state='') { handleToText(item, state = '') {
if(!state && typeof state != 'number') return if (!state && typeof state != 'number') return
if(typeof state != 'number' && state.indexOf(',') > -1){ if (typeof state != 'number' && state.indexOf(',') > -1) {
let stateVal = state.split(',') let stateVal = state.split(',')
let labelValue = '' let labelValue = ''
stateVal.forEach(valItem => { stateVal.forEach((valItem) => {
const arr = item.options.find((v) => v.value == valItem) || {} const arr = item.options.find((v) => v.value == valItem) || {}
labelValue += `,${arr.label}` labelValue += `,${arr.label}`
}); })
return labelValue.slice(1, labelValue.length) return labelValue.slice(1, labelValue.length)
}{ }
{
let val = state let val = state
// if (!val) { // if (!val) {
// val = item.emptyToNum || 0 // val = item.emptyToNum || 0
...@@ -301,13 +314,13 @@ export default { ...@@ -301,13 +314,13 @@ export default {
} finally { } finally {
this.loading = false this.loading = false
// console.log('result', result) // console.log('result', result)
if(result.data){ if (result.data) {
const { data } = result const { data } = result
if (result && result.code === 200) { if (result && result.code === 200) {
if(data instanceof Array){ if (data instanceof Array) {
// this.pagination.totalRow = data.total // this.pagination.totalRow = data.total
this.tableData = data this.tableData = data
}else{ } else {
this.pagination.totalRow = data.total this.pagination.totalRow = data.total
this.tableData = data.records this.tableData = data.records
} }
...@@ -321,7 +334,7 @@ export default { ...@@ -321,7 +334,7 @@ export default {
this.pagination.current = 1 this.pagination.current = 1
this.pagination.totalRow = 0 this.pagination.totalRow = 0
} }
}else{ } else {
const data = result const data = result
this.pagination.totalRow = data.total this.pagination.totalRow = data.total
this.tableData = data.records this.tableData = data.records
...@@ -344,9 +357,9 @@ export default { ...@@ -344,9 +357,9 @@ export default {
} }
} }
}, },
tableRowClass(val){ tableRowClass(val) {
// console.log(val, 'tableRowClass'); // console.log(val, 'tableRowClass');
if(val.row.remind && val.row.remind == '1'){ if (val.row.remind && val.row.remind == '1') {
return 'remindRed' return 'remindRed'
} }
}, },
...@@ -366,7 +379,7 @@ export default { ...@@ -366,7 +379,7 @@ export default {
margin-top: 20px; margin-top: 20px;
margin-bottom: 30px; margin-bottom: 30px;
} }
/deep/ .remindRed{ /deep/ .remindRed {
color: red !important; color: red !important;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!