소스 검색

编程:分派、通知人管理

chrislee 1 주 전
부모
커밋
80e82ea330
3개의 변경된 파일229개의 추가작업 그리고 4개의 파일을 삭제
  1. 93 0
      src/views/modules/tech/program-assign.vue
  2. 97 0
      src/views/modules/tech/program-note-change.vue
  3. 39 4
      src/views/modules/tech/program.vue

+ 93 - 0
src/views/modules/tech/program-assign.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-col :span="24">
+          <el-form-item label="责任人" prop="responsibilityPerson">
+            <user-component v-model="dataForm.responsibilityPerson" :user-id="dataForm.responsibilityPerson"
+              @userSelected="selectChange" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button v-if="!display" type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import UserComponent from '../common/user-component'
+export default {
+  name: 'program-assign',
+  components: { UserComponent },
+  computed: {},
+  data() {
+    return {
+      visible: false,
+      id: 0,
+      dataForm: {},
+      dataRule: {
+        responsibilityPerson: [
+          {
+            required: true,
+            message: '请选择责任人',
+            trigger: 'blur'
+          }
+        ]
+      }
+    }
+  },
+  created() { },
+  beforeDestroy() { },
+  methods: {
+    onChose() {
+      this.$emit('onChose')
+    },
+    async init(item) {
+      this.dataForm = item
+      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/proProgram/assign`),
+            method: 'post',
+            data: this.$http.adornData({ ...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)
+            }
+          })
+        }
+      })
+    },
+    selectChange(val) {
+      this.dataForm.responsibilityPerson = val
+    }
+  }
+}
+</script>
+
+<style scoped>
+.my-row {
+  margin-bottom: 20px;
+}
+</style>

+ 97 - 0
src/views/modules/tech/program-note-change.vue

@@ -0,0 +1,97 @@
+<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.sync="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: 'program-note-change',
+  components: {
+    UserComponents
+  },
+  data() {
+    return {
+      visible: false,
+      dataForm: {
+        userIds: []
+      },
+      dataRule: {
+        userIds: [
+          { required: true, message: '请选择通知接收人', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  created() { },
+  methods: {
+    onChose() {
+      this.$emit('onChose')
+    },
+    async init() {
+      this.dataForm = {}
+      this.$http({
+        url: this.$http.adornUrl(
+          `/biz-service/proProgram/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/proProgram/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>

+ 39 - 4
src/views/modules/tech/program.vue

@@ -1,7 +1,7 @@
 <!-- 数控程序管理 -->
 <template>
   <div>
-    <template v-if="!addOrUpdateVisible && !detailVisible">
+    <template v-if="!addOrUpdateVisible && !detailVisible && !assignVisible && !noteChangeVisible">
       <el-form :inline="true" :model="dataForm" label-width="80px" @keyup.enter.native="queryData()">
         <el-form-item label="项目名称">
           <el-input v-model="dataForm.projectName" placeholder="请输入项目名称" clearable />
@@ -23,10 +23,15 @@
         <el-form-item>
           <el-button @click="queryData()">查询</el-button>
           <el-button v-if="isAuth('pro:program:save')" type="primary" @click="addOrUpdateHandle(0)">新建</el-button>
+          <el-button v-if="isAuth('pro:program:noteChangeConfig')" type="primary"
+            @click="noteChange()">变更通知人设置</el-button>
         </el-form-item>
       </el-form>
       <el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%">
         <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
+        <el-table-column prop="programCode" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="编码">
+        </el-table-column>
         <el-table-column prop="projectName" header-align="center" align="center" min-width="140"
           :show-tooltip-when-overflow="true" label="项目名称">
         </el-table-column>
@@ -68,9 +73,11 @@
         <el-table-column prop="responsibilityPerson" header-align="center" align="center" min-width="100"
           :show-tooltip-when-overflow="true" label="责任人">
         </el-table-column>
-        <el-table-column fixed="right" header-align="center" align="center" width="90" label="操作">
+        <el-table-column fixed="right" header-align="center" align="center" width="135" label="操作">
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="showDetail(scope.row.programId)">查看</el-button>
+            <el-button v-if="isAuth('pro:program:assign') && Number(scope.row.state) === 1" type="text" size="small"
+              @click="showAssign(scope.row)">分派</el-button>
             <el-button v-if="isAuth('pro:program:updateProcessing') && Number(scope.row.state) === 1" type="text"
               size="small" @click="addOrUpdateHandle(scope.row.programId, 1)">处理</el-button>
             <el-button v-if="isAuth('pro:program:update') && Number(scope.row.state) === 2" type="text" size="small"
@@ -87,6 +94,8 @@
     <program-add-or-update ref="addOrUpdate" v-if="addOrUpdateVisible" @onChose="onChose"
       @refreshDataList="getDataList"></program-add-or-update>
     <program-detail ref="detail" v-if="detailVisible" @onChose="onChose"></program-detail>
+    <program-assign ref="assign" v-if="assignVisible" :programId="assignId" @close="onAssignClose"></program-assign>
+    <note-change ref="noteChange" v-if="noteChangeVisible" @onChose="onChose"></note-change>
   </div>
 </template>
 
@@ -96,20 +105,25 @@ import { getList } from '@/api/program'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 import ProgramAddOrUpdate from './program-add-or-update'
 import ProgramDetail from './program-detail'
+import ProgramAssign from './program-assign'
 import { isAuth } from '@/utils'
 import UserComponent from '@/views/modules/common/user-component.vue'
+import NoteChange from './program-note-change'
 export default {
   name: 'program',
   components: {
     UserComponent,
     AttachDetailDialog,
     ProgramAddOrUpdate,
-    ProgramDetail
+    ProgramDetail,
+    ProgramAssign,
+    NoteChange
   },
   data() {
     return {
       addOrUpdateVisible: false,
       detailVisible: false,
+      noteChangeVisible: false,
       dataForm: {},
       dataList: [],
       pageIndex: 1,
@@ -120,7 +134,9 @@ export default {
       optionsState: [
         { value: '1', label: '待处理' },
         { value: '2', label: '已处理' }
-      ]
+      ],
+      assignVisible: false,
+      assignId: null
     }
   },
   created() {
@@ -132,6 +148,8 @@ export default {
     onChose() {
       this.addOrUpdateVisible = false
       this.detailVisible = false
+      this.assignVisible = false
+      this.noteChangeVisible = false
     },
     getProductList() {
       let params = {
@@ -176,6 +194,23 @@ export default {
     attachDetails(attachList) {
       this.$refs.attachDetail.init(attachList)
     },
+    showAssign(row) {
+      this.assignVisible = true
+      this.$nextTick(() => {
+        this.$refs.assign.init(row)
+      })
+    },
+    onAssignClose() {
+      this.assignVisible = false
+      this.assignId = null
+      this.getDataList()
+    },
+    noteChange() {
+      this.noteChangeVisible = true
+      this.$nextTick(() => {
+        this.$refs.noteChange.init()
+      })
+    },
     // 每页数
     sizeChangeHandle(val) {
       this.pageSize = val