hfxc226 2 år sedan
förälder
incheckning
e637ddb99f

+ 15 - 1
src/api/activiti/activiti-sb-scrap.js

@@ -57,7 +57,7 @@ export function historySbInfoScrapForAudit (parameter) {
 }
 
 /**
- * update func 审批开始
+ * update func 转签
  * parameter: { }
  * @param parameter
  * @returns {*}
@@ -69,3 +69,17 @@ export function changeSbInfoScrapForAudit (parameter) {
     data: parameter
   })
 }
+
+/**
+ * update func 签收
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function claimSbInfoScrapForAudit (parameter) {
+  return axios({
+    url: '/activiti/sb/scrap/claim',
+    method: 'PUT',
+    data: parameter
+  })
+}

+ 4 - 2
src/utils/dict.js

@@ -150,8 +150,10 @@ DictCache.TYPE = {
   CHECK_PLAN_LEVEL: 'CHECK_PLAN_LEVEL', // 等级1:现场,2,维修,3厂家
   CHECK_JOB_STATUS: 'CHECK_JOB_STATUS', // 任务状态,
   SPARE_PART_USED_SOURCE: 'SPARE_PART_USED_SOURCE', // 1 维修 2 保养
-  /* 设备变动 */
-  SB_SCRAP_FORM_STATUS: 'SB_SCRAP_FORM_STATUS', // 设备报废单状态
+
+  /* 审批单 */
+  ACTIVITI_FORM_STATUS: 'ACTIVITI_FORM_STATUS', // 申请单状态
+
   /* 保养润滑模块 */
   MAINTAIN_STANDARD_PARAM_TYPE: 'MAINTAIN_STANDARD_PARAM_TYPE', // 标准参数类型
   MAINTAIN_STANDARD_TYPE: 'MAINTAIN_STANDARD_TYPE', // 检查类型

+ 203 - 0
src/views/activiti/History.vue

@@ -0,0 +1,203 @@
+<template>
+  <a-card :bordered="false" class="card" :title="modalTitle">
+    <title-divider title="审批信息" width="90px"></title-divider>
+    <a-table
+      :columns="auditColumns"
+      :dataSource="auditData"
+      :pagination="false"
+    >
+    </a-table>
+    <title-divider title="流程图" width="90px"></title-divider>
+    <div>
+      <img style="width: 90%" :src="image1" v-show="!showFlag" />
+      <img style="width: 90%" :src="image2" v-show="showFlag"/>
+    </div>
+    <div v-show="audit">
+      <title-divider title="审核信息" width="90px"></title-divider>
+      <a-row class="form-row" :gutter="16">
+        <a-col :lg="12" :md="12" :sm="24">
+          <a-radio-group v-model="auditFlag" @change="changeOpinion">
+            <a-radio :value="1">通过</a-radio>
+            <a-radio :value="0">拒绝</a-radio>
+          </a-radio-group>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="16">
+        <a-col :lg="12" :md="12" :sm="24">
+          <a-form-item
+            label="审核描述"
+          >
+            <a-textarea
+              v-model="refuseReason"/>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="48" slot="">
+        <a-col :md="48" :sm="48">
+          <span class="table-page-search-submitButtons" style="float: right">
+            <a-button type="primary" :loading="confirmLoading" @click="save()">提交</a-button>
+          </span>
+        </a-col>
+      </a-row>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { getAuditRecord, getShineProImage } from '@/api/activiti/activiti'
+import { auditSbInfoScrapForAudit } from '@/api/activiti/activiti-sb-scrap'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'ActivitiHistory',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  props: {
+    audit: {
+      type: Boolean,
+      default: true
+    },
+    targetId: {
+      type: String,
+      default: null
+    },
+    processInstanceId: {
+      type: String,
+      default: null
+    },
+    taskId: {
+      type: String,
+      default: null
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      auditFinish: true,
+      image1: '',
+      timer: '',
+      showFlag: true,
+      countNum: 0,
+      image2: '',
+      refuseReason: '同意',
+      auditFlag: 1,
+      auditColumns: [
+        {
+          title: '审批人',
+          dataIndex: 'userName',
+          key: 'userName',
+          width: '20%'
+        },
+        {
+          title: '审批时间',
+          dataIndex: 'createTime',
+          key: 'auditTime',
+          width: '30%',
+          scopedSlots: { customRender: 'keyword' }
+        },
+        {
+          title: '审批结果',
+          dataIndex: 'flag',
+          key: 'flag',
+          width: '30%',
+          customRender: (text, row, index) => {
+            return text ? '通过' : '不通过'
+          }
+        },
+        {
+          title: '审批意见',
+          dataIndex: 'opinion',
+          key: 'opinion'
+        }
+      ],
+      auditData: []
+    }
+  },
+  created () {
+    // 下拉框map
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
+    this.modalTitle = '审批'
+    this.getAuditRecords()
+    this.getImage()
+  },
+  mounted () {
+    this.timer = setInterval(this.showImage, 1000)
+  },
+  methods: {
+    base () {
+      this.modalTitle = '审批'
+      this.getAuditRecords()
+      this.getImage()
+    },
+    showImage () {
+      if (this.countNum === 0) {
+        this.showFlag = false
+      } else {
+        this.showFlag = true
+      }
+      this.countNum++
+      if (this.countNum === 2) {
+        this.countNum = 0
+      }
+    },
+    getAuditRecords () {
+      getAuditRecord(this.processInstanceId).then(res => {
+        const auditData = res.data
+        for (let i = 0; i < auditData.length; i++) {
+          const item = auditData[i]
+          item.opinion = this.getFormatOpinion(item.opinion)
+        }
+        this.auditData = auditData
+      })
+    },
+    getFormatOpinion (opinion) {
+      if (opinion === '提交申请') {
+        return '同意'
+      } else {
+        return opinion
+      }
+    },
+    getImage () {
+      getShineProImage({ processInstanceId: this.processInstanceId })
+        .then((res) => {
+          const images = res.data.images
+          this.image1 = 'data:image/png;base64,' + images[0]
+          this.image2 = 'data:image/png;base64,' + images[1]
+          // this.timer = setInterval(this.showImage(), 1000)
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    },
+    changeOpinion (e) {
+      this.refuseReason = e.target.value ? '同意' : '不同意'
+    },
+    save () {
+      this.confirmLoading = true
+      auditSbInfoScrapForAudit({ id: this.targetId, processInstanceId: this.processInstanceId, refuseReason: this.refuseReason, auditFlag: this.auditFlag, taskId: this.taskId })
+        .then(() => {
+          this.$message.info('操作成功')
+          this.auditFinish = false
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+          this.auditFinish = true
+        })
+    },
+    handleCancel () {
+      this.confirmLoading = false
+      this.image1 = ''
+      this.showFlag = true
+      this.countNum = 0
+      this.image2 = ''
+      this.refuseReason = '同意'
+      this.auditFlag = 1
+      this.auditFinish = true
+      clearInterval(this.timer)
+      this.$emit('ok')
+    }
+  }
+}
+</script>

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

@@ -36,7 +36,6 @@
         </span>
       </s-table>
     </div>
-    <audit ref="auditModal" @ok="handleOk"/>
     <suplier-audit-form ref="supplierAuditModal" @ok="handleOk"/>
     <detail-audit-scrap ref="detailAuditScrapModal" @ok="handleOk"/>
     <assign-form ref="assignForm" @ok="handleOk"/>
@@ -45,10 +44,9 @@
 
 <script>
 import { STable, Ellipsis } from '@/components'
-import Audit from '../audit/Audit'
 import AssignForm from './modules/AssignForm'
 import SuplierAuditForm from '@/views/purchase/supplier/modules/AuditForm'
-import DetailAuditScrap from '@/views/sb/scrap/modules/DetailAuditScrap'
+import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
 import { getTaskPage } from '@/api/activiti/activiti'
 
 export default {
@@ -159,24 +157,9 @@ export default {
     },
     handleAudit (record) {
       this.visible = false
-      if (record.targetCode === 'purchase_plan') {
-        this.$refs.purchasePlanAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_apply') {
-        this.$refs.purchaseApplyAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_demand_plan') {
-        this.$refs.purchaseDemandPlanAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_demand_plan_add') {
-        this.$refs.purchaseDemandPlanAuditAddModal.base(record)
-      } else if (record.targetCode === 'purchase_bid') {
-        this.$refs.purchaseBidAuditAddModal.base(record)
-      } else if (record.targetCode === 'supplier') {
-        this.$refs.supplierAuditModal.base(record)
-      } else if (record.targetCode === 'sb_info_scrap' || record.targetCode === '设备报废审批') {
+      if (record.targetCode === 'sb_info_scrap') {
         this.$refs.detailAuditScrapModal.base(record)
-      } else if (record.targetCode === 'sb_info_scrap_second') {
-        this.$refs.detailAuditScrapSecondModal.base(record)
       }
-      // this.$refs.auditModal.base(record)
     },
     handleChange (record) {
       this.$refs.assignForm.base(record)

+ 12 - 30
src/views/activiti/task/MyTaskClaim.vue

@@ -29,27 +29,23 @@
       >
         <span slot="action" slot-scope="record">
           <template>
-            <a @click="handleAudit(record)">审批</a>
-            <a-divider type="vertical" />
-            <a @click="handleChange(record)">转签</a>
+            <a @click="handleClaim(record)">签收</a>
           </template>
         </span>
       </s-table>
     </div>
-    <audit ref="auditModal" @ok="handleOk"/>
     <suplier-audit-form ref="supplierAuditModal" @ok="handleOk"/>
     <detail-audit-scrap ref="detailAuditScrapModal" @ok="handleOk"/>
-    <assign-form ref="assignForm" @ok="handleOk"/>
   </a-card>
 </template>
 
 <script>
 import { STable, Ellipsis } from '@/components'
-import Audit from '../audit/Audit'
 import AssignForm from './modules/AssignForm'
 import SuplierAuditForm from '@/views/purchase/supplier/modules/AuditForm'
-import DetailAuditScrap from '@/views/sb/scrap/modules/DetailAuditScrap'
+import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
 import { getTaskPageClaim } from '@/api/activiti/activiti'
+import { claimSbInfoScrapForAudit } from '@/api/activiti/activiti-sb-scrap'
 
 export default {
   name: 'TaskList',
@@ -157,29 +153,15 @@ export default {
         this.optionAlertShow = false
       }
     },
-    handleAudit (record) {
-      this.visible = false
-      if (record.targetCode === 'purchase_plan') {
-        this.$refs.purchasePlanAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_apply') {
-        this.$refs.purchaseApplyAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_demand_plan') {
-        this.$refs.purchaseDemandPlanAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_demand_plan_add') {
-        this.$refs.purchaseDemandPlanAuditAddModal.base(record)
-      } else if (record.targetCode === 'purchase_bid') {
-        this.$refs.purchaseBidAuditAddModal.base(record)
-      } else if (record.targetCode === 'supplier') {
-        this.$refs.supplierAuditModal.base(record)
-      } else if (record.targetCode === 'sb_info_scrap' || record.targetCode === '设备报废审批') {
-        this.$refs.detailAuditScrapModal.base(record)
-      } else if (record.targetCode === 'sb_info_scrap_second') {
-        this.$refs.detailAuditScrapSecondModal.base(record)
-      }
-      // this.$refs.auditModal.base(record)
-    },
-    handleChange (record) {
-      this.$refs.assignForm.base(record)
+    handleClaim (record) {
+      this.confirmLoading = true
+      claimSbInfoScrapForAudit({ taskId: record.taskId })
+        .then((res) => {
+          this.$message.info(res.data)
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
     },
     handleOk () {
       this.visible = true

+ 4 - 26
src/views/activiti/task/MyTaskFinish.vue

@@ -29,17 +29,13 @@
       >
         <span slot="action" slot-scope="record">
           <template>
-            <a @click="handleAudit(record)">审批</a>
-            <a-divider type="vertical" />
-            <a @click="handleChange(record)">转签</a>
+            <a @click="handleAudit(record)">查看</a>
           </template>
         </span>
       </s-table>
     </div>
-    <audit ref="auditModal" @ok="handleOk"/>
     <suplier-audit-form ref="supplierAuditModal" @ok="handleOk"/>
-    <detail-audit-scrap ref="detailAuditScrapModal" @ok="handleOk"/>
-    <assign-form ref="assignForm" @ok="handleOk"/>
+    <detail-audit-scrap :audit="false" ref="detailAuditScrapModal" @ok="handleOk"/>
   </a-card>
 </template>
 
@@ -48,7 +44,7 @@ import { STable, Ellipsis } from '@/components'
 import Audit from '../audit/Audit'
 import AssignForm from './modules/AssignForm'
 import SuplierAuditForm from '@/views/purchase/supplier/modules/AuditForm'
-import DetailAuditScrap from '@/views/sb/scrap/modules/DetailAuditScrap'
+import DetailAuditScrap from '@/views/sb/scraps/modules/DetailAudit'
 import { getTaskPageFinish } from '@/api/activiti/activiti'
 
 export default {
@@ -159,27 +155,9 @@ export default {
     },
     handleAudit (record) {
       this.visible = false
-      if (record.targetCode === 'purchase_plan') {
-        this.$refs.purchasePlanAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_apply') {
-        this.$refs.purchaseApplyAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_demand_plan') {
-        this.$refs.purchaseDemandPlanAuditModal.base(record)
-      } else if (record.targetCode === 'purchase_demand_plan_add') {
-        this.$refs.purchaseDemandPlanAuditAddModal.base(record)
-      } else if (record.targetCode === 'purchase_bid') {
-        this.$refs.purchaseBidAuditAddModal.base(record)
-      } else if (record.targetCode === 'supplier') {
-        this.$refs.supplierAuditModal.base(record)
-      } else if (record.targetCode === 'sb_info_scrap' || record.targetCode === '设备报废审批') {
+      if (record.targetCode === 'sb_info_scrap') {
         this.$refs.detailAuditScrapModal.base(record)
-      } else if (record.targetCode === 'sb_info_scrap_second') {
-        this.$refs.detailAuditScrapSecondModal.base(record)
       }
-      // this.$refs.auditModal.base(record)
-    },
-    handleChange (record) {
-      this.$refs.assignForm.base(record)
     },
     handleOk () {
       this.visible = true

+ 3 - 2
src/views/activiti/task/modules/AssignForm.vue

@@ -34,7 +34,7 @@
 
 <script>
 import { queryUser } from '@/api/upms/user'
-import { changeSbInfoScrapForAudit } from '@/api/sb/info'
+import { changeSbInfoScrapForAudit } from '@/api/activiti/activiti-sb-scrap'
 
 export default {
   name: 'DispatchBaseForm',
@@ -83,7 +83,8 @@ export default {
         }
         values.taskId = this.record.taskId
         changeSbInfoScrapForAudit(values)
-          .then(() => {
+          .then((res) => {
+            this.$message.info(res.data)
             this.handleCancel(values)
           }).catch(() => {
             this.confirmLoading = false

+ 2 - 8
src/views/activiti/user-model/modules/BaseForm.vue

@@ -75,7 +75,7 @@
           >
             <a-input
               style="width: 60%"
-              v-decorator="['realName', {rules: [{required: true, message: '审批人不能为空'}]}]"/>
+              v-decorator="['realName', {rules: [{required: false, message: '审批人不能为空'}]}]"/>
             <a-button type="primary" style="width: 20%" @click="handleUserSelect">选择</a-button>
             <a-button type="default" style="width: 20%" @click="clearUserSelect">清空</a-button>
           </a-form-item>
@@ -299,13 +299,7 @@ export default {
       })
     },
     clearRoleListSelect () {
-      const { form: { setFieldsValue } } = this
-      // 日期处理
-      this.$nextTick(() => {
-        setFieldsValue(Object.assign({
-          'roleIdList': null
-        }))
-      })
+      this.roleIdList = []
     },
     clearDeptSelect () {
       const { form: { setFieldsValue } } = this

+ 540 - 541
src/views/purchase/purchase-dispatch-order/modules/PurchaseDispatchOrderSelectModal.vue

@@ -1,556 +1,555 @@
 <template>
-    <a-modal
-            :title="modalTitle"
-            :width="1000"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            class="ant-modal2"
-            @cancel="handleCancel"
-    >
-        <a-card :bordered="false">
-            <div class="table-page-search-wrapper">
-                <a-form layout="inline">
-                    <a-row :gutter="48">
-                        <a-col :md="8" :sm="24">
-                            <a-form-item label="关键字">
-                                <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/类型名称"/>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :md="8 || 24" :sm="24">
-                <span class="table-page-search-submitButtons">
-                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
-                </span>
-                        </a-col>
-                    </a-row>
-                </a-form>
-            </div>
+  <a-modal
+    :title="modalTitle"
+    :width="1000"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-card :bordered="false">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="8" :sm="24">
+              <a-form-item label="关键字">
+                <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/类型名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8 || 24" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
 
-            <div class="table-operator" style="margin-bottom: 8px;">
-            </div>
+      <div class="table-operator" style="margin-bottom: 8px;">
+      </div>
 
-            <s-table
-                    ref="table"
-                    size="small"
-                    rowKey="id"
-                    :columns="columns"
-                    :data="loadData"
-                    :alert="options.alert"
-                    :customRow="options.customRow"
-                    :rowSelection="options.rowSelection"
-                    showPagination="auto"
-            >
-                <span slot="action" slot-scope="record1">
-                  <template>
-                    <a @click="handleView(record1)">查看</a>
-                  </template>
-                </span>
-            </s-table>
-            <detail ref="detailModal"/>
-        </a-card>
-        <template slot="footer">
-            <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
-            <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">确定</a-button>
-        </template>
-    </a-modal>
+      <s-table
+        ref="table"
+        size="small"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :customRow="options.customRow"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+      >
+        <span slot="action" slot-scope="record1">
+          <template>
+            <a @click="handleView(record1)">查看</a>
+          </template>
+        </span>
+      </s-table>
+      <detail ref="detailModal"/>
+    </a-card>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+      <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">确定</a-button>
+    </template>
+  </a-modal>
 </template>
 
 <script>
-    import { STable, Ellipsis } from '@/components'
-    import Detail from './Detail'
-    import { getPurchaseDispatchOrderPage, fetchPurchaseDispatchOrder } from '@/api/purchase/purchase-dispatch-order'
+import { STable, Ellipsis } from '@/components'
+import Detail from './Detail'
+import { getPurchaseDispatchOrderPage, fetchPurchaseDispatchOrder } from '@/api/purchase/purchase-dispatch-order'
 
-    export default {
-        name: 'PurchaseDispatchOrderSelectModal',
-        components: {
-            STable,
-            Ellipsis,
-            Detail
-        },
-        props: {
-            type: {
-                type: String,
-                default: 'radio'
-            },
-            selectedRowKey: {
-                type: Array,
-                default: () => {
-                    return []
-                }
-            },
-            selectedRow: {
-                type: Array,
-                default: () => {
-                    return []
-                }
-            }
+export default {
+  name: 'PurchaseDispatchOrderSelectModal',
+  components: {
+    STable,
+    Ellipsis,
+    Detail
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'radio'
+    },
+    selectedRowKey: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    selectedRow: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      record: null,
+      // 查询参数
+      queryParam: {
+      },
+      extraQueryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
         },
-        data () {
-            return {
-                confirmLoading: false,
-                mdl: {},
-                modalTitle: null,
-                visible: false,
-                record: null,
-                // 查询参数
-                queryParam: {
-                },
-                extraQueryParam: {
-                },
-                // 表头
-                columns: [
-                    {
-                        title: '序号',
-                        dataIndex: 'index',
-                        customRender: (text, record, index) => {
-                            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
-                        }
-                    },
-                                                                                                                                                {
-                                title: '单号',
-                                dataIndex: 'billNo'
-                            },
-                                                                                                                                                        {
-                                title: '采购申请ID',
-                                dataIndex: 'purchaseApplyId'
-                            },
-                                                                                                                                                        {
-                                title: '采购计划ID',
-                                dataIndex: 'purchasePlanId'
-                            },
-                                                                                                                                                        {
-                                title: '总需求计划主键',
-                                dataIndex: 'demandPlanId'
-                            },
-                                                                                                                                                        {
-                                title: '采购单ID',
-                                dataIndex: 'purchaseOrderId'
-                            },
-                                                                                                                                                        {
-                                title: '公司ID',
-                                dataIndex: 'companyId'
-                            },
-                                                                                                                                                        {
-                                title: '公司名称',
-                                dataIndex: 'companyName'
-                            },
-                                                                                                                                                        {
-                                title: '项目主键',
-                                dataIndex: 'projectId'
-                            },
-                                                                                                                                                        {
-                                title: '项目名称',
-                                dataIndex: 'projectName'
-                            },
-                                                                                                                                                            {
-                                    title: '类型',
-                                    dataIndex: 'type',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Object.getField(this.typeMap, text)
-                                    }                  ,
-                                },
-                                                                                                                                                        {
-                                title: '发货日期',
-                                dataIndex: 'dispatchDate'
-                            },
-                                                                                                                                                        {
-                                title: '始发地国家ID',
-                                dataIndex: 'originCountryId'
-                            },
-                                                                                                                                                        {
-                                title: '始发地国家名称',
-                                dataIndex: 'originCountryName'
-                            },
-                                                                                                                                                        {
-                                title: '始发地国家地址',
-                                dataIndex: 'originCountryAddress'
-                            },
-                                                                                                                                                        {
-                                title: '目的地国家ID',
-                                dataIndex: 'destinationCountryId'
-                            },
-                                                                                                                                                        {
-                                title: '目的地国家名称',
-                                dataIndex: 'destinationCountryName'
-                            },
-                                                                                                                                                        {
-                                title: '目的地国家地址',
-                                dataIndex: 'destinationCountryAddress'
-                            },
-                                                                                                                                                        {
-                                title: '采购员ID',
-                                dataIndex: 'purchaserId'
-                            },
-                                                                                                                                                        {
-                                title: '采购员名称',
-                                dataIndex: 'purchaserName'
-                            },
-                                                                                                                                                        {
-                                title: '采购员联系方式',
-                                dataIndex: 'purchaserPhone'
-                            },
-                                                                                                                                                        {
-                                title: '发货员ID',
-                                dataIndex: 'shipperId'
-                            },
-                                                                                                                                                        {
-                                title: '发货员名称',
-                                dataIndex: 'shipperName'
-                            },
-                                                                                                                                                        {
-                                title: '发货员联系方式',
-                                dataIndex: 'shipperPhone'
-                            },
-                                                                                                                                                        {
-                                title: '收货员ID',
-                                dataIndex: 'receiverId'
-                            },
-                                                                                                                                                        {
-                                title: '收货员名称',
-                                dataIndex: 'receiverName'
-                            },
-                                                                                                                                                        {
-                                title: '收货员联系方式',
-                                dataIndex: 'receiverPhone'
-                            },
-                                                                                                                                                        {
-                                title: '存货位置',
-                                dataIndex: 'inventoryLocation'
-                            },
-                                                                                                                                                            {
-                                    title: '货运方式',
-                                    dataIndex: 'dispatchType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Object.getField(this.dispatchTypeMap, text)
-                                    }                  ,
-                                },
-                                                                                                                                                            {
-                                    title: '数量',
-                                    dataIndex: 'quantity',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '已发数量',
-                                    dataIndex: 'dispatchedQuantity',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '未发数量',
-                                    dataIndex: 'notDispatchQuantity',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                        {
-                                title: '海运提单邮寄单号',
-                                dataIndex: 'mailingNum'
-                            },
-                                                                                                                                                            {
-                                    title: '运费',
-                                    dataIndex: 'freightFee',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '保险费',
-                                    dataIndex: 'insuranceFee',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '运杂费',
-                                    dataIndex: 'dispatchSurcharge',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '关税',
-                                    dataIndex: 'tariff',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '清关费',
-                                    dataIndex: 'clearanceCharge',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '港杂税',
-                                    dataIndex: 'portSurcharge',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                        {
-                                title: '报关单',
-                                dataIndex: 'customsDeclaration'
-                            },
-                                                                                                                                                        {
-                                title: '形式发票',
-                                dataIndex: 'proformaInvoice'
-                            },
-                                                                                                                                                            {
-                                    title: '运费币种',
-                                    dataIndex: 'freightFeeType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '保险费币种',
-                                    dataIndex: 'insuranceFeeType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '运杂费币种',
-                                    dataIndex: 'dispatchSurchargeType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '关税币种',
-                                    dataIndex: 'tariffType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '清关费币种',
-                                    dataIndex: 'clearanceChargeType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '港杂税币种',
-                                    dataIndex: 'portSurchargeType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '二次转运费币种',
-                                    dataIndex: 'secondaryTransportationFeeType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '二次转运费',
-                                    dataIndex: 'secondaryTransportationFee',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Amount.formatter(text)
-                                    }                                ,
-                                },
-                                                                                                                                                            {
-                                    title: '差额情况',
-                                    dataIndex: 'differenceType',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Object.getField(this.differenceTypeMap, text)
-                                    }                  ,
-                                },
-                                                                                                                                                        {
-                                title: '入库仓库ID',
-                                dataIndex: 'warehouseId'
-                            },
-                                                                                                                                                        {
-                                title: '入库仓库名称',
-                                dataIndex: 'warehouseName'
-                            },
-                                                                                                                                                            {
-                                    title: '入库原因',
-                                    dataIndex: 'enterReason',
-                                    customRender: (text, record, index) => {
-                                        return this.BaseTool.Object.getField(this.enterReasonMap, text)
-                                    }                  ,
-                                },
-                                                                                                                                                        {
-                                title: '状态',
-                                dataIndex: 'status'
-                            },
-                                                                                                                                                        {
-                                title: '备注',
-                                dataIndex: 'remark'
-                            },
-                                                                                                                                                        {
-                                title: '删除标志',
-                                dataIndex: 'delFlag'
-                            },
-                                                                                                                                                                                                    {
-                                title: '创建人名称',
-                                dataIndex: 'createdUserName'
-                            },
-                                                                                                                                                        {
-                                title: '创建时间',
-                                dataIndex: 'createdTime'
-                            },
-                                                                                                                                                                                                                                {
-                        title: '操作',
-                        key: 'action',
-                        width: '200px',
-                        align: 'center',
-                        scopedSlots: { customRender: 'action' }
-                    }
-                ],
-                // 下拉框map
-                                    typeMap: {},
-                                    dispatchTypeMap: {},
-                                    differenceTypeMap: {},
-                                    enterReasonMap: {},
-                                // 加载数据方法 必须为 Promise 对象
-                loadData: parameter => {
-                    parameter = {
-                        ...parameter,
-                        ...this.queryParam,
-                        ...this.extraQueryParam,
-                        dataScope: {
-                            sortBy: 'desc',
-                            sortName: 'update_time'
-                        }
-                    }
-                    return getPurchaseDispatchOrderPage(Object.assign(parameter, this.queryParam))
-                            .then(res => {
-                                return res.data
-                            })
-                },
-                selectedRowKeys: [],
-                selectedRows: [],
+        {
+          title: '单号',
+          dataIndex: 'billNo'
+        },
+        {
+          title: '采购申请ID',
+          dataIndex: 'purchaseApplyId'
+        },
+        {
+          title: '采购计划ID',
+          dataIndex: 'purchasePlanId'
+        },
+        {
+          title: '总需求计划主键',
+          dataIndex: 'demandPlanId'
+        },
+        {
+          title: '采购单ID',
+          dataIndex: 'purchaseOrderId'
+        },
+        {
+          title: '公司ID',
+          dataIndex: 'companyId'
+        },
+        {
+          title: '公司名称',
+          dataIndex: 'companyName'
+        },
+        {
+          title: '项目主键',
+          dataIndex: 'projectId'
+        },
+        {
+          title: '项目名称',
+          dataIndex: 'projectName'
+        },
+        {
+          title: '类型',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '发货日期',
+          dataIndex: 'dispatchDate'
+        },
+        {
+          title: '始发地国家ID',
+          dataIndex: 'originCountryId'
+        },
+        {
+          title: '始发地国家名称',
+          dataIndex: 'originCountryName'
+        },
+        {
+          title: '始发地国家地址',
+          dataIndex: 'originCountryAddress'
+        },
+        {
+          title: '目的地国家ID',
+          dataIndex: 'destinationCountryId'
+        },
+        {
+          title: '目的地国家名称',
+          dataIndex: 'destinationCountryName'
+        },
+        {
+          title: '目的地国家地址',
+          dataIndex: 'destinationCountryAddress'
+        },
+        {
+          title: '采购员ID',
+          dataIndex: 'purchaserId'
+        },
+        {
+          title: '采购员名称',
+          dataIndex: 'purchaserName'
+        },
+        {
+          title: '采购员联系方式',
+          dataIndex: 'purchaserPhone'
+        },
+        {
+          title: '发货员ID',
+          dataIndex: 'shipperId'
+        },
+        {
+          title: '发货员名称',
+          dataIndex: 'shipperName'
+        },
+        {
+          title: '发货员联系方式',
+          dataIndex: 'shipperPhone'
+        },
+        {
+          title: '收货员ID',
+          dataIndex: 'receiverId'
+        },
+        {
+          title: '收货员名称',
+          dataIndex: 'receiverName'
+        },
+        {
+          title: '收货员联系方式',
+          dataIndex: 'receiverPhone'
+        },
+        {
+          title: '存货位置',
+          dataIndex: 'inventoryLocation'
+        },
+        {
+          title: '货运方式',
+          dataIndex: 'dispatchType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.dispatchTypeMap, text)
+          }
+        },
+        {
+          title: '数量',
+          dataIndex: 'quantity',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '已发数量',
+          dataIndex: 'dispatchedQuantity',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '未发数量',
+          dataIndex: 'notDispatchQuantity',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '海运提单邮寄单号',
+          dataIndex: 'mailingNum'
+        },
+        {
+          title: '运费',
+          dataIndex: 'freightFee',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '保险费',
+          dataIndex: 'insuranceFee',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '运杂费',
+          dataIndex: 'dispatchSurcharge',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '关税',
+          dataIndex: 'tariff',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '清关费',
+          dataIndex: 'clearanceCharge',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '港杂税',
+          dataIndex: 'portSurcharge',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '报关单',
+          dataIndex: 'customsDeclaration'
+        },
+        {
+          title: '形式发票',
+          dataIndex: 'proformaInvoice'
+        },
+        {
+          title: '运费币种',
+          dataIndex: 'freightFeeType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '保险费币种',
+          dataIndex: 'insuranceFeeType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '运杂费币种',
+          dataIndex: 'dispatchSurchargeType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '关税币种',
+          dataIndex: 'tariffType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '清关费币种',
+          dataIndex: 'clearanceChargeType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '港杂税币种',
+          dataIndex: 'portSurchargeType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '二次转运费币种',
+          dataIndex: 'secondaryTransportationFeeType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '二次转运费',
+          dataIndex: 'secondaryTransportationFee',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '差额情况',
+          dataIndex: 'differenceType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.differenceTypeMap, text)
+          }
+        },
+        {
+          title: '入库仓库ID',
+          dataIndex: 'warehouseId'
+        },
+        {
+          title: '入库仓库名称',
+          dataIndex: 'warehouseName'
+        },
+        {
+          title: '入库原因',
+          dataIndex: 'enterReason',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.enterReasonMap, text)
+          }
+        },
+        {
+          title: '状态',
+          dataIndex: 'status'
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark'
+        },
+        {
+          title: '删除标志',
+          dataIndex: 'delFlag'
+        },
+        {
+          title: '创建人名称',
+          dataIndex: 'createdUserName'
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      typeMap: {},
+      dispatchTypeMap: {},
+      differenceTypeMap: {},
+      enterReasonMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          ...this.extraQueryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getPurchaseDispatchOrderPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
 
-                options: {
-                    alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
-                    rowSelection: {
-                        selectedRowKeys: this.selectedRowKeys,
-                        onChange: this.onSelectChange
-                    }
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false,
+      isCreated: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_TYPE)
+    this.dispatchTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_DISPATCH_TYPE)
+    this.differenceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_DIFFERENCE_TYPE)
+    this.enterReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_ENTER_REASON)
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            type: this.type,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          },
+          customRow: (record) => {
+            return {
+              on: { // 事件
+                click: (event) => { // 点击行
+                  // 选择对象
+                  this.mySelect([record.id], [record])
                 },
-                optionAlertShow: false,
-                isCreated: false
-            }
-        },
-        created () {
-            // 下拉框map
-                            this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_TYPE)
-                            this.dispatchTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_DISPATCH_TYPE)
-                            this.differenceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_DIFFERENCE_TYPE)
-                            this.enterReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PURCHASE_DISPATCH_ORDER_ENTER_REASON)
-                    },
-        methods: {
-            tableOption () {
-                if (!this.optionAlertShow) {
-                    this.options = {
-                        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
-                        rowSelection: {
-                            selectedRowKeys: this.selectedRowKeys,
-                            onChange: this.onSelectChange,
-                            type: this.type,
-                            getCheckboxProps: record => ({
-                                props: {
-                                    disabled: false,
-                                    name: record.id
-                                }
-                            })
-                        },
-                        customRow: (record) => {
-                            return {
-                                on: { // 事件
-                                    click: (event) => { // 点击行
-                                        // 选择对象
-                                        this.mySelect([record.id], [record])
-                                    },
-                                    dblclick: (event) => {
-                                        this.mySelect([record.id], [record])
-                                        this.handleSelect()
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    this.optionAlertShow = true
-                } else {
-                    this.options = {
-                        alert: false,
-                        rowSelection: null
-                    }
-                    this.optionAlertShow = false
-                }
-            },
-            handleView (record) {
-                fetchPurchaseDispatchOrder({ id: record.id }).then(res => {
-                    const modal = this.$refs.detailModal
-                    modal.base(res.data)
-                })
-            },
-            handleOk () {
-                this.$refs.table.refresh()
-            },
-            onSelectChange (selectedRowKeys, selectedRows) {
-                this.selectedRowKeys = selectedRowKeys
-                this.selectedRows = selectedRows
-            },
-            resetSearchForm () {
-                this.queryParam = {
-                }
-                this.$refs.table.refresh(true)
-            },
-            base (record, queryParam = {}) {
-                this.visible = true
-                this.modalTitle = '选择信息'
-                this.extraQueryParam = queryParam
-                this.record = record
-                if (this.isCreated) {
-                    this.$refs.table.clearSelected()
-                    this.options.rowSelection.type = this.type
-                    this.handleOk()
-                } else {
-                    this.tableOption()
-                    this.isCreated = true
-                }
-            },
-            handleCancel () {
-                this.visible = false
-                this.confirmLoading = false
-            },
-            handleSelect () {
-                if (this.selectedRowKeys.length === 0) {
-                    this.$message.warn('请至少选择一项信息')
-                } else {
-                    this.confirmLoading = true
-                    this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
-                    this.confirmLoading = false
-                    this.visible = false
+                dblclick: (event) => {
+                  this.mySelect([record.id], [record])
+                  this.handleSelect()
                 }
-            },
-            mySelect(selectedRowKeys, selectedRows) {
-                if (this.type === 'radio') {
-                    this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
-                            this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
-                } else {
-                    let mySelectedRowKeys
-                    let mySelectedRows = this.selectedRows.filter(item => item.id !== selectedRowKeys[0])
-                    if (this.selectedRowKeys.includes(selectedRowKeys[0])) {
-                        mySelectedRowKeys = this.selectedRowKeys.filter(item => item !== selectedRowKeys[0])
-                    } else {
-                        mySelectedRowKeys = [...selectedRowKeys, ...this.selectedRowKeys]
-                        mySelectedRows = [...mySelectedRows, ...selectedRows]
-                    }
-                    this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
-                            this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
-                }
-
+              }
             }
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleView (record) {
+      fetchPurchaseDispatchOrder({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    base (record, queryParam = {}) {
+      this.visible = true
+      this.modalTitle = '选择信息'
+      this.extraQueryParam = queryParam
+      this.record = record
+      if (this.isCreated) {
+        this.$refs.table.clearSelected()
+        this.options.rowSelection.type = this.type
+        this.handleOk()
+      } else {
+        this.tableOption()
+        this.isCreated = true
+      }
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    handleSelect () {
+      if (this.selectedRowKeys.length === 0) {
+        this.$message.warn('请至少选择一项信息')
+      } else {
+        this.confirmLoading = true
+        this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
+        this.confirmLoading = false
+        this.visible = false
+      }
+    },
+    mySelect (selectedRowKeys, selectedRows) {
+      if (this.type === 'radio') {
+        this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
+        this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
+      } else {
+        let mySelectedRowKeys
+        let mySelectedRows = this.selectedRows.filter(item => item.id !== selectedRowKeys[0])
+        if (this.selectedRowKeys.includes(selectedRowKeys[0])) {
+          mySelectedRowKeys = this.selectedRowKeys.filter(item => item !== selectedRowKeys[0])
+        } else {
+          mySelectedRowKeys = [...selectedRowKeys, ...this.selectedRowKeys]
+          mySelectedRows = [...mySelectedRows, ...selectedRows]
         }
+        this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
+        this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
+      }
     }
+  }
+}
 </script>

+ 20 - 18
src/views/sb/scraps/SbScrapForm.vue

@@ -86,24 +86,29 @@
           <template>
             <a @click="handleView(record)">查看</a>
             <operation-button
-              v-if="$auth('sb-scraps-edit')"
+              v-if="$auth('sb-scraps-edit') && record.status != 3"
               @click="handleEdit(record)"
             >修改</operation-button>
             <operation-button
-              v-if="$auth('sb-scraps-del')"
+              v-if="$auth('sb-scraps-del') && record.status == 1"
               :type="2"
               title="是否要删除该条数据?"
               @confirm="batchDelete(record.id)">删除</operation-button>
-            <a-divider type="vertical" />
-            <a v-if="record.status == 1" @click="handleStart(record)">提交</a>
-            <a-divider type="vertical" />
-            <a v-if="record.status == 4" @click="handleStart(record)">再次提交</a>
-            <a-divider type="vertical" />
-            <a @click="handleViewImage(record)">流程图</a>
-            <a-divider type="vertical" />
-            <a @click="handleViewHistory(record)">审批历史</a>
-            <a-divider type="vertical" />
-            <a @click="handleStop(record)">终止审批</a>
+            <operation-button
+              v-if="record.status == 1"
+              :type="2"
+              title="确认提交该条数据?"
+              @click="handleStart(record.id)">提交</operation-button>
+            <operation-button
+              v-if="record.status == 4"
+              :type="2"
+              title="再次提交该条数据?"
+              @click="handleStart(record)">再次提交</operation-button>
+            <operation-button
+              v-if="record.status != 3"
+              :type="2"
+              title="是否要终止审批?"
+              @click="handleStop(record)">终止审批</operation-button>
           </template>
         </span>
       </s-table>
@@ -154,11 +159,8 @@ export default {
           dataIndex: 'no'
         },
         {
-          title: '设备Id',
-          dataIndex: 'sbId',
-          customRender: (text, record, index) => {
-            return record.sbIdName
-          }
+          title: '设备名称',
+          dataIndex: 'sbName'
         },
         {
           title: '设备编号',
@@ -240,7 +242,7 @@ export default {
   },
   created () {
     // 下拉框map
-    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_SCRAP_FORM_STATUS)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
     this.tableOption()
   },
   methods: {

+ 1 - 1
src/views/sb/scraps/modules/BaseForm.vue

@@ -189,7 +189,7 @@ export default {
   props: {},
   created () {
     // 下拉框map
-    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_SCRAP_FORM_STATUS)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
   },
   methods: {
     base (record) {

+ 9 - 4
src/views/sb/scraps/modules/Detail.vue

@@ -11,7 +11,7 @@
       <detail-list-item term="单号">{{ model.no }}</detail-list-item>
       <detail-list-item term="设备Id"><a @click="sbIdhandleDetail">{{ model.sbId }}</a></detail-list-item>
       <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
-      <detail-list-item term="设备编号">{{ model.sbName }}</detail-list-item>
+      <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
       <detail-list-item term="报废原因">{{ model.reason }}</detail-list-item>
       <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
       <detail-list-item term="状态">{{ BaseTool.Object.getField(this.statusMap,model.status) }}</detail-list-item>
@@ -22,18 +22,21 @@
       <detail-list-item term="更新人名称">{{ model.updateUserName }}</detail-list-item>
       <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
     </detail-list>
+    <history :target-id="model.id" :process-instance-id="model.processInstanceId" :ok="handleCancel"></history>
   </a-card>
 </template>
 
 <script>
 import DetailList from '@/components/tools/DetailList'
+import History from '@/views/activiti/History'
 const DetailListItem = DetailList.Item
 
 export default {
   name: 'SbScrapFormDetail',
   components: {
     DetailList,
-    DetailListItem
+    DetailListItem,
+    History
   },
   data () {
     return {
@@ -47,6 +50,7 @@ export default {
         'no': null,
         'sbId': null,
         'sbNo': null,
+        'sbName': null,
         'reason': null,
         'remark': null,
         'status': null,
@@ -62,7 +66,7 @@ export default {
   created () {
     // 下拉框map
 
-    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_SCRAP_FORM_STATUS)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
   },
   methods: {
     base (record) {
@@ -73,10 +77,11 @@ export default {
     handleCancel () {
       this.visible = false
       this.confirmLoading = false
+      this.$emit('ok')
     },
     sbIdhandleDetail () {
       const text = this.$router.resolve({
-        name: sbInfo,
+        name: 'SbInfo',
         query: { id: this.model.sbId }
       })
       // 打开一个新的页面

+ 103 - 0
src/views/sb/scraps/modules/DetailAudit.vue

@@ -0,0 +1,103 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+    <detail-list title="" :col="2">
+      <detail-list-item term="单号">{{ model.no }}</detail-list-item>
+      <detail-list-item term="设备Id"><a @click="sbIdhandleDetail">{{ model.sbId }}</a></detail-list-item>
+      <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
+      <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
+      <detail-list-item term="报废原因">{{ model.reason }}</detail-list-item>
+      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+      <detail-list-item term="状态">{{ BaseTool.Object.getField(this.statusMap,model.status) }}</detail-list-item>
+      <detail-list-item term="申请人">{{ model.applyUserId }}</detail-list-item>
+      <detail-list-item term="申请人名称">{{ model.applyUserName }}</detail-list-item>
+      <detail-list-item term="创建人">{{ model.createdUserId }}</detail-list-item>
+      <detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>
+      <detail-list-item term="更新人名称">{{ model.updateUserName }}</detail-list-item>
+      <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
+    </detail-list>
+    <history :audit="audit" :target-id="task.targetId" :process-instance-id="task.processInstanceId" :task-id="task.taskId" :ok="handleCancel"></history>
+  </a-card>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import History from '@/views/activiti/History'
+import { fetchSbScrapForm } from '@/api/sb/scraps'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'SbScrapFormDetail',
+  components: {
+    DetailList,
+    DetailListItem,
+    History
+  },
+  props: {
+    audit: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      // 下拉框map
+      statusMap: {},
+      task: null,
+      model: {
+        'no': null,
+        'sbId': null,
+        'sbNo': null,
+        'sbName': null,
+        'reason': null,
+        'remark': null,
+        'processInstanceId': null,
+        'status': null,
+        'applyUserId': null,
+        'applyUserName': null,
+        'createdUserId': null,
+        'updateUserId': null,
+        'updateUserName': null,
+        'updateTime': null
+      }
+    }
+  },
+  created () {
+    // 下拉框map
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.task = record
+      fetchSbScrapForm({ id: record.targetId }).then(res => {
+        this.model = res.data
+      })
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok')
+    },
+    sbIdhandleDetail () {
+      const text = this.$router.resolve({
+        name: 'SbInfo',
+        query: { id: this.model.sbId }
+      })
+      // 打开一个新的页面
+      window.open(text.href, '_blank')
+    }
+  }
+}
+</script>

+ 3 - 6
src/views/sb/scraps/modules/SbScrapFormSelectModal.vue

@@ -131,11 +131,8 @@ export default {
           dataIndex: 'no'
         },
         {
-          title: '设备Id',
-          dataIndex: 'sbId',
-          customRender: (text, record, index) => {
-            return record.sbIdName
-          }
+          title: '设备名称',
+          dataIndex: 'sbName'
         },
         {
           title: '设备编号',
@@ -214,7 +211,7 @@ export default {
   },
   created () {
     // 下拉框map
-    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_SCRAP_FORM_STATUS)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
   },
   methods: {
     tableOption () {