Explorar o código

修改产品项目管理功能

landydb hai 4 semanas
pai
achega
7037793a34

+ 70 - 0
src/views/modules/tech/project-product-detail.vue

@@ -0,0 +1,70 @@
+<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.projectName }}</e-desc-item>
+        <e-desc-item label="任务号">{{ dataForm.orderCode }}</e-desc-item>
+        <e-desc-item label="物料名称">{{ dataForm.productName }}</e-desc-item>
+       
+        <e-desc-item label="状态">{{ dataForm.stateStr }}</e-desc-item>
+        <e-desc-item label="合同交期">{{ dataForm.deliveryDate }}</e-desc-item>
+
+      </e-desc>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">返回</el-button>
+    </span>
+
+    <!-- 文件预览 -->
+    <preview-component v-if="previewVisible" ref="preview"/>
+  </div>
+</template>
+
+<script>
+import EDesc from '../common/e-desc'
+import EDescItem from '../common/e-desc-item'
+import PreviewComponent from '../common/preview-component'
+export default {
+  name: 'file-manage-detail',
+  components: {
+    EDesc,
+    EDescItem,
+    PreviewComponent
+  },
+  data () {
+    return {
+      visible: false,
+      id: 0,
+      dataForm: {},
+      previewVisible: false
+    }
+  },
+  methods: {
+    onChose () {
+      this.$emit('onChose')
+    },
+    async init (item) {
+      this.visible = true
+      this.dataForm = item
+    },
+     // 预览
+    previewFile (fileName, url) {
+      this.previewVisible = true
+      this.$nextTick(() => {
+        this.$refs.preview.init(fileName, url)
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.my-line {
+  border-bottom: 1px solid #c0c4cc;
+  margin-bottom: 10px;
+}
+.title {
+  padding: 10px 0;
+}
+</style>

+ 93 - 0
src/views/modules/tech/project-product-notice-change-setting.vue

@@ -0,0 +1,93 @@
+<template>
+    <div>
+        <div class="my-title">发货通知人设置</div>
+        <!-- 表单 -->
+        <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+          <el-row class="my-row">
+            <el-form-item label="通知接收人" prop="userIds">
+              <user-components v-model="dataForm.userIds" :userIds="dataForm.userIds" @change="userSelectedChanged"/>
+            </el-form-item>
+          </el-row>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="onChose">取消</el-button>
+          <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
+        </span>
+    </div>
+</template>
+
+<script>
+  import UserComponents from '../common/user-components'
+
+export default {
+    name: 'dispatch-notice-change-setting',
+    components: {
+      UserComponents
+    },
+    data () {
+      return {
+        visible: false,
+        dataForm: {
+          userIds: []
+        },
+        dataRule: {
+          userIds: [{ required: true, message: '请选择通知接收人', trigger: 'change' }]
+        }
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init () {
+        this.dataForm = {}
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/projProduct/noteChangeConfig`),
+          method: 'get'
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = {
+              userIds: data.data
+            }
+          }
+        })
+        this.visible = true
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/projProduct/noteChangeConfig`),
+              method: 'post',
+              data: this.dataForm.userIds
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.onChose()
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      },
+      userSelectedChanged (val) {
+        this.dataForm.userIds = val
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 19 - 4
src/views/modules/tech/project-product.vue

@@ -1,7 +1,7 @@
 <!-- 工种管理 -->
 <template>
   <div class="work-type">
-    <template v-if="!addOrUpdateVisible && !detailVisible && !assignVisible && !selectionVisible">
+    <template v-if="!addOrUpdateVisible && !detailVisible && !assignVisible && !selectionVisible && !noticeChangeVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
         <el-form-item label="项目名称">
           <el-input v-model="dataForm.projectName" placeholder="" clearable/>
@@ -14,7 +14,7 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="queryData()">查询</el-button>
-          <!-- <el-button type="primary" @click="addOrUpdateHandle(null, false)">新建</el-button> -->
+          <el-button @click="noticeSettingHandle(null, false)">通知设置</el-button>
         </el-form-item>
       </el-form>
       <el-table
@@ -97,6 +97,7 @@
     <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
     <assign v-if="assignVisible" ref="assign" @onChose="onChose"/>
     <selection v-if="selectionVisible" ref="selection" @onChose="onChose"/>
+    <notice-change v-if="noticeChangeVisible" ref="noticeChange" @onChose="onChose"/>
 
     <el-dialog title="导入" :visible.sync="importVisible">
       <el-upload
@@ -121,10 +122,11 @@
   import Detail from './project-product-detail'
   import Assign from './project-product-assign'
   import Selection from './project-product-selection'
+  import NoticeChange from './project-product-notice-change-setting'
   export default {
     name: 'file-manage',
     components: {
-      Detail, Assign, Selection
+      Detail, Assign, Selection, NoticeChange
     },
     data () {
       return {
@@ -133,6 +135,7 @@
         assignVisible: false,
         selectionVisible: false,
         importVisible: false,
+        noticeChangeVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -159,6 +162,7 @@
         this.detailVisible = false
         this.assignVisible = false
         this.selectionVisible = false
+        this.noticeChangeVisible = false
       },
       // 查询
       queryData () {
@@ -216,6 +220,7 @@
       // 详情
       detailHandle (item) {
         this.detailVisible = true
+        item.stateStr = this.getStateStr(item.state)
         this.$nextTick(() => {
           this.$refs.detail.init(item)
         })
@@ -278,11 +283,21 @@
       },
       formatState (row) {
         if (!row.state) return ''
-        let option = this.stateOption.find(t => t.value === row.state)
+        
+        return this.getStateStr(row.state)
+      },
+      getStateStr(state){
+        let option = this.stateOption.find(t => t.value === state)
         if (option != null) {
           return option.label
         }
         return ''
+      },
+      noticeSettingHandle(){
+        this.noticeChangeVisible = true
+        this.$nextTick(() => {
+          this.$refs.noticeChange.init()
+        })
       }
     }
   }