123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562 |
- <template>
- <template-page
- ref="pageRef"
- :getList="getList"
- :exportList="exportList"
- :columnParsing="columnParsing"
- :optionsEvensGroup="optionsEvensGroup"
- :tableAttributes="tableAttributes"
- :tableEvents="tableEvents"
- :operation="operation()"
- >
- <div class="cartographer_big">
- <el-dialog title="添加网点通知" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
- <zj-page-container v-if="formBool">
- <zj-page-fill class="neibuview">
- <zj-form-container
- ref="formRef"
- :form-data="formData"
- :form-rules="formRules"
- :form-attributes="{ size: 'mini' }"
- >
- <zj-form-module title="基础信息" :form-data="formData" :form-items="items" />
- <zj-form-module title="网点信息" :form-data="formData" :form-items="items2" />
- </zj-form-container>
- </zj-page-fill>
- <!-- 操作按钮 -->
- <div style="box-sizing: border-box; padding: 10px; text-align: right">
- <el-button size="mini" @click="handleClose">取 消</el-button>
- <el-button v-if="~[0, 1].indexOf(formType)" size="mini" @click="formConfirm" type="primary"
- >发 送</el-button
- >
- </div>
- </zj-page-container>
- </el-dialog>
- </div>
- <div class="cartographer_big">
- <el-dialog
- title="网点通知详情"
- width="100%"
- :modal="false"
- :visible.sync="formBoolXQ"
- :before-close="handleClose"
- >
- <zj-page-container v-if="formBoolXQ">
- <zj-page-fill class="neibuview">
- <div class="nlnlknmlkmkl" style="width: 100%" v-if="formBoolXQ">
- <template-page
- ref="pageRef2"
- :getList="getList2"
- :exportList="exportList2"
- :operation="operation2()"
- ></template-page>
- </div>
- <zj-form-container
- ref="formRef"
- :form-data="formData"
- :form-rules="formRules"
- :form-attributes="{ size: 'mini' }"
- >
- <zj-form-module title="基础信息" :form-data="formData" :form-items="items" />
- </zj-form-container>
- </zj-page-fill>
- </zj-page-container>
- </el-dialog>
- </div>
- </template-page>
- </template>
- <script>
- import TemplatePage from '@/components/template/template-page-1.vue'
- import import_mixin from '@/components/template/import_mixin.js'
- import pagingTransfer from '@/components/paging-transfer.vue'
- import {
- noticeWebsitList,
- noticeWebsitListExport,
- noticeWebsitAdd,
- noticeWebsitUpdate,
- noticeWebsitDetail,
- noticeWebsitOfOrSend,
- noticeWebsitListWebsit,
- noticeWebsitListWebsitExport,
- noticeWebsitMarkRead,
- noticeWebsitMarkReadOne
- } from '@/api/networkNotification'
- import operation_mixin from '@/components/template/operation_mixin.js'
- import { required } from '@/components/template/rules_verify.js'
- import { getWebsit } from '@/api/customerManagement.js'
- import { EventBus } from '@/utils/eventBus'
- import ImageUpload from '@/components/file-upload'
- export default {
- components: { TemplatePage, ImageUpload },
- mixins: [import_mixin, operation_mixin],
- data() {
- return {
- // 表格属性
- tableAttributes: {
- selectColumn: false
- },
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange
- },
- recordSelected: [],
- formBool: false,
- formBoolXQ: false,
- formType: 0,
- formData: {
- adminCompanyId: '',
- adminCompanyName: '',
- code: '',
- content: '',
- deptName: '',
- issueNickName: '',
- issueTime: '',
- issueUserId: '',
- noticeWebsitId: '',
- num: '',
- status: 'SEND',
- title: '',
- type: '',
- websitIds: [],
- websits: [],
- file: []
- },
- formRules: {},
- formInline: {
- websitId: '',
- websitName: ''
- }
- }
- },
- computed: {
- optionsEvensGroup() {
- return [
- [
- [
- this.optionsEvensAuth('add', {
- click: () => {
- this.openWindow(() => {
- this.formType = 0
- this.formBool = true
- })
- }
- })
- ]
- ]
- ]
- },
- items() {
- return [
- {
- isShow: this.formType == 0,
- name: 'el-select',
- md: 12,
- name: 'el-radio',
- options: [
- { label: '管理', value: 'GL' },
- { label: '技术', value: 'JS' },
- { label: '其他', value: 'QT' },
- { label: '政策', value: 'ZC' },
- { label: '资讯', value: 'ZX' }
- ],
- attributes: {
- disabled: this.formType == 2,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '通知类型',
- prop: 'type',
- rules: [...required]
- }
- },
- {
- isShow: this.formType == 0,
- name: 'el-input',
- md: 12,
- attributes: {
- disabled: this.formType == 2,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '来源部门',
- prop: 'deptName',
- rules: [...required]
- }
- },
- {
- isShow: this.formType == 0,
- name: 'el-input',
- md: 12,
- attributes: {
- disabled: this.formType == 2,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '文件编号',
- prop: 'code',
- rules: [...required]
- }
- },
- {
- isShow: this.formType == 0,
- name: 'el-input',
- md: 12,
- attributes: {
- disabled: this.formType == 2,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '文件标题',
- prop: 'title',
- rules: [...required]
- }
- },
- {
- name: 'slot-component',
- md: 24,
- attributes: { disabled: this.disabled },
- formItemAttributes: { label: '通知内容', prop: 'content', rules: [...required] },
- render: (h, { props }) => {
- var { formData } = props
- return (
- <v-quill-editor
- value={formData.content}
- onInput={val => {
- formData.content = val
- }}
- ></v-quill-editor>
- )
- }
- },
- {
- md: 24,
- isShow: true,
- name: 'slot-component',
- formItemAttributes: {
- label: '附件',
- prop: 'file',
- rules: []
- },
- render: (h, { props, onInput }) => {
- var { value } = props
- return (
- <ImageUpload
- fileList={this.formData.file}
- uid="idcardUpUrl_drawg_FUJIAN"
- limit={100}
- isEdit={this.formType == 0}
- />
- )
- }
- }
- ]
- },
- items2() {
- return [
- {
- name: 'slot-component',
- md: 24,
- attributes: {},
- formItemAttributes: { label: '', 'label-width': '0px', prop: 'websits', rules: [] },
- render: (h, { props, onInput }) => {
- var { formData } = props
- return (
- <div>
- <div>
- <el-form
- size="mini"
- inline={true}
- value={this.formInline}
- onInput={v => {
- this.formInline = v
- }}
- label-width="0px"
- >
- <el-form-item label="">
- <el-input
- value={this.formInline.websitId}
- onInput={v => {
- this.formInline.websitId = v
- }}
- placeholder="网点编号"
- ></el-input>
- </el-form-item>
- <el-form-item label="">
- <el-input
- value={this.formInline.websitName}
- onInput={v => {
- this.formInline.websitName = v
- }}
- placeholder="网点名称"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button
- type="primary"
- onClick={() => {
- EventBus.$emit('handlePaginationCallBack22')
- }}
- >
- 查询
- </el-button>
- <el-button
- onClick={() => {
- this.formInline.websitId = ''
- this.formInline.websitName = ''
- this.$nextTick(() => {
- EventBus.$emit('handlePaginationCallBack22')
- })
- }}
- >
- 重置
- </el-button>
- </el-form-item>
- </el-form>
- </div>
- <pagingTransfer
- handlePaginationCallBackKey="handlePaginationCallBack22"
- value={this.formData.websits}
- onInput={v => {
- this.formData.websits = v
- }}
- left-columns={[
- { id: 'belongCompanyCode', label: '所属公司编号', width: '160' },
- { id: 'websitId', label: '网点编号', width: '120' },
- { id: 'websitName', label: '网点名称', width: '' }
- ]}
- right-columns={[
- { id: 'belongCompanyCode', label: '所属公司编号', width: '160' },
- { id: 'websitId', label: '网点编号', width: '120' },
- { id: 'websitName', label: '网点名称', width: '' }
- ]}
- show-pagination={false}
- pagination-call-back={this.paginationCallback}
- title-texts={['待选项', '已选项']}
- min-height="300px"
- table-row-key={row => row.websitId}
- />
- </div>
- )
- }
- }
- ]
- }
- },
- created() {
- this.initFun()
- },
- methods: {
- initFun() {
- if (this.pageType == 'detail' && this.pageCode) {
- noticeWebsitDetail({
- id: this.pageCode
- }).then(res => {
- this.formData = {
- ...res.data,
- file: res.data.file ? res.data.file.split(',').map(url => ({ url })) : []
- }
- this.formType = 2
- this.openWindow(() => {
- this.formBoolXQ = true
- })
- })
- }
- },
- // 列表请求函数
- getList: noticeWebsitList,
- // 导出
- exportList: noticeWebsitListExport,
- // 列表请求函数
- getList2(p, cb) {
- var pam = JSON.parse(JSON.stringify(p))
- try {
- pam.params.push({ param: 'a.notice_websit_id', compare: '=', value: this.formData.noticeWebsitId })
- cb && cb(pam)
- return noticeWebsitListWebsit(pam)
- } catch (err) {}
- },
- // 导出
- exportList2: noticeWebsitListWebsitExport,
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- return defaultData
- },
- // 获取勾选框数据
- selectionChange(data) {
- this.recordSelected = data
- },
- handleClose() {
- this.$refs?.pageRef?.refreshList()
- this.$data.formData = this.$options.data().formData
- this.formType = 0
- this.formBool = false
- this.formBoolXQ = false
- },
- formConfirm() {
- this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- ;(this.formType ? noticeWebsitUpdate : noticeWebsitAdd)({
- ...this.formData,
- websitIds: this.formData.websits.map(item => item.websitId),
- file: this.formData.file.map(item => item.url).join(',')
- }).then(res => {
- this.$message({ type: 'success', message: '成功!' })
- this.$refs.pageRef.refreshList()
- this.handleClose()
- })
- }
- })
- },
- operation() {
- return this.operationBtn({
- details: {
- click: ({ row, index, column }) => {
- this.openWindow(() => {
- noticeWebsitDetail({
- id: row.noticeWebsitId
- }).then(res => {
- this.formData = {
- ...res.data,
- file: res.data.file ? res.data.file.split(',').map(url => ({ url })) : []
- }
- this.formType = 2
- this.openWindow(() => {
- this.formBoolXQ = true
- })
- })
- })
- }
- },
- publish: {
- prompt: '确定发布吗?',
- conditions: ({ row, index, column }) => {
- return row.status !== 'SEND'
- },
- click: ({ row, index, column }) => {
- noticeWebsitOfOrSend({
- id: row.noticeWebsitId,
- status: 'SEND'
- }).then(res => {
- this.$message({
- type: 'success',
- message: '操作成功!'
- })
- this.$refs.pageRef.refreshList()
- })
- }
- },
- close: {
- prompt: '确定关闭吗?',
- conditions: ({ row, index, column }) => {
- return row.status !== 'OFF'
- },
- click: ({ row, index, column }) => {
- noticeWebsitOfOrSend({
- id: row.noticeWebsitId,
- status: 'OFF'
- }).then(res => {
- this.$message({
- type: 'success',
- message: '操作成功!'
- })
- this.$refs.pageRef.refreshList()
- })
- }
- }
- })
- },
- operation2() {
- return this.operationBtn({
- details: {
- name: '接收',
- conditions: ({ row, index, column }) => {
- return row.readFlag == 'NO'
- },
- click: ({ row, index, column }) => {
- noticeWebsitMarkReadOne({
- id: row.id
- }).then(res => {
- this.$message({
- type: 'success',
- message: '操作成功!'
- })
- this.$refs.pageRef2.refreshList()
- })
- }
- }
- })
- },
- openWindow(cb) {
- this.$nextTick(() => {
- cb?.()
- })
- },
- paginationCallback({ pageIndex, pageSize }) {
- return new Promise(resolve => {
- getWebsit({ ...this.formInline }).then(res => {
- resolve({
- total: res.data.filter(item => item.type == 'C').length,
- data: res.data
- .filter(item => item.type == 'C')
- .map(item => {
- return {
- ...item,
- websitName: item.name
- }
- })
- })
- })
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .nlnlknmlkmkl {
- .zj-page-template {
- padding: 0px !important;
- }
- .zj-page-fill {
- min-height: auto !important;
- .zj-page-fill-scroll {
- height: auto !important;
- .page-content {
- height: auto !important;
- .el-form {
- height: auto !important;
- .zj-table-class {
- height: auto !important;
- .dropUseKey {
- height: auto !important;
- }
- }
- }
- }
- }
- }
- }
- </style>
- <style lang="scss" scoped>
- .nlnlknmlkmkl {
- ::v-deep .zj-page-template {
- padding: none !important;
- }
- }
- .neibuview {
- box-sizing: border-box;
- padding-left: 16px;
- ::v-deep & > .zj-page-fill-scroll {
- box-sizing: border-box;
- padding-right: 16px;
- & > div:nth-child(1) {
- margin-top: 20px;
- }
- }
- }
- </style>
|