Browse Source

Merge remote-tracking branch 'origin/master'

chrislee 1 year ago
parent
commit
c8630f5832

+ 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'
-  })
-}

+ 21 - 0
src/utils/enums.js

@@ -34,3 +34,24 @@ export const productTypeOption = [
     {label: '电装', value: '3'},
     {label: '混合', value: '4'}
 ]
+
+// 审批状态
+export const approveStateOption = [
+    {label: '待提交', value: '0'},
+    {label: '待审批', value: '1'},
+    {label: '审批中', value: '2'},
+    {label: '审批完成', value: '3'},
+    {label: '审批不通过', value: '4'}
+]
+
+// 项目状态
+export const projectStateOption = [
+    {label: '待报价', value: '1'},
+    {label: '报价中', value: '2'},
+    {label: '初次报价完成', value: '3'},
+    {label: '精确报价完成', value: '4'},
+    {label: '报价取消', value: '5'},
+    {label: '报价成功', value: '6'},
+    {label: '初次重新报价', value: '7'},
+    {label: '精准重新报价', value: '8'}
+]

+ 22 - 1
src/views/modules/cus/quoted.vue

@@ -64,6 +64,9 @@
           :show-tooltip-when-overflow="true"
           label="项目类别"
         >
+          <template slot-scope="scope">
+            {{productTypeOption.find(t => t.value === scope.row.type).label}}
+          </template>
         </el-table-column>
         <el-table-column
           prop="materialCost"
@@ -190,6 +193,9 @@
           :show-tooltip-when-overflow="true"
           label="项目状态"
         >
+          <template slot-scope="scope">
+            {{projectStateOption.find(t => t.value === scope.row.state).label}}
+          </template>
         </el-table-column>
         <el-table-column
           prop="approveState"
@@ -199,6 +205,9 @@
           :show-tooltip-when-overflow="true"
           label="项目评估状态"
         >
+          <template slot-scope="scope">
+            {{approveStateOption.find(t => t.value === scope.row.approveState).label}}
+          </template>
         </el-table-column>
         <el-table-column
           fixed="right"
@@ -299,6 +308,7 @@
 import OrgComponent from '../common/org-component'
 import {getList} from '@/api/quoted'
 import QuotedAddOrUpdate from './quoted-add-or-update'
+import { productTypeOption, approveStateOption, projectStateOption } from '@/utils/enums'
 export default {
   name: 'cus-quoted',
   components: { OrgComponent, QuotedAddOrUpdate },
@@ -306,6 +316,9 @@ export default {
     return {
       addOrUpdateVisible: false,
       detailVisible: false,
+      productTypeOption: productTypeOption,
+      approveStateOption: approveStateOption,
+      projectStateOption: projectStateOption,
       dataForm: {},
       dataList: [],
       pageIndex: 1,
@@ -314,7 +327,9 @@ export default {
       dataListLoading: false
     }
   },
-  created () {},
+  created () {
+    this.getDataList()
+  },
   methods: {
     onChose () {
       this.addOrUpdateVisible = false
@@ -336,6 +351,7 @@ export default {
       this.getDataList()
     },
     getDataList () {
+      this.dataListLoading = true
       let param = {
         current: this.pageIndex,
         size: this.pageSize,
@@ -344,7 +360,12 @@ export default {
       getList(param).then(({data}) => {
         if (data && data.code === '200') {
           this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
+        } else {
+          this.dataList = []
+          this.totalPage = 0
         }
+        this.dataListLoading = false
       })
     },
     addOrUpdateHandle (id) {

+ 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()
       })
     }
   }