liqianyi 3 năm trước cách đây
mục cha
commit
8d1923ed80

+ 9 - 1
src/api/sale.js

@@ -115,7 +115,15 @@ export function getOutsourceList (params) {
 // 委外详情
 export function getOutsourceDetail (id) {
   return request({
-    url: request.adornUrl(`/biz-service/purCommDetail/info/${id}`),
+    url: request.adornUrl(`/biz-service/purCommDetail/PurCommInfo/${id}`),
+    method: 'get'
+  })
+}
+
+// 委外详情(按产品ID查询)
+export function getOutsourceDetailByProId (id) {
+  return request({
+    url: request.adornUrl(`/biz-service/purCommDetail/infoProduction/${id}`),
     method: 'get'
   })
 }

+ 88 - 87
src/views/modules/job/schedule-log.vue

@@ -1,96 +1,95 @@
 <template>
-  <el-dialog
-    title="日志列表"
-    :close-on-click-modal="false"
-    :visible.sync="visible"
-    width="75%">
-    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
-      <el-form-item>
-        <el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button @click="getDataList()">查询</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-      :data="dataList"
-      border
-      v-loading="dataListLoading"
-      height="542"
-      style="width: 100%;">
-      <el-table-column
-        prop="logId"
-        header-align="center"
-        align="center"
-        min-width="100"
-        :show-tooltip-when-overflow="true"
-        label="日志ID">
-      </el-table-column>
-      <el-table-column
-        prop="jobId"
-        header-align="center"
-        align="center"
-        min-width="100"
-        :show-tooltip-when-overflow="true"
-        label="任务ID">
-      </el-table-column>
-      <el-table-column
-        prop="beanName"
-        header-align="center"
-        align="center"
-        min-width="120"
-        :show-tooltip-when-overflow="true"
-        label="bean名称">
-      </el-table-column>
-      <el-table-column
-        prop="params"
-        header-align="center"
-        align="center"
-        min-width="160"
-        :show-tooltip-when-overflow="true"
-        label="参数">
-      </el-table-column>
-      <el-table-column
-        prop="status"
-        header-align="center"
-        align="center"
-        label="状态">
-        <template slot-scope="scope">
-          <el-tag v-if="Number(scope.row.status) === 0" size="small">成功</el-tag>
-          <el-tag v-else @click.native="showErrorInfo(scope.row.logId)" size="small" type="danger" style="cursor: pointer;">失败</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="times"
-        header-align="center"
-        align="center"
-        label="耗时(单位: 毫秒)">
-      </el-table-column>
-      <el-table-column
-        prop="createTime"
-        header-align="center"
-        align="center"
-        min-width="160"
-        label="执行时间">
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      @size-change="sizeChangeHandle"
-      @current-change="currentChangeHandle"
-      :current-page="pageIndex"
-      :page-sizes="[10, 20, 50, 100]"
-      :page-size="pageSize"
-      :total="totalPage"
-      layout="total, sizes, prev, pager, next, jumper">
-    </el-pagination>
-  </el-dialog>
+    <div>
+      <div class="my-title">日志列表</div>
+      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
+        <el-form-item>
+          <el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="getDataList()">查询</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table
+        :data="dataList"
+        border
+        v-loading="dataListLoading"
+        height="542"
+        style="width: 100%;">
+        <el-table-column
+          prop="logId"
+          header-align="center"
+          align="center"
+          min-width="100"
+          :show-tooltip-when-overflow="true"
+          label="日志ID">
+        </el-table-column>
+        <el-table-column
+          prop="jobId"
+          header-align="center"
+          align="center"
+          min-width="100"
+          :show-tooltip-when-overflow="true"
+          label="任务ID">
+        </el-table-column>
+        <el-table-column
+          prop="beanName"
+          header-align="center"
+          align="center"
+          min-width="120"
+          :show-tooltip-when-overflow="true"
+          label="bean名称">
+        </el-table-column>
+        <el-table-column
+          prop="params"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="参数">
+        </el-table-column>
+        <el-table-column
+          prop="status"
+          header-align="center"
+          align="center"
+          label="状态">
+          <template slot-scope="scope">
+            <el-tag v-if="Number(scope.row.status) === 0" size="small">成功</el-tag>
+            <el-tag v-else @click.native="showErrorInfo(scope.row.logId)" size="small" type="danger" style="cursor: pointer;">失败</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="times"
+          header-align="center"
+          align="center"
+          label="耗时(单位: 毫秒)">
+        </el-table-column>
+        <el-table-column
+          prop="createTime"
+          header-align="center"
+          align="center"
+          min-width="160"
+          label="执行时间">
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="sizeChangeHandle"
+        @current-change="currentChangeHandle"
+        :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        :total="totalPage"
+        layout="total, sizes, prev, pager, next, jumper">
+      </el-pagination>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="onChose">关闭</el-button>
+      </span>
+    </div>
 </template>
 
 <script>
   export default {
     data () {
       return {
-        visible: false,
         dataForm: {
           id: ''
         },
@@ -102,8 +101,10 @@
       }
     },
     methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
       init () {
-        this.visible = true
         this.getDataList()
       },
       // 获取数据列表

+ 3 - 2
src/views/modules/job/schedule.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="mod-schedule">
-    <template v-if="!addOrUpdateVisible">
+    <template v-if="!addOrUpdateVisible && !logVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
         <el-form-item>
           <el-input v-model="dataForm.beanName" placeholder="bean名称" clearable></el-input>
@@ -105,7 +105,7 @@
     <!-- 弹窗, 新增 / 修改 -->
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"  @onChose="onChose"></add-or-update>
     <!-- 弹窗, 日志列表 -->
-    <log v-if="logVisible" ref="log"></log>
+    <log v-if="logVisible" ref="log" @onChose="onChose"></log>
   </div>
 </template>
 
@@ -182,6 +182,7 @@
       },
       onChose () {
         this.addOrUpdateVisible = false
+        this.logVisible = false
       },
       // 删除
       deleteHandle (id) {

+ 2 - 1
src/views/modules/production/scheduling.vue

@@ -240,10 +240,11 @@
       closeDialogEvent () {
         this.detailsVisible = false
       },
+      // 委外生产
       outsourceHandle (id) {
         this.outsourceVisible = true
         this.$nextTick(() => {
-          this.$refs.outsource.init(id)
+          this.$refs.outsource.init(id, 2)
         })
       }
     }

+ 5 - 3
src/views/modules/sale/outsource-add-or-update.vue

@@ -61,7 +61,7 @@
 
 <script>
   import UploadComponent from '../common/upload-component'
-  import { getContractDetail } from '@/api/sale'
+  import { getOutsourceDetail, getOutsourceDetailByProId } from '@/api/sale'
 
 export default {
     name: 'contract-add-or-update',
@@ -76,6 +76,7 @@ export default {
     data () {
       return {
         id: 0,
+        idType: 0, // ID类型:1 委外ID,2 排产ID
         dataForm: {},
         dataRule: {
           // reCode: [{ required: true, message: '请选择合同评审编码', trigger: 'change' }],
@@ -90,13 +91,14 @@ export default {
       onChose () {
         this.$emit('onChose')
       },
-      async init (id) {
+      async init (id, type) {
+        this.idType = type || 1
         this.fileList = []
         this.dataForm = {}
         this.id = id || 0
         // 详情
         if (!id) return
-        await getContractDetail(this.id).then(({data}) => {
+        await (this.idType === 1 ? getOutsourceDetail(this.id) : getOutsourceDetailByProId(this.id)).then(({data}) => {
           if (data && data.code === '200') {
             this.dataForm = data.data
             // 附件

+ 6 - 4
src/views/modules/sale/outsource-detail.vue

@@ -32,9 +32,9 @@
           </el-checkbox-group>
         </e-desc-item>
 
-        <e-desc-item label="委外类别">{{dataForm.commissionType}}</e-desc-item>
-        <e-desc-item label="申请人">{{dataForm.purchaseCommission.applierId}}</e-desc-item>
-        <e-desc-item label="申请部门">{{dataForm.purchaseCommission.orgId}}</e-desc-item>
+        <e-desc-item label="委外类别">{{dataForm.commissionTypeName}}</e-desc-item>
+        <e-desc-item label="申请人">{{dataForm.purchaseCommission?dataForm.purchaseCommission.applier:''}}</e-desc-item>
+        <e-desc-item label="申请部门">{{dataForm.purchaseCommission?dataForm.purchaseCommission.orgName:''}}</e-desc-item>
 
         <e-desc-item label="备注说明" span="3">{{dataForm.notes}}</e-desc-item>
       </e-desc>
@@ -231,7 +231,7 @@
       },
       getDetails (businessType) {
         getOutsourceDetail(this.id).then(({data}) => {
-          if (data && data.code === '200') {
+          if (data && data.code === '200' && data.data) {
             this.dataForm = data.data
             // 流程图展示
             if (data.data.workFlowBusinessExt) {
@@ -249,6 +249,8 @@
             }
             // 初始化审批Form
             this.showApproveForm(businessType, this.id)
+          } else {
+            this.onChose()
           }
         })
       },

+ 3 - 3
src/views/modules/sale/outsource.vue

@@ -83,7 +83,7 @@
           label="产品编号">
         </el-table-column>
         <el-table-column
-          prop="commissionType"
+          prop="commissionTypeName"
           header-align="center"
           align="center"
           min-width="140"
@@ -179,7 +179,7 @@
           label="申请时间">
         </el-table-column>
         <el-table-column
-          prop="purchaseCommission.applierId"
+          prop="purchaseCommission.applier"
           header-align="center"
           align="center"
           min-width="140"
@@ -187,7 +187,7 @@
           label="申请人">
         </el-table-column>
         <el-table-column
-          prop="purchaseCommission.orgId"
+          prop="purchaseCommission.orgName"
           header-align="center"
           align="center"
           min-width="140"