Browse Source

研发任务新增列:责任人

liqianyi 3 weeks ago
parent
commit
1d3114a7ac

+ 4 - 3
src/components/work-flow/node-edit-final-check.vue

@@ -93,7 +93,8 @@
           </el-table-column>
           <el-table-column prop="allowValues" label="允许值">
             <template slot-scope="scope">
-              <el-form-item :prop="'prodProductionRequireList.' + scope.$index + '.allowValues'" :rules="rules.allowValues" label-width="0px">
+              <el-form-item :prop="'prodProductionRequireList.' + scope.$index + '.allowValues'"
+                :rules="rules.allowValues" label-width="0px">
                 <el-input v-model="scope.row.allowValues" :disabled="disabled || selectOperator || isEdit"></el-input>
               </el-form-item>
             </template>
@@ -166,7 +167,7 @@ export default {
         workTypeId: '',
         operatorId: [],
         prodProductionRequireList: [{
-          allowValues:''
+          allowValues: ''
         }],
         planCompletionTime: ''
       },
@@ -351,7 +352,7 @@ export default {
     },
 
     addRow() {
-      this.form.prodProductionRequireList.push({allowValues:''})
+      this.form.prodProductionRequireList.push({ allowValues: '' })
     },
     removeRow(index) {
       this.form.prodProductionRequireList.splice(index, 1)

+ 212 - 260
src/views/modules/tech/project-product.vue

@@ -1,16 +1,17 @@
 <!-- 工种管理 -->
 <template>
   <div class="work-type">
-    <template v-if="!addOrUpdateVisible && !detailVisible && !assignVisible && !selectionVisible && !noticeChangeVisible">
+    <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/>
+          <el-input v-model="dataForm.projectName" placeholder="" clearable />
         </el-form-item>
         <el-form-item label="任务号">
-          <el-input v-model="dataForm.orderCode" placeholder="" clearable/>
+          <el-input v-model="dataForm.orderCode" placeholder="" clearable />
         </el-form-item>
-         <el-form-item label="责任人">
-          <el-input v-model="dataForm.responsibilityPerson" placeholder="" clearable/>
+        <el-form-item label="责任人">
+          <el-input v-model="dataForm.responsibilityPerson" placeholder="" clearable />
         </el-form-item>
         <el-form-item>
           <el-button @click="queryData()">查询</el-button>
@@ -18,297 +19,248 @@
           <el-button type="primary" @click="templateDownload">清单模板下载</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="100"
-          align="center">
+      <el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
+        <el-table-column label="序号" type="index" width="100" align="center">
         </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 prop="projectName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="项目名称">
         </el-table-column>
-        <el-table-column
-          prop="orderCode"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="任务号">
+        <el-table-column prop="orderCode" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="任务号">
         </el-table-column>
-        <el-table-column
-          prop="productName"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="物料名称">
+        <el-table-column prop="productName" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="物料名称">
         </el-table-column>
-        <el-table-column
-          prop="state"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          :formatter="formatState"
-          label="状态">
+        <el-table-column prop="responsibilityPersonName" header-align="center" align="center" min-width="120"
+          :show-tooltip-when-overflow="true" label="责任人">
         </el-table-column>
-        <el-table-column
-          prop="deliveryDate"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="合同交期">
+        <el-table-column prop="state" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" :formatter="formatState" label="状态">
         </el-table-column>
-        <el-table-column
-          fixed="right"
-          header-align="center"
-          align="center"
-          width="220"
-          label="操作">
+        <el-table-column prop="deliveryDate" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="合同交期">
+        </el-table-column>
+        <el-table-column fixed="right" header-align="center" align="center" width="220" label="操作">
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
-            <el-button v-if="scope.row.state == 1" type="text" size="small" @click="assignHandle(scope.row)">分派</el-button>
-            <el-button v-if="scope.row.state == 1" type="text" size="small" @click="selectionHandle(scope.row, false)">选择清单</el-button>
-            <el-button v-if="scope.row.state == 1" type="text" size="small" @click="importHandle(scope.row)">导入</el-button>
+            <el-button v-if="scope.row.state == 1" type="text" size="small"
+              @click="assignHandle(scope.row)">分派</el-button>
+            <el-button v-if="scope.row.state == 1" type="text" size="small"
+              @click="selectionHandle(scope.row, false)">选择清单</el-button>
+            <el-button v-if="scope.row.state == 1" type="text" size="small"
+              @click="importHandle(scope.row)">导入</el-button>
           </template>
         </el-table-column>
       </el-table>
-      <el-pagination
-        @size-change="sizeChangeHandle"
-        @current-change="currentChangeHandle"
-        :current-page="pageIndex"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="pageSize"
-        :total="totalPage"
+      <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
         layout="total, sizes, prev, pager, next, jumper">
       </el-pagination>
     </template>
     <!-- 弹窗, 新增 / 修改 -->
-    <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"/>
+    <detail v-if="detailVisible" ref="detail" @onChose="onChose" />
+    <assign v-if="assignVisible" ref="assign" @onChose="onChose" @refreshDataList="getDataList" />
+    <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
-        class="upload-demo"
-        ref="upload"
-        :on-remove="handleRemove"
-        action="#"
-        :limit="1"
-        :file-list="fileList"
-        :auto-upload="false"
-        :http-request="handleUpload"
-        v-loading="importLoading"
-        >
+      <el-upload class="upload-demo" ref="upload" :on-remove="handleRemove" action="#" :limit="1" :file-list="fileList"
+        :auto-upload="false" :http-request="handleUpload" v-loading="importLoading">
         <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-        <el-button size="small" type="success" @click="submitUpload" >开始上传</el-button>
+        <el-button size="small" type="success" @click="submitUpload">开始上传</el-button>
       </el-upload>
     </el-dialog>
   </div>
 </template>
 
 <script>
-  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'
-  import Vue from 'vue'
-  export default {
-    name: 'file-manage',
-    components: {
-      Detail, Assign, Selection, NoticeChange
+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'
+import Vue from 'vue'
+export default {
+  name: 'file-manage',
+  components: {
+    Detail, Assign, Selection, NoticeChange
+  },
+  data() {
+    return {
+      addOrUpdateVisible: false,
+      detailVisible: false,
+      assignVisible: false,
+      selectionVisible: false,
+      importVisible: false,
+      noticeChangeVisible: false,
+      dataForm: {},
+      dataList: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPage: 0,
+      dataListLoading: false,
+      dataListSelections: [],
+      optionsLevel: [],
+      importLoading: false,
+      importData: {},
+      fileList: [],
+      stateOption: [
+        { label: '待处理', value: '1' },
+        { label: '已处理', value: '2' }
+      ]
+    }
+  },
+  created() {
+    this.getDataList()
+  },
+  methods: {
+    onChose() {
+      this.addOrUpdateVisible = false
+      this.detailVisible = false
+      this.assignVisible = false
+      this.selectionVisible = false
+      this.noticeChangeVisible = false
     },
-    data () {
-      return {
-        addOrUpdateVisible: false,
-        detailVisible: false,
-        assignVisible: false,
-        selectionVisible: false,
-        importVisible: false,
-        noticeChangeVisible: false,
-        dataForm: {},
-        dataList: [],
-        pageIndex: 1,
-        pageSize: 10,
-        totalPage: 0,
-        dataListLoading: false,
-        dataListSelections: [],
-        optionsLevel: [],
-        importLoading: false,
-        importData: {},
-        fileList: [],
-        stateOption: [
-          {label: '待处理', value: '1'},
-          {label: '已处理', value: '2'}
-        ]
-      }
+    templateDownload() {
+      location.href = this.$http.adornUrl(`/biz-service/product/template/download?_token=${Vue.cookie.get('token')}`)
     },
-    created () {
+    // 查询
+    queryData() {
+      this.pageIndex = 1
       this.getDataList()
     },
-    methods: {
-      onChose () {
-        this.addOrUpdateVisible = false
-        this.detailVisible = false
-        this.assignVisible = false
-        this.selectionVisible = false
-        this.noticeChangeVisible = false
-      },
-      templateDownload () {
-        location.href = this.$http.adornUrl(`/biz-service/product/template/download?_token=${Vue.cookie.get('token')}`)
-      },
-      // 查询
-      queryData () {
-        this.pageIndex = 1
-        this.getDataList()
-      },
-      // 获取数据列表
-      getDataList () {
-        this.dataListLoading = true
-        this.addOrUpdateVisible = false
+    // 获取数据列表
+    getDataList() {
+      this.dataListLoading = true
+      this.addOrUpdateVisible = false
 
-        this.$http({
-          url: this.$http.adornUrl(`/biz-service/projProduct/list`),
-          method: 'get',
-          params: this.$http.adornParams({
-            'current': this.pageIndex,
-            'size': this.pageSize,
-            'orderCode': this.dataForm.orderCode,
-            'projectName': this.dataForm.projectName,
-            'responsibilityPerson': this.dataForm.responsibilityPerson
-          })
-        }).then(({data}) => {
-          this.dataListLoading = false
-          if (data && data.code === '200') {
-            this.dataList = data.data.records
-            this.totalPage = Number(data.data.total)
-          } else {
-            this.dataList = []
-            this.totalPage = 0
-          }
-        })
-      },
-      // 每页数
-      sizeChangeHandle (val) {
-        this.pageSize = val
-        this.pageIndex = 1
-        this.getDataList()
-      },
-      // 当前页
-      currentChangeHandle (val) {
-        this.pageIndex = val
-        this.getDataList()
-      },
-      // 多选
-      selectionChangeHandle (val) {
-        this.dataListSelections = val
-      },
-      // 新增 / 修改
-      addOrUpdateHandle (item, disable) {
-        this.addOrUpdateVisible = true
-        this.$nextTick(() => {
-          this.$refs.addOrUpdate.init(item, disable)
-        })
-      },
-      // 详情
-      detailHandle (item) {
-        this.detailVisible = true
-        item.stateStr = this.getStateStr(item.state)
-        this.$nextTick(() => {
-          this.$refs.detail.init(item)
-        })
-      },
-      assignHandle (item) {
-        this.assignVisible = true
-        this.$nextTick(() => {
-          this.$refs.assign.init(item)
-        })
-      },
-      selectionHandle (item) {
-        this.selectionVisible = true
-        this.$nextTick(() => {
-          this.$refs.selection.init(item)
+      this.$http({
+        url: this.$http.adornUrl(`/biz-service/projProduct/list`),
+        method: 'get',
+        params: this.$http.adornParams({
+          'current': this.pageIndex,
+          'size': this.pageSize,
+          'orderCode': this.dataForm.orderCode,
+          'projectName': this.dataForm.projectName,
+          'responsibilityPerson': this.dataForm.responsibilityPerson
         })
-      },
-      importHandle (item) {
-        this.importVisible = true
-        this.importData = item
-      },
-      // 上传
-      submitUpload () {
-        this.$refs.upload.submit()
-      },
-      // 移除
-      handleRemove (file, fileList) {
-        this.$emit('input', fileList)
-      },
-      handleUpload (file) {
-        if (file == null) {
-          this.$message.error('请上传文件')
-          return
+      }).then(({ data }) => {
+        this.dataListLoading = false
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
+        } else {
+          this.dataList = []
+          this.totalPage = 0
         }
+      })
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      this.pageSize = val
+      this.pageIndex = 1
+      this.getDataList()
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      this.pageIndex = val
+      this.getDataList()
+    },
+    // 多选
+    selectionChangeHandle(val) {
+      this.dataListSelections = val
+    },
+    // 新增 / 修改
+    addOrUpdateHandle(item, disable) {
+      this.addOrUpdateVisible = true
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(item, disable)
+      })
+    },
+    // 详情
+    detailHandle(item) {
+      this.detailVisible = true
+      item.stateStr = this.getStateStr(item.state)
+      this.$nextTick(() => {
+        this.$refs.detail.init(item)
+      })
+    },
+    assignHandle(item) {
+      this.assignVisible = true
+      this.$nextTick(() => {
+        this.$refs.assign.init(item)
+      })
+    },
+    selectionHandle(item) {
+      this.selectionVisible = true
+      this.$nextTick(() => {
+        this.$refs.selection.init(item)
+      })
+    },
+    importHandle(item) {
+      this.importVisible = true
+      this.importData = item
+    },
+    // 上传
+    submitUpload() {
+      this.$refs.upload.submit()
+    },
+    // 移除
+    handleRemove(file, fileList) {
+      this.$emit('input', fileList)
+    },
+    handleUpload(file) {
+      if (file == null) {
+        this.$message.error('请上传文件')
+        return
+      }
 
-        this.importLoading = true
-
-        const formData = new FormData()
-        formData.append('importFile', file.file)
-        formData.append('productTechnologyId', this.importData.productTechnologyId)
-        this.$http({
-          url: this.$http.adornUrl(`/biz-service/projProduct/importExcel`),
-          method: 'POST',
-          data: formData,
-          timeout: 0
-        }).then(({data}) => {
-          this.importLoading = false
-          if (data && data.code === '200') {
-            this.$message({
-              message: '导入成功',
-              type: 'success',
-              duration: 1500,
-              onClose: () => {
-                this.importVisible = false
-                this.getDataList()
-              }
-            })
-          } else {
-            this.$message.error(data.msg)
-          }
-        })
-      },
-      formatState (row) {
-        if (!row.state) return ''
+      this.importLoading = true
 
-        return this.getStateStr(row.state)
-      },
-      getStateStr (state) {
-        let option = this.stateOption.find(t => t.value === state)
-        if (option != null) {
-          return option.label
+      const formData = new FormData()
+      formData.append('importFile', file.file)
+      formData.append('productTechnologyId', this.importData.productTechnologyId)
+      this.$http({
+        url: this.$http.adornUrl(`/biz-service/projProduct/importExcel`),
+        method: 'POST',
+        data: formData,
+        timeout: 0
+      }).then(({ data }) => {
+        this.importLoading = false
+        if (data && data.code === '200') {
+          this.$message({
+            message: '导入成功',
+            type: 'success',
+            duration: 1500,
+            onClose: () => {
+              this.importVisible = false
+              this.getDataList()
+            }
+          })
+        } else {
+          this.$message.error(data.msg)
         }
-        return ''
-      },
-      noticeSettingHandle () {
-        this.noticeChangeVisible = true
-        this.$nextTick(() => {
-          this.$refs.noticeChange.init()
-        })
+      })
+    },
+    formatState(row) {
+      if (!row.state) return ''
+
+      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()
+      })
     }
   }
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>