Ver Fonte

任务单管理

chris há 1 ano atrás
pai
commit
8c4de52028

+ 9 - 0
src/api/production.js

@@ -170,3 +170,12 @@ export function updateCheck (data) {
     data
   })
 }
+
+// 核料
+export function updatePreCheck (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/ProdProduction/examine`),
+    method: 'post',
+    data
+  })
+}

+ 84 - 56
src/views/modules/production/scheduling-pre-check.vue

@@ -33,71 +33,99 @@
 </template>
 
 <script>
-  import { updateCheck } from '@/api/production'
-  import MaterialComponent from '@/views/modules/common/material-component'
-  import UploadComponent from '@/views/modules/common/upload-component-v2'
+import {updatePreCheck} from '@/api/production'
+import MaterialComponent from '@/views/modules/common/material-component'
+import UploadComponent from '@/views/modules/common/upload-component'
 
 export default {
-    name: 'scheduling-pre-check',
-    components: {
-      UploadComponent,
-      MaterialComponent
-    },
-    data () {
-      return {
-        id: 0,
-        dataForm: {},
-        attachList: [],
-        attachListExamine: [],
-        dataRule: {
-        }
+  name: 'scheduling-pre-check',
+  components: {
+    UploadComponent,
+    MaterialComponent
+  },
+  data () {
+    return {
+      id: 0,
+      dataForm: {},
+      attachList: [],
+      attachListExamine: [],
+      dataRule: {
       }
+    }
+  },
+  methods: {
+    onChose () {
+      this.$emit('onChose')
+    },
+    async init (scheduleId) {
+      this.dataForm.id = scheduleId || 0
+    },
+    validateField (type) {
+      this.$refs.dataForm.validateField(type)
     },
-    methods: {
-      onChose () {
-        this.$emit('onChose')
-      },
-      async init (scheduleId, materialId) {
-        this.dataForm.id = scheduleId || ''
-        this.dataForm.materialId = materialId || ''
-      },
-      validateField (type) {
-        this.$refs.dataForm.validateField(type)
-      },
       // 表单提交
-      dataFormSubmit () {
-        this.$refs['dataForm'].validate((valid) => {
-          if (valid) {
-            if (this.dataForm.materialId === '') {
-              this.$message.error('请选择物品!')
-              return
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+            // 添加附件
+          let fList = this.attachList
+          if (fList.length > 0) {
+            this.dataForm.attachList = []
+            for (let i = 0; i < fList.length; i++) {
+              this.dataForm.attachList.push({
+                fileName: fList[i].name,
+                url: fList[i].url
+              })
             }
-            updateCheck(this.dataForm).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success',
-                  duration: 1500,
-                  onClose: () => {
-                    this.onChose()
-                    this.$emit('refreshDataList')
-                  }
-                })
-              } else {
-                this.$message.error(data.msg)
-              }
-            })
+          } else {
+            this.$message.error('请上传试制前准备状态检查报告')
+            return
           }
-        })
-      },
-      materialSelected (item) {
-        this.unitName = item.unitName
-        this.specifications = item.specifications
-        this.dataForm.cnt = item.cnt
-        this.dataForm.materialId = item.materialId
-      }
+          let fList2 = this.attachListExamine
+          if (fList2.length > 0) {
+            this.dataForm.attachListExamine = []
+            for (let i = 0; i < fList2.length; i++) {
+              this.dataForm.attachListExamine.push({
+                fileName: fList2[i].name,
+                url: fList2[i].url
+              })
+            }
+          } else {
+            this.$message.error('请上传试制前准备状态检查报告')
+            return
+          }
+          updatePreCheck(this.dataForm).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }
+      })
+    },
+    materialSelected (item) {
+      this.unitName = item.unitName
+      this.specifications = item.specifications
+      this.dataForm.cnt = item.cnt
+      this.dataForm.materialId = item.materialId
+    },
+    uploadSuccess1 (fileList) {
+      this.attachList = fileList
+    },
+    uploadSuccess2 (fileList) {
+      this.attachListExamine = fileList
     }
   }
+}
 </script>
 
 <style scoped>

+ 16 - 4
src/views/modules/production/scheduling.vue

@@ -1,7 +1,7 @@
 <!-- 任务处理中心 -->
 <template>
   <div class="production">
-    <template v-if="!detailsVisible && !outsourceVisible && !checkVisible">
+    <template v-if="!detailsVisible && !outsourceVisible && !checkVisible && !preCheckVisible">
       <el-header style="font-size: large;text-align: center">任务处理中心</el-header>
       <el-table
         :data="dataList"
@@ -129,8 +129,8 @@
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="check(scope.row)">核料</el-button>
             <el-button type="text" size="small" @click="check(scope.row.id)">转采购</el-button>
-            <el-button type="text" size="small" @click="check(scope.row.id)">转委外</el-button>
-            <el-button type="text" size="small" @click="check(scope.row.id)">试制前检查</el-button>
+            <el-button type="text" size="small" @click="outsourceHandle(scope.row.id)">转委外</el-button>
+            <el-button type="text" size="small" @click="preCheck(scope.row.id)">试制前检查</el-button>
             <el-button v-if="isAuth('prod:production:plan')" type="text" size="small" @click="detail(scope.row.id, true)">排产</el-button>
 <!--            <el-button v-if="isAuth('pur:commDetail:save') && Number(scope.row.outsourcing) === 0" type="text" size="small" @click="outsourceHandle(scope.row.id)">委外生产</el-button>-->
           </template>
@@ -152,6 +152,8 @@
     <outsource v-if="outsourceVisible" ref="outsource" @refreshDataList="getDataList" @onChose="onChose"/>
     <!-- 核料 -->
     <scheduling-check v-if="checkVisible" ref="check" @refreshDataList="getDataList" @onChose="onChose"/>
+    <!-- 试制前检查 -->
+    <scheduling-pre-check v-if="preCheckVisible" ref="preCheck" @refreshDataList="getDataList" @onChose="onChose"/>
   </div>
 </template>
 
@@ -160,14 +162,16 @@
   import Outsource from './scheduling-outsource'
   import { getSchedulingList } from '@/api/production'
   import SchedulingCheck from '@/views/modules/production/scheduling-check'
+  import SchedulingPreCheck from '@/views/modules/production/scheduling-pre-check'
   export default {
     name: 'scheduling',
-    components: {SchedulingCheck, Detail, Outsource},
+    components: {SchedulingPreCheck, SchedulingCheck, Detail, Outsource},
     data () {
       return {
         detailsVisible: false,
         outsourceVisible: false,
         checkVisible: false,
+        preCheckVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -236,6 +240,7 @@
         this.detailsVisible = false
         this.outsourceVisible = false
         this.checkVisible = false
+        this.preCheckVisible = false
       },
       // 查询
       queryPage () {
@@ -324,6 +329,13 @@
         this.$nextTick(() => {
           this.$refs.check.init(row.id, row.materialId)
         })
+      },
+      // 核料
+      preCheck (id) {
+        this.preCheckVisible = true
+        this.$nextTick(() => {
+          this.$refs.preCheck.init(id)
+        })
       }
     }
   }

+ 2 - 1
src/views/modules/sale/outsource-add-or-update.vue

@@ -311,7 +311,8 @@ export default {
                 ...this.dataForm,
                 purCommissionDetails: this.productDetails,
                 applierId: this.$store.state.user.id,
-                orgId: this.$store.state.user.orgId
+                orgId: this.$store.state.user.orgId,
+                type: 0
               })
             }).then(({data}) => {
               if (data && data.code === '200') {

+ 1 - 0
src/views/modules/sale/purchase-add-or-update.vue

@@ -219,6 +219,7 @@
           if (valid) {
             // 添加采购物品明细
             this.dataForm.purchaseDetails = this.materialDetails
+            this.dataForm.type = 0
             this.$http({
               url: this.$http.adornUrl(`/biz-service/purchaseDetail/${!this.id ? 'save' : 'update'}`),
               method: 'post',