123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206 |
- <template>
- <template-page
- v-if="pageShow"
- ref="pageRef"
- :get-list="getList"
- :exportList="exportList"
- :table-attributes="tableAttributes"
- :table-events="tableEvents"
- :options-evens-group="optionsEvensGroup"
- :moreParameters="moreParameters"
- :column-parsing="columnParsing"
- :operation="operation()"
- :fieldBeansHook="fieldBeansHook"
- key="pageType"
- >
- <div class="cartographer_big">
- <el-dialog title="工作联络函" width="100%" :modal="false" :visible.sync="formDialog" :before-close="handleClose">
- <zj-page-container>
- <zj-page-fill>
- <div style="box-sizing: border-box; padding: 20px 20px 0 20px">
- <zj-form-container
- v-if="formDialog"
- ref="formRef"
- :form-data="formData"
- :form-attributes="{ size: 'mini' }"
- >
- <zj-form-module title="基本信息" label-width="100px" :form-data="formData" :form-items="formItems">
- </zj-form-module>
- <template v-if="[-1].includes(openType) && formData.leLetterItems && formData.leLetterItems.length">
- <template v-for="(item, index) in formData.leLetterItems">
- <zj-form-module
- :key="`${index}1`"
- :title="`网点审核${index + 1}`"
- label-width="100px"
- :form-data="item"
- :form-items="formItems1"
- >
- </zj-form-module>
- <zj-form-module
- v-if="!!item.examineStatus"
- :key="`${index}2`"
- :title="`中心审核${index + 1}`"
- label-width="100px"
- :form-data="item"
- :form-items="formItems2"
- >
- </zj-form-module>
- </template>
- </template>
- </zj-form-container>
- <zj-form-container
- v-if="formDialog && [1, 2].includes(openType)"
- ref="formRef1"
- :form-data="formData1"
- :form-attributes="{ size: 'mini' }"
- >
- <zj-form-module title="网点审核" label-width="100px" :form-data="formData1" :form-items="formItems1">
- </zj-form-module>
- </zj-form-container>
- <zj-form-container
- v-if="formDialog && [2].includes(openType)"
- ref="formRef2"
- :form-data="formData2"
- :form-attributes="{ size: 'mini' }"
- >
- <zj-form-module title="中心审核" label-width="100px" :form-data="formData2" :form-items="formItems2">
- </zj-form-module>
- </zj-form-container>
- </div>
- </zj-page-fill>
- <div style="text-align: right; box-sizing: border-box; padding: 16px 20px">
- <el-button size="mini" @click="handleClose">取消</el-button>
- <el-button v-if="openType == 0" size="mini" type="primary" @click="save()">保存</el-button>
- <el-button v-if="openType == 0" size="mini" type="primary" @click="save('SEND')">发送</el-button>
- <el-button v-if="openType == 1" size="mini" type="primary" @click="networkAudit">网点申诉</el-button>
- <el-button v-if="openType == 2" size="mini" type="primary" @click="centralAudit">中心审核</el-button>
- </div>
- </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 operation_mixin from '@/components/template/operation_mixin.js'
- import {
- letterProcessList,
- letterProcessListExport,
- letterProcessDetailLetter,
- letterProcessAddLetter,
- letterProcessUpdateLetter,
- letterProcessDelLetter,
- letterProcessAppeal, // 网点申诉
- letterProcessCancel, // 作废
- letterProcessExamine, // 中心批复
- letterProcessReject, // 驳回
- letterProcessSend // 发送
- } from '@/api/workContactLetterPage.js'
- import { required } from '@/components/template/rules_verify.js'
- import { getWebsit } from '@/api/customerManagement.js'
- import { letterManagerListProject } from '@/api/assessmentItemSetting.js'
- import { listPageV2 } from '@/api/workOrder/orderType'
- import { getClassifyList } from '@/api/goods'
- import { orderBaseDetail } from '@/api/workOrderPool.js'
- import { letterManagerListUser } from '@/api/department.js'
- import ImageUpload from '@/components/file-upload'
- export default {
- components: { TemplatePage, ImageUpload },
- mixins: [import_mixin, operation_mixin],
- data() {
- return {
- pageType: 'list',
- pageShow: true,
- // 表格属性
- tableAttributes: {
- // 启用勾选列
- selectColumn: true
- },
- // 表格事件
- tableEvents: {
- 'selection-change': this.selectionChange
- },
- // 勾选选中行
- recordSelected: [],
- /** 表单变量 */
- formDialog: false,
- formData: {
- belongCompany: '',
- belongCompanyCode: '',
- companyWechatId: '',
- companyWechatName: '',
- context: '此单是今日下发联络函,请贵司自接到联络函起3天内系统提交申诉,逾期未申诉默认网点无异议。',
- dapartment: '',
- dapartmentId: '',
- examineFration: 0,
- examineName: '',
- examinePrice: 0,
- examineStatus: '',
- examineTime: '',
- fraction: 0,
- leLetterId: '',
- leLetterItems: [],
- letteWebsitNum: 0,
- letterNum: 0,
- letterNumber: '',
- mainId: '',
- mainName: '',
- orderCreateTime: '',
- orderId: '',
- orderSmallType: '',
- orderSmallTypeText: '',
- price: 0,
- projectId: '',
- projectName: '',
- projectReg: '',
- projectText: '',
- remark: '',
- sendTime: '',
- status: '',
- type: '',
- websitId: '',
- websitName: '',
- fileUrl: []
- },
- websitList: [],
- managerList: [],
- managerListProject: [],
- orderSmallTypeData: [],
- classifyList: [],
- openType: 0,
- formData1: {
- appealRemark: null,
- appealUrl: [],
- createBy: null,
- createTime: null,
- examineFration: 0,
- examineName: null,
- examinePrice: 0,
- examineRemark: null,
- examineStatus: null,
- examineTime: null,
- leLetterId: null,
- leLetterItemId: null,
- websitAppeal: null
- },
- formData2: {
- appealRemark: null,
- appealUrl: null,
- createBy: null,
- createTime: null,
- examineFration: 0,
- examineName: null,
- examinePrice: 0,
- examineRemark: null,
- examineStatus: null,
- examineTime: null,
- leLetterId: null,
- leLetterItemId: null,
- websitAppeal: null
- }
- }
- },
- computed: {
- userData() {
- return JSON.parse(localStorage.getItem('greemall_user'))
- },
- // 事件组合
- optionsEvensGroup() {
- return [
- [
- [
- this.optionsEvensAuth('add', {
- click: this.openForm
- })
- ]
- ],
- [
- [
- this.optionsEvensAuth('void', {
- click: () => {
- if (this.recordSelected.length === 0) {
- this.$message.warning('请勾选数据')
- return
- }
- this.$confirm(' 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- letterProcessCancel({
- ids: this.recordSelected.map(item => item.leLetterId).join(',')
- })
- .then(res => {
- this.$refs?.pageRef?.refreshList()
- this.recordSelected = []
- this.$message({
- message: '操作成功',
- type: 'success'
- })
- })
- .catch(err => {
- // this.$message.error('操作失败')
- })
- })
- .catch(() => {})
- }
- })
- ]
- ],
- [
- [
- this.optionsEvensAuth('send', {
- click: () => {
- if (this.recordSelected.length === 0) {
- this.$message.warning('请勾选数据')
- return
- }
- this.$confirm(' 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- letterProcessSend({
- ids: this.recordSelected.map(item => item.leLetterId).join(',')
- })
- .then(res => {
- this.$refs?.pageRef?.refreshList()
- this.recordSelected = []
- this.$message({
- message: '操作成功',
- type: 'success'
- })
- })
- .catch(err => {
- // this.$message.error('操作失败')
- })
- })
- .catch(() => {})
- }
- })
- ]
- ],
- [
- [
- this.optionsEvensAuth('oneCaseRejected', {
- click: () => {
- if (this.recordSelected.length === 0) {
- this.$message.warning('请勾选数据')
- return
- }
- this.$confirm(' 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- letterProcessReject({
- ids: this.recordSelected.map(item => item.leLetterId).join(',')
- })
- .then(res => {
- this.$refs?.pageRef?.refreshList()
- this.recordSelected = []
- this.$message({
- message: '操作成功',
- type: 'success'
- })
- })
- .catch(err => {
- // this.$message.error('操作失败')
- })
- })
- .catch(() => {})
- }
- })
- ]
- ]
- ]
- },
- // 更多参数
- moreParameters() {
- return [
- {
- name: '状态',
- key: 'status',
- value: '',
- conditions: [
- {
- label: '全部',
- value: ''
- },
- {
- label: '待审核',
- value: 'WAIT_EXAMINE'
- },
- {
- label: '已执行',
- value: 'EXECUTED'
- },
- {
- label: '已撤销',
- value: 'REVOKE'
- },
- {
- label: '已减免',
- value: 'REDUCTION'
- },
- {
- label: '已作废',
- value: 'CANCEL'
- },
- {
- label: '待发送',
- value: 'WAIT'
- },
- {
- label: '待执行',
- value: 'SEND'
- }
- ]
- }
- ]
- },
- formItems() {
- return [
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '联络函编号',
- prop: 'letterNumber',
- rules: []
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '下发时间',
- prop: 'sendTime',
- rules: []
- }
- },
- {
- name: 'el-radio',
- options: [
- { label: '考核函', value: '考核函' },
- { label: '奖励函', value: '奖励函' },
- { label: '整改函', value: '整改函' }
- ],
- md: 6,
- attributes: {
- disabled: this.openType != 0,
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '函件类型',
- prop: 'type',
- rules: [...required]
- }
- },
- {
- name: 'el-select',
- options: this.managerList.map(item => ({
- data: item,
- label: item.dapartment,
- value: item.id
- })),
- echoInsertion: true,
- md: 6,
- attributes: {
- disabled: this.openType != 0,
- placeholder: '请选择',
- clearable: true,
- filterable: true
- },
- formItemAttributes: {
- label: '来源科室',
- prop: 'dapartmentId',
- propName: 'dapartment',
- rules: [...required]
- },
- events: {
- change: val => {
- if (val) {
- this.formData.dapartment = this.managerList?.find(item => item.id === val)?.dapartment
- } else {
- this.formData.dapartment = ''
- }
- }
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: this.openType != 0
- },
- formItemAttributes: {
- label: '工单编号',
- prop: 'orderId',
- rules: [...required]
- },
- events: {
- input: val => {
- if (val) {
- orderBaseDetail({
- orderBaseId: val,
- returnErr: true
- })
- .then(res => {
- if (res.data.orderProducts.length == 1) {
- this.formData.mainId = res.data.orderProducts?.[0]?.mainId || ''
- this.formData.mainName = res.data.orderProducts?.[0]?.mainName || ''
- }
- this.formData.orderSmallType = res.data?.orderSmallType || ''
- this.formData.orderSmallTypeText = res.data?.orderSmallTypeText || ''
- this.formData.orderCreateTime = res.data?.createTime || ''
- this.formData.websitId = res.data?.websitId || ''
- this.formData.websitName = res.data?.websitName || ''
- })
- .catch(err => {
- this.formData.mainId = ''
- this.formData.mainName = ''
- this.formData.orderSmallType = ''
- this.formData.orderSmallTypeText = ''
- this.formData.orderCreateTime = ''
- this.formData.websitId = ''
- this.formData.websitName = ''
- })
- }
- }
- }
- },
- {
- name: 'el-select',
- options: this.classifyList.map(item => ({
- data: item,
- label: item.name,
- value: item.categoryId
- })),
- echoInsertion: true,
- md: 6,
- attributes: {
- disabled: this.openType != 0,
- placeholder: '请选择',
- clearable: true,
- filterable: true
- },
- formItemAttributes: {
- label: '产品大类',
- prop: 'mainId',
- propName: 'mainName',
- rules: [...required]
- },
- events: {
- change: val => {
- if (val) {
- this.formData.mainName = this.classifyList?.find(item => item.categoryId === val)?.name
- } else {
- this.formData.mainName = ''
- }
- }
- }
- },
- {
- name: 'el-select',
- md: 6,
- options: this.orderSmallTypeData,
- attributes: {
- disabled: this.openType != 0,
- placeholder: '请选择',
- clearable: true,
- filterable: true
- },
- formItemAttributes: {
- label: '工单类型',
- prop: 'orderSmallType',
- rules: [...required]
- },
- events: {
- change: val => {
- if (val) {
- this.orderInfo.orderSmallTypeText = this.orderSmallTypeData.find(item => item.value == val).label
- } else {
- this.orderInfo.orderSmallTypeText = ''
- }
- }
- }
- },
- {
- md: 6,
- name: 'el-date-picker',
- attributes: {
- disabled: this.openType != 0,
- style: { width: '100%' },
- type: 'datetime',
- 'value-format': 'yyyy-MM-dd HH:mm:ss'
- },
- formItemAttributes: {
- label: '工单创建日期',
- prop: 'orderCreateTime',
- rules: []
- }
- },
- {
- name: 'el-select',
- options: this.websitList.map(item => ({
- data: item,
- label: item.name,
- value: item.websitId
- })),
- echoInsertion: true,
- md: 12,
- attributes: {
- disabled: this.openType != 0,
- placeholder: '请选择',
- clearable: true,
- filterable: true
- },
- formItemAttributes: {
- label: '接收网点',
- prop: 'websitId',
- propName: 'websitName',
- rules: [...required]
- },
- events: {
- change: val => {
- if (val) {
- this.formData.websitName = this.websitList?.find(item => item.websitId === val)?.name
- } else {
- this.formData.websitName = ''
- }
- }
- }
- },
- {
- name: 'el-select',
- options: this.managerListProject.map(item => ({
- data: item,
- label: item.projectName,
- value: item.projectId
- })),
- echoInsertion: true,
- md: 12,
- attributes: {
- disabled: this.openType != 0,
- placeholder: '请选择',
- clearable: true,
- filterable: true
- },
- formItemAttributes: {
- label: '考核项目',
- prop: 'projectId',
- propName: 'projectName',
- rules: [...required]
- },
- events: {
- change: val => {
- if (val) {
- var data = this.managerListProject?.find(item => item.projectId === val)
- this.formData.projectName = data?.projectName
- this.formData.projectReg = data?.projectReg || ''
- this.formData.projectText = data?.projectText || ''
- this.formData.price = data?.price || ''
- this.formData.fraction = data?.fraction || ''
- } else {
- this.formData.projectReg = ''
- this.formData.projectText = ''
- this.formData.price = ''
- this.formData.fraction = ''
- this.formData.projectName = ''
- }
- }
- }
- },
- {
- md: 12,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '考核条例',
- prop: 'projectReg',
- rules: [...required]
- }
- },
- {
- md: 24,
- name: 'el-input',
- attributes: {
- disabled: true,
- type: 'textarea',
- rows: 3
- },
- formItemAttributes: {
- label: '考核规定',
- prop: 'projectText',
- rules: [...required]
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '考核金额',
- prop: 'price',
- rules: [...required]
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '考核分数',
- prop: 'fraction',
- rules: [...required]
- }
- },
- {
- md: 24,
- name: 'el-input',
- attributes: {
- disabled: this.openType != 0,
- type: 'textarea',
- rows: 3
- },
- formItemAttributes: {
- label: '函件内容',
- prop: 'context',
- rules: [...required]
- }
- },
- {
- md: 24,
- name: 'el-input',
- attributes: {
- disabled: this.openType != 0,
- type: 'textarea',
- rows: 3
- },
- formItemAttributes: {
- label: '备注',
- prop: 'remark',
- rules: []
- }
- },
- {
- md: 24,
- isShow: true,
- name: 'slot-component',
- formItemAttributes: {
- label: '附件',
- prop: 'fileUrl',
- rules: []
- },
- render: (h, { props, onInput }) => {
- return (
- <div>
- <ImageUpload fileList={this.formData.fileUrl} limit={100} isEdit={this.openType == 0} />
- </div>
- )
- }
- }
- ]
- },
- formItems1() {
- return [
- {
- name: 'el-radio',
- options: [
- { label: '接受', value: 'OK' },
- { label: '申诉', value: 'AP' }
- ],
- md: 8,
- attributes: {
- disabled: [-1, 2].includes(this.openType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '核实结果',
- prop: 'websitAppeal',
- rules: [...required]
- }
- },
- {
- md: 8,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '申诉人',
- prop: 'createBy',
- rules: []
- }
- },
- {
- md: 8,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '申诉时间',
- prop: 'createTime',
- rules: []
- }
- },
- {
- isShow: this.openType == -1 ? true : ['AP'].includes(this.formData1.websitAppeal),
- md: 24,
- name: 'el-input',
- attributes: {
- disabled: [-1, 2].includes(this.openType),
- type: 'textarea',
- rows: 3
- },
- formItemAttributes: {
- label: '申诉内容',
- prop: 'appealRemark',
- rules: [...required]
- }
- },
- {
- md: 24,
- name: 'slot-component',
- formItemAttributes: {
- label: '申诉附件',
- prop: 'appealUrl',
- rules: []
- },
- render: (h, { props, onInput }) => {
- var { value } = props
- return (
- <div>
- <ImageUpload fileList={value} limit={100} isEdit={this.openType == 1} />
- </div>
- )
- }
- }
- ]
- },
- formItems2() {
- return [
- {
- name: 'el-radio',
- options: [
- { label: '通过', value: 'OK' },
- { label: '驳回', value: 'FAIL' },
- { label: '减免', value: 'SUB' }
- ],
- md: 24,
- attributes: {
- disabled: [-1].includes(this.openType),
- placeholder: '请输入'
- },
- formItemAttributes: {
- label: '审核结果',
- prop: 'examineStatus',
- rules: [...required]
- },
- events: {
- change: val => {
- if (val == 'OK') {
- this.formData2.examinePrice = 0
- this.formData2.examineFration = 0
- } else if (val == 'FAIL') {
- this.formData2.examinePrice = this.formData.price
- this.formData2.examineFration = this.formData.fraction
- } else if (val == 'SUB') {
- this.formData2.examinePrice = ''
- this.formData2.examineFration = ''
- }
- }
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: [-1].includes(this.openType) || ['OK', 'FAIL'].includes(this.formData2.examineStatus)
- },
- formItemAttributes: {
- label: '审批金额',
- prop: 'examinePrice',
- rules: [...required]
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: [-1].includes(this.openType) || ['OK', 'FAIL'].includes(this.formData2.examineStatus)
- },
- formItemAttributes: {
- label: '审批分数',
- prop: 'examineFration',
- rules: [...required]
- }
- },
- {
- isShow: this.userData.type != 0,
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '审批人',
- prop: 'examineName',
- rules: []
- }
- },
- {
- md: 6,
- name: 'el-input',
- attributes: {
- disabled: true
- },
- formItemAttributes: {
- label: '审批时间',
- prop: 'createTime',
- rules: []
- }
- },
- {
- md: 24,
- name: 'el-input',
- attributes: {
- disabled: [-1].includes(this.openType),
- type: 'textarea',
- rows: 3
- },
- formItemAttributes: {
- label: '审批内容',
- prop: 'examineRemark',
- rules: [...required]
- }
- }
- ]
- }
- },
- created() {
- if (this.$route?.query?.orderBaseId) {
- const loading = this.$loading({
- lock: true,
- text: '正在前往创建工作联络函页面......',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- })
- this.openForm(() => {
- this.formData.orderId = this.$route?.query?.orderBaseId
- orderBaseDetail({
- orderBaseId: this.$route?.query?.orderBaseId,
- returnErr: true
- })
- .then(res => {
- loading.close()
- if (res.data.orderProducts.length == 1) {
- this.formData.mainId = res.data.orderProducts?.[0]?.mainId || ''
- this.formData.mainName = res.data.orderProducts?.[0]?.mainName || ''
- }
- this.formData.orderSmallType = res.data?.orderSmallType || ''
- this.formData.orderSmallTypeText = res.data?.orderSmallTypeText || ''
- this.formData.orderCreateTime = res.data?.createTime || ''
- this.formData.websitId = res.data?.websitId || ''
- this.formData.websitName = res.data?.websitName || ''
- })
- .catch(err => {
- this.formData.mainId = ''
- this.formData.mainName = ''
- this.formData.orderSmallType = ''
- this.formData.orderSmallTypeText = ''
- this.formData.orderCreateTime = ''
- this.formData.websitId = ''
- this.formData.websitName = ''
- })
- })
- }
- },
- methods: {
- // 列表请求函数
- getList(p, cb) {
- var pam = JSON.parse(JSON.stringify(p))
- try {
- if (pam.status) {
- pam.params.push({ param: 'a.status', compare: '=', value: pam.status })
- }
- cb && cb(pam)
- return letterProcessList(pam)
- } catch (e) {
- console.log(e)
- }
- },
- // 列表导出函数
- exportList: letterProcessListExport,
- // 列表字段解析渲染数据更改
- fieldBeansHook(data) {
- return data.filter(item => {
- return this.userData.type == 0 ? !['create_by', 'examine_name'].includes(item.colName) : true
- })
- },
- // 表格列解析渲染数据更改
- columnParsing(item, defaultData) {
- return defaultData
- },
- // 监听勾选变化
- selectionChange(data) {
- this.recordSelected = data
- },
- // 打开创建弹窗
- openForm(cb) {
- Promise.all([
- getWebsit({ status: true }),
- letterManagerListUser({
- pageNum: 1,
- pageSize: -1,
- params: [
- {
- param: 'a.user_name',
- compare: '=',
- value: JSON.parse(localStorage.getItem('greemall_user'))?.userName
- }
- ]
- }),
- letterManagerListProject({
- pageNum: 1,
- pageSize: -1,
- params: [{ param: 'a.status', compare: '=', value: 'ON' }]
- }),
- listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }),
- getClassifyList({ type: 2, status: true })
- ]).then(([res2, res3, res4, res5, res6]) => {
- this.openType = 0
- this.websitList = res2.data
- this.managerList = res3.data.records
- if (this.managerList.length == 1) {
- this.formData.dapartmentId = this.managerList?.[0]?.id
- this.formData.dapartment = this.managerList?.[0]?.dapartment
- }
- this.managerListProject = res4.data.records
- this.orderSmallTypeData = res5.data.records.map(item => ({
- value: item.id,
- label: item.orderSmallTypeText
- }))
- this.classifyList = res6.data.map(item => {
- var { children, ...data } = item
- return {
- ...data
- }
- })
- cb?.()
- this.formDialog = true
- })
- },
- // 打开详情弹窗
- openDetailForm(row) {
- Promise.all([
- letterProcessDetailLetter({ id: row.leLetterId }),
- getWebsit({ status: true }),
- letterManagerListUser({
- pageNum: 1,
- pageSize: -1,
- params: [
- {
- param: 'a.user_name',
- compare: '=',
- value: JSON.parse(localStorage.getItem('greemall_user'))?.userName
- }
- ]
- }),
- letterManagerListProject({
- pageNum: 1,
- pageSize: -1,
- params: [{ param: 'a.status', compare: '=', value: 'ON' }]
- }),
- listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }),
- getClassifyList({ type: 2, status: true })
- ]).then(([res1, res2, res3, res4, res5, res6]) => {
- this.formData = {
- ...res1.data,
- fileUrl: res1.data.fileUrl ? res1.data.fileUrl.split(',').map(url => ({ url })) : []
- }
- // 中心审批时需要把申述数据转换到formData1
- if (this.openType == 2 && res1.data.leLetterItems?.[0]) {
- this.formData1 = {
- ...res1.data.leLetterItems?.[0],
- appealUrl: res1.data.leLetterItems?.[0]?.appealUrl
- ? res1.data.leLetterItems?.[0]?.appealUrl.split(',').map(url => ({ url }))
- : []
- }
- }
- // 查看详情数据转换
- if (this.openType == -1) {
- this.formData = {
- ...this.formData,
- leLetterItems: this.formData.leLetterItems
- ? this.formData.leLetterItems.map(item => {
- return {
- ...item,
- appealUrl: item?.appealUrl ? item?.appealUrl.split(',').map(url => ({ url })) : []
- }
- })
- : []
- }
- }
- this.websitList = res2.data
- this.managerList = res3.data.records
- this.managerListProject = res4.data.records
- this.orderSmallTypeData = res5.data.records.map(item => ({
- value: item.id,
- label: item.orderSmallTypeText
- }))
- this.classifyList = res6.data.map(item => {
- var { children, ...data } = item
- return {
- ...data
- }
- })
- this.formDialog = true
- })
- },
- handleClose() {
- this.$refs?.formRef?.resetFields()
- this.$data.formData = this.$options.data().formData
- this.$data.formData1 = this.$options.data().formData1
- this.$data.formData2 = this.$options.data().formData2
- this.formDialog = false
- this.openType = 0
- },
- // 操作按钮
- operation() {
- return this.operationBtn({
- details: {
- click: ({ row, index, column }) => {
- this.openType = -1
- this.openDetailForm(row)
- }
- },
- edit: {
- conditions: ({ row, index, column }) => {
- return row.status === 'WAIT'
- },
- click: ({ row, index, column }) => {
- this.openType = 0
- this.openDetailForm(row)
- }
- },
- networkAppeal: {
- conditions: ({ row, index, column }) => {
- return row.status === 'SEND'
- },
- click: ({ row, index, column }) => {
- this.openType = 1
- this.openDetailForm(row)
- }
- },
- centralRebatch: {
- conditions: ({ row, index, column }) => {
- return row.status === 'WAIT_EXAMINE'
- },
- click: ({ row, index, column }) => {
- this.openType = 2
- this.openDetailForm(row)
- }
- }
- // del: {
- // conditions: ({ row, index, column }) => {
- // return true
- // },
- // prompt: '确定删除?',
- // click: ({ row, index, column }) => {
- // letterProcessDelLetter({
- // id: row.id
- // })
- // .then(res => {
- // this.$refs.pageRef.refreshList()
- // this.$message({
- // type: 'success',
- // message: `删除成功!`
- // })
- // })
- // .catch(err => {
- // console.log(err)
- // })
- // }
- // }
- })
- },
- // 保存
- save(status) {
- this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- ;(this.formData?.leLetterId ? letterProcessUpdateLetter : letterProcessAddLetter)({
- ...this.formData,
- status: status || this.formData.status,
- fileUrl: this.formData.fileUrl.length ? this.formData.fileUrl.map(item => item.url).join(',') : ''
- }).then(res => {
- this.$message({
- type: 'success',
- message: '保存成功'
- })
- this.handleClose()
- this.$refs.pageRef.refreshList()
- })
- }
- })
- },
- networkAudit() {
- this.$refs.formRef1.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- letterProcessAppeal({
- ...this.formData1,
- appealUrl: this.formData1.appealUrl.length ? this.formData1.appealUrl.map(item => item.url).join(',') : '',
- leLetterId: this.formData?.leLetterId
- }).then(res => {
- this.$message({
- type: 'success',
- message: '审核成功'
- })
- this.handleClose()
- this.$refs.pageRef.refreshList()
- })
- }
- })
- },
- centralAudit() {
- this.$refs.formRef2.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- letterProcessExamine({
- ...this.formData2,
- leLetterItemId: this.formData.leLetterItems?.[0]?.leLetterItemId,
- leLetterId: this.formData?.leLetterId
- }).then(res => {
- this.$message({
- type: 'success',
- message: '审核成功'
- })
- this.handleClose()
- this.$refs.pageRef.refreshList()
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|