Bladeren bron

审批表单自定义

guarantee-lsq 2 jaren geleden
bovenliggende
commit
9d5917595f

+ 16 - 0
src/api/customize/fieldTemplate.js

@@ -65,6 +65,22 @@ export function fetchCustomFieldTemplate (parameter) {
   })
 }
 
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchCustomFieldTemplateByRemark (parameter) {
+  return axios({
+    url: '/customize/fieldTemplate/custom/' + parameter.remark,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * query list func
  * parameter: { }

+ 71 - 59
src/api/customize/fieldTemplateData.js

@@ -8,13 +8,13 @@ import { stringify } from 'qs'
  * @returns {*}
  */
 export function getCustomFieldTemplateDataPage (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData/page?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/customize/fieldTemplateData/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -24,15 +24,27 @@ export function getCustomFieldTemplateDataPage (parameter) {
  * @returns {*}
  */
 export function addCustomFieldTemplateData (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData',
-        method: 'POST',
-        headers: {
-            'Accept': 'application/json',
-            'Content-Type': 'application/json;charset=UTF-8'
-        },
-        data: parameter
-    })
+  return axios({
+    url: '/customize/fieldTemplateData',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+export function addCustomFieldTemplateDataForm (parameter) {
+  return axios({
+    url: '/customize/fieldTemplateData/form',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
 }
 
 /**
@@ -41,12 +53,12 @@ export function addCustomFieldTemplateData (parameter) {
  * @param parameter
  * @returns {*}
  */
-export function updateCustomFieldTemplateData (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData/' + parameter.id,
-        method: 'PUT',
-        data: parameter
-    })
+export function updateCustomFieldTemplateData(parameter) {
+  return axios({
+    url: '/customize/fieldTemplateData/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
 }
 
 /**
@@ -56,13 +68,13 @@ export function updateCustomFieldTemplateData (parameter) {
  * @returns {*}
  */
 export function fetchCustomFieldTemplateData (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData/' + parameter.id,
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/customize/fieldTemplateData/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -71,14 +83,14 @@ export function fetchCustomFieldTemplateData (parameter) {
  * @param parameter
  * @returns {*}
  */
-export function queryCustomFieldTemplateData (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+export function queryCustomFieldTemplateData(parameter) {
+  return axios({
+    url: '/customize/fieldTemplateData?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -87,12 +99,12 @@ export function queryCustomFieldTemplateData (parameter) {
  * @param parameter
  * @returns {*}
  */
-export function deleteCustomFieldTemplateDatas (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData',
-        method: 'DELETE',
-        data: parameter
-    })
+export function deleteCustomFieldTemplateDatas(parameter) {
+  return axios({
+    url: '/customize/fieldTemplateData',
+    method: 'DELETE',
+    data: parameter
+  })
 }
 
 /**
@@ -101,12 +113,12 @@ export function deleteCustomFieldTemplateDatas (parameter) {
  * @param parameter
  * @returns {*}
  */
-export function deleteCustomFieldTemplateData (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData/' + parameter.id,
-        method: 'DELETE',
-        data: parameter
-    })
+export function deleteCustomFieldTemplateData(parameter) {
+  return axios({
+    url: '/customize/fieldTemplateData/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
 }
 
 
@@ -114,15 +126,15 @@ export function deleteCustomFieldTemplateData (parameter) {
  * export file
  * parameter: { }
  * @param parameter :
- * @returns {*}
+  * @returns {*}
  */
-export function exportCustomFieldTemplateData (parameter) {
-    return axios({
-        url: '/customize/fieldTemplateData/export?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        },
-        responseType: 'blob'
-    })
+export function exportCustomFieldTemplateData(parameter) {
+  return axios({
+    url: '/customize/fieldTemplateData/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
 }

+ 13 - 0
src/utils/dict.js

@@ -352,6 +352,19 @@ DictCache.VALUE = {
     DISPATCH: '2'
   },
 
+  /**
+   * 自定义模板之设备备注
+   */
+  CUSTOM_TEMPLATE_SB_REMARK: {
+    SB_SCRAP_FORM: 'SB_SCRAP_FORM',
+    SB_TRANSFER_FORM: 'SB_TRANSFER_FORM'
+  },
+  CUSTOM_TEMPLATE_SB_REMARK_NUMBER: {
+    SB_FIELD_TYPE: 1,
+    SPARE_FIELD_TYPE: 2,
+    ACTIVITY_FORM: 3
+  },
+
   /**
    * 明细类型
    */

+ 57 - 4
src/views/activiti/task/MyStart.vue

@@ -44,6 +44,7 @@ import AssignForm from './modules/AssignForm'
 import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
 import { getTaskPageStart } from '@/api/activiti/activiti'
 import { fetchSbScrapForm } from '@/api/sb/scraps'
+import { getCustomFieldTemplateDataPage } from '@/api/customize/fieldTemplateData'
 
 export default {
   name: 'TaskList',
@@ -58,6 +59,7 @@ export default {
       mdl: {},
       // 查询参数
       queryParam: {
+        type: this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK_NUMBER.ACTIVITY_FORM
       },
       // 表头
       columns: [
@@ -68,7 +70,7 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
-        {
+        /*{
           title: '类型',
           dataIndex: 'targetCode',
           customRender: (text, record, index) => {
@@ -90,6 +92,51 @@ export default {
         {
           title: '创建时间',
           dataIndex: 'applyTime'
+        },*/
+        {
+          title: '类型',
+          dataIndex: 'remark',
+          customRender: (text, record, index) => {
+            if (text === 'supplier') {
+              return '供应商审批'
+            } else if (text === 'SB_SCRAP_FORM') {
+              return '设备报废审批'
+            }
+          }
+        },
+        {
+          title: '任务名称',
+          dataIndex: 'remark',
+          customRender: (text, record, index) => {
+            if (text === 'supplier') {
+              return '供应商审批'
+            } else if (text === 'SB_SCRAP_FORM') {
+              return '设备报废审批'
+            }
+          }
+        },
+        {
+          title: '申请人',
+          dataIndex: 'createdUserName'
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '状态',
+          dataIndex: 'status',
+          customRender: (text, record, index) => {
+            if (text === 1) {
+              return '待提交'
+            } else if (text === 2) {
+              return '审核中'
+            } else if (text === 3) {
+              return '已完成'
+            } else if (text === 4) {
+              return '已拒绝'
+            }
+          }
         },
         {
           title: '操作',
@@ -101,10 +148,14 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return getTaskPageStart(Object.assign(parameter, this.queryParam))
+        return getCustomFieldTemplateDataPage(Object.assign(parameter, this.queryParam))
           .then(res => {
             return res.data
           })
+        /*return getTaskPageStart(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })*/
       },
       selectedRowKeys: [],
       selectedRows: [],
@@ -151,11 +202,13 @@ export default {
     },
     handleView (record) {
       this.visible = false
-      if (record.targetCode === 'sb_info_scrap') {
+      /*if (record.targetCode === 'sb_info_scrap') {
         fetchSbScrapForm({ id: record.targetId }).then(res => {
           this.$refs.detailAuditScrapModal.base(record, res.data)
         })
-      }
+      }*/
+      const templateData = JSON.parse(record.data)
+      this.$refs.detailAuditScrapModal.base(record, templateData)
     },
     handleOk () {
       this.visible = true

+ 7 - 2
src/views/activiti/task/MyTask.vue

@@ -47,6 +47,7 @@ import AssignForm from './modules/AssignForm'
 import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
 import { getTaskPage } from '@/api/activiti/activiti'
 import { fetchSbScrapForm } from '@/api/sb/scraps'
+import { fetchCustomFieldTemplateData } from '@/api/customize/fieldTemplateData'
 
 export default {
   name: 'TaskList',
@@ -154,11 +155,15 @@ export default {
     },
     handleAudit (record) {
       this.visible = false
-      if (record.targetCode === 'sb_info_scrap') {
+      /*if (record.targetCode === 'sb_info_scrap') {
         fetchSbScrapForm({ id: record.targetId }).then(res => {
           this.$refs.detailAuditScrapModal.base(record, res.data)
         })
-      }
+      }*/
+      fetchCustomFieldTemplateData({ id: record.targetId }).then(res => {
+        const templateData = JSON.parse(res.data.data)
+        this.$refs.detailAuditScrapModal.base(record, templateData)
+      })
     },
     handleChange (record) {
       this.$refs.assignForm.base(record)

+ 7 - 2
src/views/activiti/task/MyTaskFinish.vue

@@ -44,6 +44,7 @@ import AssignForm from './modules/AssignForm'
 import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
 import { getTaskPageFinish } from '@/api/activiti/activiti'
 import { fetchSbScrapForm } from '@/api/sb/scraps'
+import { fetchCustomFieldTemplateData } from '@/api/customize/fieldTemplateData'
 
 export default {
   name: 'TaskList',
@@ -151,11 +152,15 @@ export default {
     },
     handleView (record) {
       this.visible = false
-      if (record.targetCode === 'sb_info_scrap') {
+      /*if (record.targetCode === 'sb_info_scrap') {
         fetchSbScrapForm({ id: record.targetId }).then(res => {
           this.$refs.detailAuditScrapModal.base(record, res.data)
         })
-      }
+      }*/
+      fetchCustomFieldTemplateData({ id: record.targetId }).then(res => {
+        const templateData = JSON.parse(res.data.data)
+        this.$refs.detailAuditScrapModal.base(record, templateData)
+      })
     },
     handleOk () {
       this.visible = true

+ 1 - 0
src/views/customize/fieldTemplate/modules/BaseForm.vue

@@ -275,6 +275,7 @@ export default {
       if (!find) {
         dataSource.push(values)
       }
+      this.data = dataSource
     },
     handleDelParam (fieldName) {
       const dataSource = [...this.data]

+ 8 - 0
src/views/customize/fieldTemplate/modules/Detail.vue

@@ -138,6 +138,14 @@ export default {
           dataIndex: 'maxLength',
           width: 150
         },
+        {
+          title: 'disabledFlag',
+          dataIndex: 'disabledFlag',
+          width: 90,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.yesNoMap, text)
+          }
+        },
         {
           title: '操作',
           key: 'action',

+ 18 - 0
src/views/customize/fieldTemplate/modules/ParamForm.vue

@@ -104,6 +104,24 @@
               v-decorator="['maxLength', {rules: [{required: true, message: '不能为空'}]}]"/>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="是否disabled"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select
+              v-decorator="['disabledFlag', {rules: [{required: true, message: 'disabled不能为空'}]}]"
+              placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in yesNoMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="默认值"

+ 26 - 9
src/views/sb/scraps/SbScrapForm.vue

@@ -114,6 +114,7 @@
     </div>
     <base-form ref="baseModal" @ok="handleOk" />
     <detail ref="detailModal" @ok="handleOk" />
+    <sb-custom-form-view ref='showCustomView' @ok='handleOk'/>
 <!--    <image-modal ref="imageModal"/>-->
 <!--    <history-table ref="historyModal"/>-->
   </a-card>
@@ -125,8 +126,11 @@ import BaseForm from './modules/BaseForm'
 import Detail from './modules/Detail'
 import ImageModal from '@/views/activiti/ImageModal'
 import HistoryTable from '@/views/activiti/HistoryTable'
+import { fetchCustomFieldTemplateByRemark } from '@/api/customize/fieldTemplate'
+import SbCustomFormView from './modules/SbCustomFormView'
 import { getSbScrapFormPage, deleteSbScrapForms, fetchSbScrapForm, exportSbScrapForm } from '@/api/sb/scraps'
 import { startSbInfoScrap, stopSbInfoScrapForAudit } from '@/api/activiti/activiti-sb-scrap'
+import { getCustomFieldTemplateDataPage } from '@/api/customize/fieldTemplateData'
 
 export default {
   name: 'SbScrapFormList',
@@ -134,16 +138,19 @@ export default {
     STable,
     Ellipsis,
     BaseForm,
-    Detail,
     ImageModal,
-    HistoryTable
+    HistoryTable,
+    SbCustomFormView
   },
   data () {
     return {
       advanced: false,
       visible: true,
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        type: this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK_NUMBER.ACTIVITY_FORM,
+        remark: this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_SCRAP_FORM
+      },
       // 表头
       columns: [
         {
@@ -171,7 +178,7 @@ export default {
         },
         {
           title: '备注',
-          dataIndex: 'remark'
+          dataIndex: 'dataRemark'
         },
         {
           title: '状态',
@@ -182,7 +189,7 @@ export default {
         },
         {
           title: '申请人',
-          dataIndex: 'applyUserName'
+          dataIndex: 'createdUserName'
         },
         {
           title: '创建日期',
@@ -208,7 +215,7 @@ export default {
             sortName: 'update_time'
           }
         }
-        return getSbScrapFormPage(Object.assign(parameter, this.queryParam))
+        return getCustomFieldTemplateDataPage(Object.assign(parameter, this.queryParam))
           .then(res => {
             return res.data
           })
@@ -285,9 +292,15 @@ export default {
       })
     },
     handleAdd () {
-      this.visible = false
+      /*this.visible = false
       const modal = this.$refs.baseModal
-      modal.base()
+      modal.base()*/
+      this.visible = false
+      const params = { remark: this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_SCRAP_FORM }
+      fetchCustomFieldTemplateByRemark(params).then(res => {
+        const modal = this.$refs.showCustomView
+        modal.base(res.data.content)
+      })
     },
     handleEdit (record) {
       this.visible = false
@@ -322,7 +335,11 @@ export default {
       })
     },
     handleStart (record) {
-      startSbInfoScrap({ id: record.id, processInstanceId: record.processInstanceId }).then(res => {
+      const templateData = JSON.parse(record.data)
+      if (templateData.processInstanceId === undefined) {
+        templateData.processInstanceId = ''
+      }
+      startSbInfoScrap({ id: record.id, processInstanceId: templateData.processInstanceId }).then(res => {
         this.$message.info(res.data)
         this.handleEnter()
       })

+ 2 - 1
src/views/sb/scraps/modules/DetailAudit.vue

@@ -86,8 +86,9 @@ export default {
       this.modalTitle = '详情'
       this.task = record
       this.model = model
+      model.id = record.targetId // 将targetId赋给model,带入history,用作提交
       const modal = this.$refs.history
-      modal.base(model, this.task.id)
+      modal.base(model, this.task.taskId)
     },
     handleCancel () {
       this.visible = false

+ 196 - 0
src/views/sb/scraps/modules/SbCustomFormView.vue

@@ -0,0 +1,196 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+    @ok='save'
+  >
+    <a-form :form="form">
+      <row-list :col="1">
+        <row-item v-for="(item, index) in data" :key="index">
+          <a-form-item
+            v-show='hiddenFlag'
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-if="item.type === 5"
+            :label="item.label">
+            <a-input v-decorator="[item.fieldName]"/>
+          </a-form-item>
+          <a-form-item
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-if="item.type === 1 && item.disabledFlag === '0'"
+            :label="item.label">
+            <a-input v-decorator="[item.fieldName, {initialValue: item.value, rules: [{required: item.required, message: '不能为空'}]}]"/>
+          </a-form-item>
+          <a-form-item
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-if="item.type === 1 && item.disabledFlag === '1'"
+            :label="item.label">
+            <a-input disabled='disabled' v-decorator="[item.fieldName, {initialValue: item.value, rules: [{required: item.required, message: '不能为空'}]}]"/>
+          </a-form-item>
+          <a-form-item
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-if="item.type === 2"
+            :label="item.label">
+            <a-select
+              v-decorator="[item.fieldName, {initialValue: item.value, rules: [{required: item.required, message: '不能为空'}]}]"
+              style="width: 120px"
+            >
+              <a-select-option
+                v-for="option in item.optionList"
+                :key="option.name"
+                :label="option.name"
+                :value="option.value">{{ option.name }}</a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-if="item.type === 3"
+            :label="item.label">
+            <a-date-picker
+              v-decorator="[item.fieldName, {initialValue: item.value, rules: [{required: item.required, message: '不能为空'}]}]"
+              style="width: 100%"
+            />
+          </a-form-item>
+          <a-form-item
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-if="item.type === 4"
+            :label="item.label">
+            <a-input
+              style="width: 70%"
+              disabled
+              v-decorator="['sbName', {rules: [{required: true, message: '设备不能为空'}]}]" />
+            <a-input type='hidden' v-decorator="['sbId']" />
+            <a-button style="width: 30%" type="primary" @click="sbInfoHandleSelect">选择</a-button>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <sb-info-select-modal ref="sbInfoSelectModal" @selected="sbInfoHandleSelected"/>
+  </a-modal>
+</template>
+
+<script>
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+import { addCustomFieldTemplate, updateCustomFieldTemplate } from '@/api/customize/fieldTemplate'
+import { addCustomFieldTemplateDataForm } from '@/api/customize/fieldTemplateData'
+
+export default {
+  name: 'SbCustomFormView',
+  components: {
+    SbInfoSelectModal
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      model: null,
+      data: [],
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      typeMap: {},
+      typeFieldMap: {},
+      hiddenFlag: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CUSTOM_FIELD_TEMPLATE_TYPE)
+    this.typeFieldMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CUSTOM_FIELD_TEMPLATE_FILED_TYPE)
+  },
+  methods: {
+    base (data) {
+      this.visible = true
+      this.modalTitle = '设备报废单'
+      this.data = JSON.parse(data)
+    },
+    setData (values) {
+      const dataList = [...this.data]
+      dataList.forEach((item) => {
+        if (item.type !== 4) {
+          item.value = values[item.fieldName]
+        }
+      })
+      return dataList
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.model = null
+      this.data = []
+      this.form.resetFields()
+      this.$emit('ok', JSON.stringify(values))
+    },
+    handleOk (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.model = null
+      this.data = []
+      this.form.resetFields()
+      this.$emit('ok', JSON.stringify(values))
+    },
+    sbInfoHandleSelect () {
+      this.$refs.sbInfoSelectModal.base({}, {})
+    },
+    sbInfoHandleSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'sbId': key,
+          'sbNo': row.no,
+          'sbName': row.name,
+          'initialValue': row.initialValue,
+          'currentValue': row.currentValue,
+          'startDate': row.startDate,
+          'workYear': row.workYear,
+          'id': ''
+        }))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        const content = JSON.stringify(values)
+        const obj = {}
+        obj.type = this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK_NUMBER.ACTIVITY_FORM
+        obj.objId = values.sbId
+        obj.data = content
+        obj.remark = this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_SCRAP_FORM
+        // 日期处理
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addCustomFieldTemplateDataForm(obj)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateCustomFieldTemplate(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    }
+  }
+}
+</script>