Selaa lähdekoodia

特殊过程管理

damon227 1 vuosi sitten
vanhempi
commit
ec14ede7cf

+ 0 - 8
src/api/process.js

@@ -8,11 +8,3 @@ export function getList (params) {
     params: params
   })
 }
-
-// 特殊过程详情
-export function getDetail (programId) {
-  return request({
-    url: request.adornUrl(`/biz-service/pro-crux-course/info/${programId}`),
-    method: 'get'
-  })
-}

+ 17 - 14
src/views/modules/tech-manage/process-add-or-update.vue

@@ -27,13 +27,13 @@
               :remote-method="productRemoteQuery"
               clearable
               :loading="loading"
-              style="width:100%"
+              style="width: 100%"
             >
               <el-option
                 v-for="item in materialList"
                 :key="item.productId"
-              :label="item.productName"
-              :value="item.productId"
+                :label="item.productName"
+                :value="item.productId"
               >
               </el-option>
             </el-select>
@@ -61,9 +61,9 @@
       </el-row>
       <el-row class="my-row">
         <el-col :span="8">
-        <el-form-item label="附件" prop="attachList">
-          <upload-component :accept="'*'" v-model="dataForm.attachList" />
-        </el-form-item>
+          <el-form-item label="附件" prop="attachList">
+            <upload-component :accept="'*'" v-model="dataForm.attachList" />
+          </el-form-item>
         </el-col>
       </el-row>
     </el-form>
@@ -95,9 +95,7 @@ export default {
       fileList: [],
       materialList: [],
       dataRule: {
-        cruxCode: [
-          { required: true, message: '请输入编码', trigger: 'blur' }
-        ],
+        cruxCode: [{ required: true, message: '请输入编码', trigger: 'blur' }],
         productId: [
           { required: true, message: '请选择物料名称', trigger: 'change' }
         ],
@@ -115,14 +113,21 @@ export default {
     onChose () {
       this.$emit('onChose')
     },
-    async init (id, display) {
+    async init (id, item) {
       this.id = id || 0
+      if (id) {
+        this.dataForm = { ...item }
+      }
       this.$refs['dataForm'].resetFields()
       this.materialList = []
       await this.getProductList()
     },
     async getProductList (productName) {
-      await getProductList({current: 1, size: 100, productName: productName}).then(({ data }) => {
+      await getProductList({
+        current: 1,
+        size: 100,
+        productName: productName
+      }).then(({ data }) => {
         if (data && data.code === '200') {
           this.materialList = data.data.records
         }
@@ -139,9 +144,7 @@ export default {
           this.$http({
             url: !this.id
               ? this.$http.adornUrl(`/biz-service/pro-crux-course/save`)
-              : this.$http.adornUrl(
-                  `/biz-service/pro-crux-course/update`
-                ),
+              : this.$http.adornUrl(`/biz-service/pro-crux-course/update`),
             method: 'post',
             data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
           }).then(({ data }) => {

+ 91 - 0
src/views/modules/tech-manage/process-change.vue

@@ -0,0 +1,91 @@
+<template>
+  <div>
+    <div class="my-title">变更</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      @keyup.enter.native="dataFormSubmit()"
+      label-width="120px"
+    >
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="变更内容" prop="cruxAlter">
+            <el-input
+              v-model="dataForm.cruxAlter"
+              type="textarea"
+              placeholder="请输入变更内容"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="附件" prop="changeList">
+            <upload-component :accept="'*'" v-model="dataForm.changeList" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import UploadComponent from '../common/upload-component-v2'
+export default {
+  name: 'process-change',
+  components: {UploadComponent},
+  data () {
+    return {
+      dataForm: {
+        cruxAlter: '',
+        changeList: []
+      },
+      dataRule: {
+        changeList: [{required: true, message: '请选择变更单', trigger: 'change'}]
+      }
+    }
+  },
+  mounted () {},
+  methods: {
+    init (id) {
+      this.dataForm.cruxId = id
+    },
+    onChose () {
+      this.$emit('onChose')
+    },
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/pro-crux-course/update`),
+            method: 'post',
+            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
+          }).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)
+            }
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 63 - 0
src/views/modules/tech-manage/process-detail.vue

@@ -0,0 +1,63 @@
+<template>
+  <div>
+    <div class="my-title">详情</div>
+    <div style="margin-left: 20px; margin-right: 20px">
+      <e-desc title="基本信息" column="3">
+        <e-desc-item label="方案编码">{{ dataForm.optionCode }}</e-desc-item>
+        <e-desc-item label="物料名称">{{ dataForm.materialName }}</e-desc-item>
+        <e-desc-item label="方案名称">{{ dataForm.optionName }}</e-desc-item>
+        <e-desc-item label="备注说明" span="3">{{
+          dataForm.remark
+        }}</e-desc-item>
+      </e-desc>
+      <e-desc title="附件">
+        <upload-component
+          :display="true"
+          :display-title="false"
+          :accept="'*'"
+          v-model="dataForm.attachList"
+        />
+      </e-desc>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">返回</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import EDesc from '../common/e-desc'
+import EDescItem from '../common/e-desc-item'
+import UploadComponent from '../common/upload-component-v2'
+export default {
+  name: 'process-detail',
+  components: {EDesc, EDescItem, UploadComponent},
+  data () {
+    return {
+      id: 0,
+      isEdit: false,
+      dataForm: {
+        optionCode: '',
+        productId: '',
+        optionName: '',
+        remark: ''
+      }
+    }
+  },
+  mounted () {},
+  methods: {
+    onChose () {
+      this.$emit('onChose')
+    },
+    async init (id, item) {
+      this.id = id || 0
+      if (id) {
+        this.dataForm = {...item}
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 44 - 7
src/views/modules/tech-manage/process-manage.vue

@@ -5,6 +5,7 @@
         !addOrUpdateVisible &&
         !detailVisible &&
         !noteChangeVisible &&
+        !changeVisible &&
         !attachVisible
       "
     >
@@ -179,21 +180,21 @@
               v-if="isAuth('process-manage:list')"
               type="text"
               size="small"
-              @click="detailHandle(scope.row.optionId)"
+              @click="detailHandle(scope.row.cruxId)"
               >查看</el-button
             >
             <el-button
               v-if="isAuth('process-manage:update')"
               type="text"
               size="small"
-              @click="addOrUpdateHandle(scope.row.optionId, false)"
+              @click="addOrUpdateHandle(scope.row)"
               >编辑</el-button
             >
             <el-button
               v-if="isAuth('process-manage:change')"
               type="text"
               size="small"
-              @click="addOrUpdateHandle(scope.row.optionId, false)"
+              @click="changeHandle(scope.row.cruxId)"
               >变更</el-button
             >
           </template>
@@ -210,12 +211,16 @@
       >
       </el-pagination>
     </template>
+    <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
     <process-add-or-update
       ref="addOrUpdate"
       v-if="addOrUpdateVisible"
       @onChose="onChose"
       @refreshDataList="search"
-    ></process-add-or-update>
+    />
+    <process-detail v-if="detailVisible" ref="detail" @onChose="onChose" />
+    <process-change v-if="changeVisible" ref="change" @onChose="onChose" />
+    <note-change ref="noteChange" v-if="noteChangeVisible" @onChose="onChose"></note-change>
   </div>
 </template>
 
@@ -223,14 +228,20 @@
 import { getProductList } from '@/api/product'
 import {getList} from '@/api/process'
 import ProcessAddOrUpdate from './process-add-or-update.vue'
+import AttachDetail from '../common/attach-detail'
+import ProcessDetail from './process-detail'
+import ProcessChange from './process-change'
+import NoteChange from './material-tech-note-change'
+
 export default {
   name: 'tech-manage-process-manage',
-  components: {ProcessAddOrUpdate},
+  components: {ProcessAddOrUpdate, AttachDetail, ProcessDetail, ProcessChange, NoteChange},
   data () {
     return {
       addOrUpdateVisible: false,
       detailVisible: false,
       noteChangeVisible: false,
+      changeVisible: false,
       attachVisible: false,
       loading: false,
       materialList: [],
@@ -244,6 +255,7 @@ export default {
   },
   created () {
     this.getProductList()
+    this.getDataList()
   },
   mounted () {},
   activated () {},
@@ -253,6 +265,7 @@ export default {
       this.addOrUpdateVisible = false
       this.detailVisible = false
       this.noteChangeVisible = false
+      this.changeVisible = false
       this.attachVisible = false
     },
     async getProductList (productName) {
@@ -306,10 +319,34 @@ export default {
         this.dataListLoading = false
       })
     },
-    addOrUpdateHandle (id) {
+    detailHandle (id) {
+      this.detailVisible = true
+      this.$nextTick(() => {
+        this.$refs.detail.init(id)
+      })
+    },
+    addOrUpdateHandle (item) {
       this.addOrUpdateVisible = true
       this.$nextTick(() => {
-        this.$refs.addOrUpdate.init(id)
+        this.$refs.addOrUpdate.init(item.cruxId, item)
+      })
+    },
+    attachDetails (attachList) {
+      this.attachVisible = true
+      this.$nextTick(() => {
+        this.$refs.attachDetail.init(attachList)
+      })
+    },
+    changeHandle (id) {
+      this.changeVisible = true
+      this.$nextTick(() => {
+        this.$refs.change.init(id)
+      })
+    },
+    noteChange () {
+      this.noteChangeVisible = true
+      this.$nextTick(() => {
+        this.$refs.noteChange.init()
       })
     }
   }