zhaowei
2025-01-21 26bf11018b2b145942631421c7e634c5df91aea6
Merge remote-tracking branch 'origin/master'
已添加5个文件
已修改2个文件
819 ■■■■■ 文件已修改
src/views/dnc/base/WorkUpcomingList.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalForm.vue 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingForm.vue 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal__Style#Drawer.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/WorkUpcomingList.vue
@@ -33,11 +33,15 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button type="primary" @click="searchQuery" icon="search">刷新</a-button>
<!--      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
      <a-button @click="handleAdd" type="primary" icon="plus">批量审核</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
@@ -49,6 +53,7 @@
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
@@ -73,33 +78,17 @@
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a @click="handleApproval(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>
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
    <AssignApproveUserModal ref="modalForm" @ok="modalFormOk"></AssignApproveUserModal>
    <WorkUpcomingModal ref="modalForm" @ok="modalFormOk"></WorkUpcomingModal>
    <WorkUpcomingApprovalModal ref="modalFormApproval" @ok="modalFormOk"></WorkUpcomingApprovalModal>
  </a-card>
</template>
@@ -109,14 +98,15 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@comp/dict/JDictSelectTag.vue'
import AssignApproveUserModal from './modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue'
import WorkUpcomingModal from './modules/WorkUpcoming/WorkUpcomingModal__Style#Drawer.vue'
import WorkUpcomingApprovalModal from './modules/WorkUpcoming/WorkUpcomingApprovalModal.vue'
export default {
  name: 'AssignApproveUser',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    JDictSelectTag,
    AssignApproveUserModal
    WorkUpcomingModal,
    WorkUpcomingApprovalModal
  },
  data () {
    return {
@@ -134,58 +124,28 @@
          }
        },
        {
          title: '产品名称',
          title: '文档名称',
          align: "center",
          dataIndex: 'productName',
          dataIndex: 'assignFileStream.docName',
          width: 200,
        },
        {
          title: '部件名称',
          align: "center",
          dataIndex: 'componentName',
          dataIndex: 'assignFileStream.deviceName',
          width: 220,
        },
        {
          title: '零件名称',
          align: "center",
          dataIndex: 'partsName',
          width: 250,
        },
        {
          title: '文档名称',
          align: "center",
          dataIndex: 'docName',
          width: 250,
        },
        {
          title: '设备名称',
          align: "center",
          dataIndex: 'deviceName',
          width: 250,
        },
        {
          title: '文档版本',
          align: "center",
          dataIndex: 'version',
          dataIndex: 'assignFileStream.version',
          width: 250,
        },
        {
          title: '申请人',
          title: '密级',
          align: "center",
          dataIndex: 'applyUser_dictText',
          width:300
        },
        {
          title: '申请原因',
          align: "center",
          dataIndex: 'applyReason',
          width:300
        },
        {
          title: '申请时间',
          align: "center",
          dataIndex: 'applyTime',
          width:300
          dataIndex: 'assignFileStream.secretLevel',
          width: 250,
        },
        {
          title: '操作',
@@ -212,6 +172,11 @@
  },
  methods: {
    initDictConfig(){
    },
    handleApproval(record){
      this.$refs.modalFormApproval.edit(record);
      this.$refs.modalFormApproval.title = "审批";
      this.$refs.modalFormApproval.disableSubmit = false;
    }
  }
}
src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue
@@ -18,7 +18,7 @@
              <a-input  v-decorator="['componentName', validatorRules.componentName]" placeholder="请输入部件名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
          <a-col :span="24" v-if="part">
            <a-form-item label="零件名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['partsName', validatorRules.partsName]" placeholder="请输入零件名称"></a-input>
            </a-form-item>
@@ -171,7 +171,8 @@
          edit: "/nc/definition/edit",
          // queryById: "/zhshj/wglltwh/query/by/id"
        },
        userOptions:[]
        userOptions:[],
        part:false,
      }
    },
    computed: {
@@ -205,6 +206,9 @@
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        if (record.partsName){
          this.part=true
        }
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'productName','componentName','partsName','docName','deviceName','version','applyUser','applyReason','applyTime','approveUser','approveTime','approveContent'))
        })
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,237 @@
<!--
 Description: æˆ‘的工作台-代办-详情 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  v-decorator="['assignFileStream.docName', validatorRules.docName]" :disabled="true" placeholder="请输入文档名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="文档版本" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.version', validatorRules.version]" :disabled="true" placeholder="请输入文档版本"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.applyUser', validatorRules.applyUser]" :disabled="true" placeholder="请输入申请人"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="申请原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-textarea v-decorator="['assignFileStream.applyReason']" rows="4" :disabled="true" placeholder="请输入申请原因"/>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="密级为" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag placeholder="请选择密级"  style="width:100%" :trigger-change="true" v-decorator="['secretLevel']" dictCode="dnc_secret_level"/>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="同意导入工控网" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-checkbox v-model="isAgreed">同意导入工控网</a-checkbox>
            </a-form-item>
          </a-col>
          <a-col :span="24" >
            <a-form-item label="审批状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-select placeholder="审批状态">
                <a-select-option v-if="isAgreed" value="1">同意</a-select-option>
                <a-select-option v-if="!isAgreed" value="2">拒绝</a-select-option>
              </a-select>
<!--              <j-dict-select-tag  placeholder="请选择审批状态"  style="width:100%" :trigger-change="true" v-decorator="['status', validatorRules.status]" dictCode="dnc_assign_stream_status"/>-->
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="审批意见" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-textarea v-decorator="['assignFileStream.approveContent', validatorRules.approveContent]" rows="4" placeholder="请输入审批意见"/>
            </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: 'AssignApproveUserForm',
    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:"",
        isAgreed:true,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
          version: {
            rules: [
              { required: true, message: '请输入文档版本!'},
            ]
          },
          applyUser: {
            rules: [
              { required: true, message: '请选择申请人!'},
            ]
          },
          approveContent: {
            rules: [
              { required: true, message: '请输入审批意见!'},
            ]
          },
          docName: {
            rules: [
              { required: true, message: '请输入文档名称!'},
            ]
          },
          status: {
            rules: [
              { required: true, message: '请选择审批状态!'},
            ]
          },
        },
        url: {
          add: "/nc/definition/add",
          edit: "/nc/definition/edit",
          approve:"/nc/activit/assign/file/approve",
          // queryById: "/zhshj/wglltwh/query/by/id"
        },
        userOptions:[],
        part:false,
        taskId:"",
        streamId:"",
      }
    },
    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.taskId=record.id;
        this.streamId=record.businessKey;
        if (record.assignFileStream.partsName){
          this.part=true
        }
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'assignFileStream'))
        })
      },
      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 url=this.url.approve+"/"+this.taskId+"/"+this.streamId;
            let method = 'post';
            let formData = {};
            formData.approveContent = values.assignFileStream.approveContent;
            if (this.isAgreed){
              formData.status ='2'
            }else {
              formData.status ='3'
            }
            console.log("表单提交数据",formData)
            httpAction(url,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;
            })
          }
        })
      },
    }
  }
</script>
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingApprovalModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
<!--
 Description: æˆ‘的工作台-代办 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="关闭">
    <WorkUpcomingApprovalForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></WorkUpcomingApprovalForm>
  </j-modal>
</template>
<script>
  import WorkUpcomingApprovalForm from './WorkUpcomingApprovalForm.vue'
  export default {
    name: 'AssignApproveUserModal',
    components: {
      WorkUpcomingApprovalForm
    },
    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/WorkUpcoming/WorkUpcomingForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,266 @@
<!--
 Description: æˆ‘的工作台-代办-详情 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  v-decorator="['assignFileStream.productName', validatorRules.productName]" placeholder="请输入产品名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.componentName', validatorRules.componentName]" placeholder="请输入部件名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24" v-if="part">
            <a-form-item label="零件名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.partsName', validatorRules.partsName]" placeholder="请输入零件名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="文档名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.docName', validatorRules.docName]" placeholder="请输入文档名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.deviceName', validatorRules.deviceName]" placeholder="请输入设备名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="文档版本" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.version', validatorRules.version]" placeholder="请输入文档版本"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.applyUser', validatorRules.applyUser]" placeholder="请输入申请人"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="申请原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.applyReason', validatorRules.applyReason]" placeholder="请输入申请原因"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="申请时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.applyTime', validatorRules.applyTime]" placeholder="请输入申请时间"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="审批人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.approveUser', validatorRules.approveUser]" placeholder="请输入审批人"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="审批时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  v-decorator="['assignFileStream.approveTime', validatorRules.approveTime]" placeholder="请输入审批时间"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="审批意见" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-textarea v-decorator="['assignFileStream.approveContent']" rows="4" placeholder="请输入审批意见"/>
            </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: 'AssignApproveUserForm',
    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: {
            productName: [
              { required: true, message: '请输入流程名称!'},
            ]
          },
          componentName: {
            rules: [
              { required: true, message: '请选择部门分组!'},
            ]
          },
          partsName: {
            rules: [
              { required: true, message: '请选择审批人!'},
            ]
          },
          docName: {
            rules: [
              { required: true, message: '请输入特殊字符!'},
            ]
          },
          deviceName: {
            rules: [
              { required: true, message: '请输入特殊字符!'},
            ]
          },
          version: {
            rules: [
              { required: true, message: '请输入特殊字符!'},
            ]
          },
          applyUser: {
            rules: [
              { required: true, message: '请输入特殊字符!'},
            ]
          },
          applyReason: {
            rules: [
              { required: true, message: '请输入特殊字符!'},
            ]
          },
        },
        url: {
          add: "/nc/definition/add",
          edit: "/nc/definition/edit",
          // queryById: "/zhshj/wglltwh/query/by/id"
        },
        userOptions:[],
        part:false,
      }
    },
    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);
        if (record.assignFileStream.partsName){
          this.part=true
        }
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'assignFileStream'))
        })
      },
      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,'C'))
      },
    }
  }
</script>
src/views/dnc/base/modules/WorkUpcoming/WorkUpcomingModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
<!--
 Description: æˆ‘的工作台-代办 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="关闭">
    <WorkUpcomingForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></WorkUpcomingForm>
  </j-modal>
</template>
<script>
  import WorkUpcomingForm from './WorkUpcomingForm.vue'
  export default {
    name: 'AssignApproveUserModal',
    components: {
      WorkUpcomingForm
    },
    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/WorkUpcoming/WorkUpcomingModal__Style#Drawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
<!--
 Description: æˆ‘的工作台-代办 Modal-Drawer
 Author: ä½œè€… liuyh
 Date:   2025-01-15
-->
<template>
  <a-drawer
    :title="title"
    :width="width"
    placement="right"
    :closable="false"
    @close="close"
    destroyOnClose
    :visible="visible">
    <WorkUpcomingForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></WorkUpcomingForm>
    <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 WorkUpcomingForm from './WorkUpcomingForm.vue'
export default {
  name: 'AssignApproveUserModal',
  components: {
    WorkUpcomingForm,
  },
  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>