备注:标段
有且只有一个标段:默认选中且必选,不可传空。(传空会查询出账号以外的标段数据)
有多个标段:默认第一个或者默认空,为空情况下查询多标段数据,不会查询账号以外的标段数据

<template lang='pug'>.supervision-monthlyReport.boxCommon.boxHeaderxt-search(:searchList="searchList" ref="formName" @submit="searchHandle" :hasResetBtn="false")div(style="display: flex;")el-button(type="primary" style="display: inherit;margin-left:10px;" size="small" icon="iconfont icon-icon_xinzeng" @click="addFun") 新增.boxTableel-table(:data="tableData" border height="calc(100vh - 240px)"  v-loading="tableLoading")el-table-column(label="序号" type="index" align="center" width="80")el-table-column(prop="paragraph_name" label="标段" align="center" show-overflow-tooltip)el-table-column(prop="subsection_name" label="施工段(监理标)" align="center" show-overflow-tooltip)el-table-column(prop="number" label="期号" align="center")el-table-column(prop="create_time" label="创建时间" align="center")el-table-column(prop="realname" label="创建人" align="center")el-table-column(prop="status" label="状态" align="center")el-table-column(label="操作" align="center" width="220")template(slot-scope="scope").operatespan(@click="handleFun(0, scope.row)") 查看span(v-if="scope.row.delete" @click="handleFun(1, scope.row)") 删除span(v-if="scope.row.edit" @click="handleFun(2, scope.row)") 修改span(v-if="scope.row.handle" @click="handleFun(4, scope.row)") 处理xt-pagination(:total="total" @change="changePage" :page="pageForm.page" :page-size="pageForm.pageSize")xt-dialog(:title="title"ref="dialogRef"class="dialogRef":showfooter="showfooter"top="5vh"width="55%"append-to-body:hasCancle="hasCancle":hasDraft="hasDraft":confirmText="confirmText"@confirm="handleConfirm"@draft="handleDraft":autoclose="false"@close="handleDialogClose")xt-form(ref="xtFormRef":label-width="150":formList="formList":type="title":grid="[2,2,1,1]"@submit="submit")process(:title="title" ref="processRef" :formDetails="formDetails" :historyTableData="historyTableData" )
</template><script>
import { mapGetters } from 'vuex'
import process from '@/views/components/process'
export default {name: 'supervision-monthlyReport',
components: {process
},
data() {let vm = thisreturn {btnType: '',historyTableData: [],title: '新增',hasDraft: true,hasCancle: false,showfooter: true,confirmText: '提交审批',cancleText: '保存草稿',dialogData: [],formDetails: {},total: 0,formList: [{title: '标段:',type: 'select',key: 'paragraph_id',rule: {required: true, message: '请选择标段', trigger: 'change'},props: {'placeholder': '请选择标段',clearable: false},options: [],onInput(value, item, form) {// vm.setOptions(value)vm.formList[1].options =  vm.getSubsectionArr(value)//根据标段获取施工段列表form['subsection_id'] = ''vm.getFormNumber()//改变期号}},{title: '施工段(监理标):',type: 'select',key: 'subsection_id',rule: {required: true, message: '请选择施工段(监理标)', trigger: 'change'},props: {'placeholder': '请选择施工段(监理标)',clearable: false},options: [],onInput(value, item, form) {vm.getFormNumber()//改变期号// vm.formList[2].disabled = false// form['date'] = ''}},{title: '月报期号:',type: 'input',key: 'month_number',rule: {required: true, message: '请输入月报期号', trigger: 'blur'},props: {'placeholder': '请输入月报期号'},onInput(value, item, form) { vm.getFormNumber()//改变期号},// on: {//   blur: function(){ //失去焦点改变期号//     // },},{title: '期号:',type: 'input',key: 'number',disabled: true,props: {'placeholder': '期月报'},},{title: '备注:',type: 'input',key: 'remark',props: {type: 'textarea','placeholder': '请输入备注',autosize: {minRows: 2, maxRows: 8}}},{title: '资料上传:',key: 'enclosure',defaultValue: [],rule: {required: true, message: '请上传资料', trigger: 'blur'},props: {'placeholder': '请上传附件'},renderContent (h, item, form) {return (<xt-newUnload url='data!oamanage/SupervisionMonth/upload' fileList={ form.enclosure } onChange={ res => form.enclosure = res } show-text="支持上传docx/doc/xlsx/xls/PDF/jpg/jpeg/png文件,且不超过100M" accept=".docx,.doc,.xlsx,.xls,.PDF,.jpg,.jpeg,.png" buttonType={vm.title == '详情' ? 'look' : vm.title == '处理' ?'look' : ''}></xt-newUnload>)}},],tableData: [],tableLoading: false,searchForm: {},disabledYear: [],pageForm: {page: 1,pageSize: 20},searchList: [{type: 'xt-form',children: [{title: '标段:',type: 'select',key: 'paragraph_id',props: {placeholder: '请选择标段',clearable: true},options: [],onInput(value, item, form) {vm.searchForm.paragraph_id = valueform['subsection_id'] = ''}},{title: '施工段(监理标):',type: 'select',key: 'subsection_id',props: {placeholder: '请选择施工段(监理标)',clearable: true},options: [],onInput(value, item, form) {vm.searchForm.subsection_id = value// vm.getData()}},{title: '期号:',type: 'input',key: 'keywords',props: {'placeholder': '请输入期号'},},{title: '审批状态:',type: 'select',key: 'status',props: {'placeholder': '请选择审批状态',},options: [{value: 0, text: '待提交'},{value: 1, text: '审批中'},{value: 2, text: '已审批'},{value: 3, text: '已驳回'}],},]}]}
},
computed: {...mapGetters(['currentProject', 'paragraphArr']),
},
watch: {title(v) {if(v == '处理') {this.hasCancle = truethis.hasDraft = falsethis.confirmText = '提交'} else {this.hasCancle = falsethis.hasDraft = truethis.confirmText = '提交审批'}}
},
methods: {changePage (row) {this.pageForm = { ...row }this.getData()},getFormNumber() {let data = this.$refs.xtFormRef.getForm()// if(data.subsection_id == '') returnthis.formList[1].optionslet subsection_name  = data.subsection_id == '' || data.subsection_id == null ? '' : this.formList[1].options.length > 0 ? this.formList[1].options.filter(item => data.subsection_id == item.value)[0].label : '' //拿分部中文// subsection_name = '监理二标'if(subsection_name == '监理二标' && data.month_number == 10) {this.$refs.xtFormRef.setForm({number: '监理'})}else {if(subsection_name == '' && data.month_number == ''){this.$refs.xtFormRef.setForm({number: '期月报'})return}this.$refs.xtFormRef.setForm({number: subsection_name + '第' + data.month_number + '期月报'}) //施工段简称1第15期月报}// let number = subsection_name + '第' + data.month_number + '期月报'},handleDialogClose() {},addFun() {this.title = '新增'this.showfooter = truethis.$refs.dialogRef.open()this.$nextTick(() => {this.getSetting()this.$refs.xtFormRef.reset()})},// 保存草稿handleDraft() {this.btnType = '保存草稿'this.$refs.xtFormRef.submit()},async submit(form, valid) {if(valid) {let users = this.$refs.processRef.$refs.xtFormNext.getForm()let data = {...form}// data.images = this.imageTableData// data.invests = this.investTableDataif (users && users.process_users && users.process_users.length) {// data.process_users = users.process_users.join(',')data.process_users = users.process_users}if (this.title == '编辑') {data.id = this.formDetails.id}if (this.btnType == '提交审批') {// 提交审批逻辑data.action = 'start' //保存草稿传'',如果是提交审批的时候传固定值start}else {data.action = ''}let url = this.title == '新增' ? 'oamanageSupervisionMonth_add' : 'oamanageSupervisionMonth_edit'await this.$api[url](data)this.$success(`${this.btnType == '提交审批' ? '提交审批成功' : '保存草稿成功'}`)this.$refs.dialogRef.handleClose()this.getData()}},async handleConfirm() {if (this.title == '处理') {// 处理确定逻辑let handleData = this.$refs.processRef.$refs.xtFormHandle.getForm()let handleData1 = {}handleData1.status = handleData.handle_statushandleData1.user = handleData.process_usershandleData1.message = handleData.handle_opinionhandleData1.step = handleData.return_link// if (handleData.process_users && handleData.process_users.length) {//   handleData.process_users = handleData.process_users.join(',')// }let data = {...handleData,...handleData1,id: this.formDetails.id}await this.$api.oamanageSupervisionMonth_run(data)this.$success('处理成功')this.$refs.dialogRef.handleClose()this.getData()return}// 提交审批逻辑this.btnType = '提交审批'this.$refs.xtFormRef.submit()},async handleFun(index, row) {this.formDetails = row //this.formDetails.is_end_link = row.last_step //处理中指定流程人员显隐if (index == 0) {// 查看this.title = '详情'this.showfooter = falselet res = await this.$api.oamanageSupervisionMonth_processLog({id: row.id})// this.historyTableData = row.link_list || []this.historyTableData = res.result.map(item => {return {current_link: item.step,handle_opinion: item.opinion,operation_status: item.status,sending_time: item.time,user_name: item.user}}) || []this.$refs.dialogRef.open()this.$nextTick(() => {this.$refs.xtFormRef.reset()this.$refs.xtFormRef.setForm(row)})} else if (index == 1) {// 删除this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(async () => {await this.$api.oamanageSupervisionMonth_del({ids: row.id})this.$success('删除成功')this.getData()})} else if (index == 2) {// 修改this.title = '编辑'this.showfooter = truethis.getSetting()this.$refs.dialogRef.open()// this.formList[2].disabled = false// this.formList[3].disabled = falsethis.$nextTick(() => {this.$refs.xtFormRef.reset()this.$refs.xtFormRef.setForm(row)})} else { // 处理this.title = '处理'this.showfooter = truelet res = await this.$api.oamanageSupervisionMonth_processLog({id: row.id})// this.historyTableData = row.link_list || []this.historyTableData = res.result.map(item => {return {current_link: item.step,handle_opinion: item.opinion,operation_status: item.status,sending_time: item.time,user_name: item.user}}) || []this.$refs.dialogRef.open()this.$nextTick(() => {// this.$refs.processRef.formListHandle[3].isShow = !row.is_end_linkthis.$refs.processRef.formListHandle[3].isShow = !row.last_stepthis.$refs.processRef.formListHandle[4].isShow = falsethis.$refs.processRef.$refs.xtFormHandle.reset()this.getSetting(row.id)})this.$nextTick(() => {this.$refs.xtFormRef.reset()this.$refs.xtFormRef.setForm(row)})}},searchHandle (params) {if(params.paragraph_id == '' && this.searchList[0].children[0].options.length == 1){params.paragraph_id = this.searchList[0].children[0].options[0].value}//仅有一个标段时必选,不可清除this.searchForm = { ...params }this.getData()},async getData() {let data = {...this.searchForm,...this.pageForm}this.tableLoading = truelet res = await this.$api.oamanageSupervisionMonth_list(data)this.tableLoading = falsethis.tableData  = res.result.datathis.total = res.result.total},getSubsectionArr(id) {//根据标段获取施工段列表let arr = this.$getSubsectionAll(id)return arr},setOptions(id) {//搜索 ->标段this.searchList[0].children[0].options = this.paragraphArr//formList ->标段this.formList[0].options = this.paragraphArr// 默认选上标段\施工段if(this.paragraphArr && this.paragraphArr.length === 1) {//仅有一个标段this.$nextTick(() => {this.$refs.formName.$refs.form.setForm({paragraph_id: this.paragraphArr[0].value,})})//筛选-默认标段this.searchForm.paragraph_id = this.paragraphArr[0].value//新增-默认标段this.formList[0].defaultValue = this.paragraphArr[0].valuelet subsectionList = this.getSubsectionArr(this.paragraphArr[0].value)//根据标段获取施工段列表this.searchList[0].children[1].options = subsectionList//搜索 ->施工段this.formList[1].options = subsectionList//新增 ->施工段if(subsectionList && subsectionList.length === 1) {//且仅一个施工段,默认选上施工段this.$nextTick(() => {this.$refs.formName.$refs.form.setForm({subsection_id: subsectionList[0].value})})//筛选默认值-施工段this.searchForm.subsection_id = subsectionList[0].value//新增默认值-施工段this.formList[1].defaultValue = subsectionList[0].value}else {this.searchForm.subsection_id= ''}} //多个标段取全部、一个标段默认选择this.getData()returnif (id) {this.searchList[0].children[1].options = this.$getSubsectionAll(id)this.formList[1].options = this.$getSubsectionAll(id)if (this.searchList[0].children[1].options && this.searchList[0].children[1].options.length) {this.searchForm.subsection_id = this.searchList[0].children[1].options[0].valuethis.$nextTick(() => {this.$refs.formName.$refs.form.setForm({subsection_id: this.searchList[0].children[1].options[0].value})this.formList[1].defaultValue = this.searchList[0].children[1].options[0].valuethis.formList[2].disabled = falselet form = this.$refs.formName.$refs.form.getForm()})}} else {this.searchList[0].children[0].options = this.paragraphArrthis.formList[0].options = this.paragraphArrif (this.paragraphArr && this.paragraphArr.length) {this.searchForm.paragraph_id = this.paragraphArr[0].valuethis.setOptions(this.paragraphArr[0].value)this.$nextTick(() => {this.$refs.formName.$refs.form.setForm({paragraph_id: this.paragraphArr[0].value})this.formList[0].defaultValue = this.paragraphArr[0].value})}}},async getSetting(id) {let data = {}if (id) {data.id = id //数据id,有的时候需要传,没有的时候不传}// this.$refs.processRef.formListNext[0].options = [{user_id: '2', username: '薄华',value: '2', text: '薄华'}]let res = await this.$api.oamanageSupervisionMonth_pserson(data)this.$refs.processRef.formListNext[0].options = res.result.process_revise.map(item => { //指定流程人员return {text: item.real_name,value: item.user_id}})  if (id) {this.$refs.processRef.formListHandle[0].options = res.result.handle_opinion.map((item) => {return {text: item,value: item}})this.$refs.processRef.$refs.xtFormHandle.setForm({advice: this.$refs.processRef.formListHandle[0].options[0].text,handle_opinion: this.$refs.processRef.formListHandle[0].options[0].text})this.$refs.processRef.formListHandle[3].options = res.result.process_revise.map((item) => {return {text: item.real_name,value: item.user_id}})this.$refs.processRef.formListHandle[2].options = res.result.handle_status.map((item) => {return {text: item.name,value: item.status}})this.$refs.processRef.formListHandle[4].options = res.result.return_link.map((item) => {return {text: item.title,value: item.return_link}})}}
},
created() {this.setOptions()
},
mounted() {},
}
</script>
<style scoped lang="scss">
/deep/ .el-tabs__content {display: none;
}
/deep/ .el-upload__tip {line-height: 15px;display: inline-block;
}
.dialogRef {/deep/ .el-input {width: 100% !important;}/deep/ .el-textarea {width: 100% !important;}/deep/ .el-select {width: 100% !important;}
}
.dialogTable {/deep/ .el-input__inner {text-align: center !important;}
}
.operate{span {margin-right: 10px; cursor: pointer;color: #0077FF;}
}
</style>

标段模板、审批流程模板相关推荐

  1. 项目管理系统、工作台、经营看板、质量管理、合同管理、合同审核、新建合同、分包商管理、立项审批、创建项目、项目模板、项目统计、计划管理、结项申请、审批流程、审批记录、审批状态、参数设置、axure原型

    项目管理系统.工作台.经营看板.质量管理.合同管理.合同审核.新建合同.分包商管理.立项审批.创建项目.项目模板.项目统计.计划管理.结项申请.审批流程.审批记录.审批状态.参数设置.axure原型 ...

  2. 机器学习流程模板及多模型对比实战梳理

    机器学习流程模板及多模型对比实战梳理 目录 机器学习流程模板及多模型对比实战梳理 # 数据加载

  3. 制作模板_木模板制作流程

    木模板制作流程: 1.采用松木和桉木.木模板采用马尾松木面板,国产桉木做芯板,板面平整光亮,锯开无空洞,模板周转次数高 . 2.刨制成单板.木模板要求所有单板(无论是芯板还是面板)必须是无破损的一级板 ...

  4. 机器学习(监督学习) 项目流程模板

    流程模板 定义问题 导入类库 导入数据集 用标准Python类库导入 from csv import reader import numpy as np filename = 'http://arch ...

  5. 工作流实战_02_flowable 流程模板导入

    由于群里有些朋友对这个flowable还不是很熟悉,在群里的小伙伴的建议下,师傅(小学生05101)制作一个开源的项目源码,一共大家学习和交流,希望对有帮助,少走弯路 如果有不懂的问题可以入群:633 ...

  6. 基于WF设计业务流程平台_权限在流程模板外部映射

    基于WF设计业务流程平台_权限在流程模板外部映射 前面的几篇文章我介绍了一种权限与流程模板相结合的设计方式,今天我介绍一种权限在流程模板外部映射的计方式. 限在流程模板外部映射,主要的实现思路是: 在 ...

  7. 追加审批人样式html,更新 | 你的审批打印模板真丑!看别人用html模板怎么玩

    更新简报1.html打印模版正式上线,操作更便捷,小白也能快速上手,模板更多样: 2.合同支持打印,无需每次额外制作其他纸质合同留档,一键轻松搞定: 3.选项类控件支持设置对应选项分数,测评结果可以自 ...

  8. java 制作pdf模板,Java-pdf模板制作流程-使用pdf 模板生成pdf文件

    Java 使用pdf 模板生成pdf文件 --制作流程 1.      使用工具 adobe acrobat dc.word 2015 2.      使用 word 繪制一個 3*5 的表格並保存, ...

  9. dedecms模板配置流程

    dedecms模板配置流程 1. 首先需要从AB模板网或模板之家中找到自己想要的模板.AB模板网是有后台,而模板之家是没有后台的,因为以后面向的是客户,所以推荐用AB模板网,可以从中修改自己想要的内容 ...

  10. 《信息化项目文档模板十一——系统运维流程工作流程模板》

    系列文章目录 <信息化项目文档模板一--项目需求说明书> <信息化项目文档模板二--项目启动会文档模板> <信息化项目文档模板三--会议纪要模板> <信息化项 ...

最新文章

  1. rancher添加私有仓库_CocoaPods搭建私有库
  2. 神策数据、阿里、华为、字节等携手推动个人信息保护工作
  3. 220V双向TVS二极管,如何正确选型?
  4. Windows10选择文件打开方式没有始终允许的解决方案
  5. python 规则引擎 drools_Drools规则引擎详解-常用的drl实例
  6. CentOS 7在虚拟机上安装之后没有桌面问题
  7. JavaWeb——jsp原理
  8. Linux之32/64位int、char、int*、char*与空结构体大小
  9. 华硕FX50JK4200安装Win8.1后如何禁用触摸板
  10. 如何实现一个去中心化的 Dropbox 存储
  11. 【复变函数与积分变换】第1章 复数——1.1 复数的定义及其四则运算
  12. 两行代码制作你的专属动态二维码
  13. 计算机学院 储昭坤,关于2016-2017学年先进个人、集体初评结果的公示
  14. 初识Java Bean
  15. python——列表基础操作
  16. Python Pandas的DataFrame对象中轴的意义,axis=0 或者axis=1代表什么意思?
  17. 双正电气变频器说明书_【132G-A3 通用型变频器 高品质变频器】_浙江双正电气有限公司...
  18. 最短路(dijkstrafloyed)
  19. 计算机毕业设计Node.js+Express学生健康管理系统(源码+程序+lw+远程调试)
  20. 如何解决Mac电脑显示的系统时间不准确的问题?

热门文章

  1. 面试官到底想看什么样的简历?
  2. 微信公众号维护用服务器吗,微信公众号商城开发必须用服务器吗?
  3. 复制pdf里的文字,去掉多余换行符的最简单方法(不用word不用python)
  4. 【国土】国土“三调”,用这个方案就对了
  5. chrome浏览器控制台执行js脚本
  6. 商业软件太贵?找开源替代品
  7. 有关java.lang.ClassNotFoundException报错的总结
  8. layui自定义表单验证无效
  9. ISO14001环境管理体系问答篇
  10. 整理农行面试软开最常问到的题---------框架