lyh
2025-01-23 b16561838a0e9120dd16ded16cfe2f729f0d2ccc
NC程序签派流程配置
已添加4个文件
575 ■■■■■ 文件已修改
src/views/dnc/base/ActivitiSingExamineList.vue 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineForm.vue 216 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal__Style#Drawer.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/ActivitiSingExamineList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,203 @@
<!--
 Description: NC程序签派流程配置 List
 Author: ä½œè€… liuyh
 Date:   2025-01-15
-->
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程名称">
              <a-input placeholder="输入流程名称" v-model="queryParam.actName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <ActivitiSignExamineModal ref="modalForm" @ok="modalFormOk"></ActivitiSignExamineModal>
  </a-card>
</template>
<script>
import '@assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@comp/dict/JDictSelectTag.vue'
import ActivitiSignExamineModal from './modules/ActivitiSingExamine/ActivitiSignExamineModal__Style#Drawer.vue'
export default {
  name: 'AssignApproveUser',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    JDictSelectTag,
    ActivitiSignExamineModal
  },
  data () {
    return {
      description: 'NC程序签派流程配置',
      // è¡¨å¤´
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key:'rowIndex',
          width:200,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title: '流程名称',
          align: "center",
          dataIndex: 'actName',
          width: 200,
        },
        {
          title: '所属部门',
          align: "center",
          dataIndex: 'departId_dictText',
          width: 220,
        },
        {
          title: '校对人员',
          align: "center",
          dataIndex: 'proofreaderUser_dictText',
          width: 250,
        },
        {
          title: '批准人员',
          align: "center",
          dataIndex: 'approveUser_dictText',
          width: 250,
        },
        {
          title: '试切人员',
          align: "center",
          dataIndex: 'cutterUser_dictText',
          width: 250,
        },
        {
          title: '定型人员',
          align: "center",
          dataIndex: 'typecastUser_dictText',
          width: 250,
        },
        {
          title: '操作时间',
          align: "center",
          dataIndex: 'createTime',
          width:300
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: 'center',
          width: 200,
          fixed: 'right'
        }
      ],
      url: {
        list: "/nc/activitiSignExamine/find/page",
        delete: "/nc/activitiSignExamine/delete",
      },
      dictOptions:{},
    }
  },
  created() {
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    },
  },
  methods: {
    initDictConfig(){
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,216 @@
<!--
 Description: NC程序签派流程配置 Form
 Author: ä½œè€… liuyh
 Date:   2025-01-15
-->
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form :form="form" slot="detail">
        <a-row>
          <a-col :span="24">
            <a-form-item label="流程名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="formDisabled" v-decorator="['actName', validatorRules.actName]" placeholder="请输入流程名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="所属部门" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag :disabled="formDisabled" type="list" v-decorator="['departId']" :trigger-change="true" dictCode="sys_department,depart_name,depart_id" placeholder="请选择所属部门"/>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="校对人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-select-multi-user valueKey="id" displayKey="realname" v-decorator="['proofreaderUser']"  placeholder="请选择审批人"/>
              {{ getFormFieldValue('proofreaderUser') }}
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="批准人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-select-multi-user valueKey="id" displayKey="realname" v-decorator="['approveUser']"  placeholder="请选择审批人"/>
              {{ getFormFieldValue('approveUser') }}
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="试切人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-select-multi-user valueKey="id" displayKey="realname" v-decorator="['cutterUser']"  placeholder="请选择审批人"/>
              {{ getFormFieldValue('cutterUser') }}
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="定型人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-select-multi-user valueKey="id" displayKey="realname" v-decorator="['typecastUser']"  placeholder="请选择审批人"/>
              {{ getFormFieldValue('typecastUser') }}
            </a-form-item>
          </a-col>
          <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
            <a-button @click="submitForm">提 äº¤</a-button>
          </a-col>
        </a-row>
      </a-form>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { httpAction, getAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import JFormContainer from '@/components/jeecg/JFormContainer'
  import JDictSelectTag from "@/components/dict/JDictSelectTag"
  export default {
    name: 'ActivitiSignExamineForm',
    components: {
      JFormContainer,
      JDictSelectTag,
    },
    props: {
      //流程表单data
      formData: {
        type: Object,
        default: ()=>{},
        required: false
      },
      //表单模式:true流程表单 false普通表单
      formBpm: {
        type: Boolean,
        default: false,
        required: false
      },
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        form: this.$form.createForm(this),
        users:"",
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
          actName: {
            rules: [
              { required: true, message: '请输入流程名称!'},
            ]
          },
          departId: {
            rules: [
              { required: true, message: '请选择部门分组!'},
            ]
          },
          approveUsers: {
            rules: [
              { required: true, message: '请选择审批人!'},
            ]
          },
          characters: {
            rules: [
              { required: true, message: '请输入特殊字符!'},
            ]
          },
        },
        url: {
          add: "/nc/activitiSignExamine/add",
          edit: "/nc/activitiSignExamine/edit",
          // queryById: "/zhshj/wglltwh/query/by/id"
        },
        userOptions:[]
      }
    },
    computed: {
      formDisabled(){
        if(this.formBpm===true){
          if(this.formData.disabled===false){
            return false
          }
          return true
        }
        return this.disabled
      },
      showFlowSubmitButton(){
        if(this.formBpm===true){
          if(this.formData.disabled===false){
            return true
          }
        }
        return false
      }
    },
    created () {
      //如果是流程中表单,则需要加载流程表单data
      this.showFlowData();
    },
    methods: {
      add () {
        this.edit({});
      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'actName','departId','approveUsers'))
        })
      },
      getFormFieldValue(field){
        return this.form.getFieldValue(field)
      },
      //渲染流程表单数据
      showFlowData(){
        if(this.formBpm === true){
          let params = {id:this.formData.dataId};
          getAction(this.url.queryById,params).then((res)=>{
            if(res.success){
              this.edit (res.result);
            }
          });
        }
      },
      submitForm () {
        const that = this;
        // è§¦å‘表单验证
        this.form.validateFields((err, values) => {
          if (!err) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            let formData = Object.assign(this.model, values);
            console.log("表单提交数据",formData)
            httpAction(httpurl,formData,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }
        })
      },
      popupCallback(row){
        this.form.setFieldsValue(pick(row,'actName','departId','approveUsers'))
      },
    }
  }
</script>
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
<!--
 Description: NC程序签派流程配置 Modal
 Author: ä½œè€… liuyh
 Date:   2025-01-15
-->
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <ActivitiSignExamineForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></ActivitiSignExamineForm>
  </j-modal>
</template>
<script>
  import ActivitiSignExamineForm from './ActivitiSignExamineForm.vue'
  export default {
    name: 'AssignApproveUserModal',
    components: {
      ActivitiSignExamineForm
    },
    data () {
      return {
        title:'',
        width:800,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.submitForm();
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
src/views/dnc/base/modules/ActivitiSingExamine/ActivitiSignExamineModal__Style#Drawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
<!--
 Description: NC程序签派流程配置 Modal-Drawer
 Author: ä½œè€… liuyh
 Date:   2025-01-15
-->
<template>
  <a-drawer
    :title="title"
    :width="width"
    placement="right"
    :closable="false"
    @close="close"
    destroyOnClose
    :visible="visible">
    <ActivitiSignExamineForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></ActivitiSignExamineForm>
    <div class="drawer-footer">
      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
    </div>
  </a-drawer>
</template>
<script>
import ActivitiSignExamineForm from './ActivitiSignExamineForm.vue'
export default {
  name: 'AssignApproveUserModal',
  components: {
    ActivitiSignExamineForm,
  },
  data() {
    return {
      title: "操作",
      width: 800,
      visible: false,
      disableSubmit: false
    }
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add();
      })
    },
    edit(record) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record);
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    submitCallback() {
      this.$emit('ok');
      this.visible = false;
    },
    handleOk() {
      this.$refs.realForm.submitForm();
    },
    handleCancel() {
      this.close()
    }
  }
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
  margin-left: 30px;
  margin-bottom: 30px;
  float: right;
}
.drawer-footer{
  position: absolute;
  bottom: -8px;
  width: 100%;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: right;
  left: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>