|  | @@ -1,7 +1,7 @@
 | 
	
		
			
				|  |  |  <!-- 工种管理 -->
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  |    <div class="work-type">
 | 
	
		
			
				|  |  | -    <template v-if="!addOrUpdateVisible && !detailVisible">
 | 
	
		
			
				|  |  | +    <template v-if="!addOrUpdateVisible && !detailVisible && !assignVisible && !selectionVisible">
 | 
	
		
			
				|  |  |        <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
 | 
	
		
			
				|  |  |          <el-form-item label="项目名称">
 | 
	
		
			
				|  |  |            <el-input v-model="dataForm.projectName" placeholder="" clearable/>
 | 
	
	
		
			
				|  | @@ -68,9 +68,9 @@
 | 
	
		
			
				|  |  |            label="操作">
 | 
	
		
			
				|  |  |            <template slot-scope="scope">
 | 
	
		
			
				|  |  |              <el-button type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
 | 
	
		
			
				|  |  | -            <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row, false)">分派</el-button>
 | 
	
		
			
				|  |  | -            <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row, false)">选择清单</el-button>
 | 
	
		
			
				|  |  | -            <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row, false)">导入</el-button>
 | 
	
		
			
				|  |  | +            <el-button type="text" size="small" @click="assignHandle(scope.row)">分派</el-button>
 | 
	
		
			
				|  |  | +            <el-button type="text" size="small" @click="selectionHandle(scope.row, false)">选择清单</el-button>
 | 
	
		
			
				|  |  | +            <el-button type="text" size="small" @click="importHandle(scope.row)">导入</el-button>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |          </el-table-column>
 | 
	
		
			
				|  |  |        </el-table>
 | 
	
	
		
			
				|  | @@ -86,23 +86,44 @@
 | 
	
		
			
				|  |  |      </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"/>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    <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-button slot="trigger" size="small" type="primary">选取文件</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 { getList } from '@/api/sealmanage'
 | 
	
		
			
				|  |  | -  import AttachDetailDialog from '../common/attach-detail-dialog'
 | 
	
		
			
				|  |  | +  import Assign from './project-product-assign'
 | 
	
		
			
				|  |  | +  import Selection from './project-product-selection'
 | 
	
		
			
				|  |  |    export default {
 | 
	
		
			
				|  |  |      name: 'file-manage',
 | 
	
		
			
				|  |  |      components: {
 | 
	
		
			
				|  |  | -      Detail, AttachDetailDialog
 | 
	
		
			
				|  |  | +      Detail, Assign, Selection
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      data () {
 | 
	
		
			
				|  |  |        return {
 | 
	
		
			
				|  |  |          addOrUpdateVisible: false,
 | 
	
		
			
				|  |  |          detailVisible: false,
 | 
	
		
			
				|  |  | +        assignVisible: false,
 | 
	
		
			
				|  |  | +        selectionVisible: false,
 | 
	
		
			
				|  |  | +        importVisible: false,
 | 
	
		
			
				|  |  |          dataForm: {},
 | 
	
		
			
				|  |  |          dataList: [],
 | 
	
		
			
				|  |  |          pageIndex: 1,
 | 
	
	
		
			
				|  | @@ -110,7 +131,10 @@
 | 
	
		
			
				|  |  |          totalPage: 0,
 | 
	
		
			
				|  |  |          dataListLoading: false,
 | 
	
		
			
				|  |  |          dataListSelections: [],
 | 
	
		
			
				|  |  | -        optionsLevel: []
 | 
	
		
			
				|  |  | +        optionsLevel: [],
 | 
	
		
			
				|  |  | +        importLoading: false,
 | 
	
		
			
				|  |  | +        importData: {},
 | 
	
		
			
				|  |  | +        fileList: []
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      created () {
 | 
	
	
		
			
				|  | @@ -120,6 +144,8 @@
 | 
	
		
			
				|  |  |        onChose () {
 | 
	
		
			
				|  |  |          this.addOrUpdateVisible = false
 | 
	
		
			
				|  |  |          this.detailVisible = false
 | 
	
		
			
				|  |  | +        this.assignVisible = false
 | 
	
		
			
				|  |  | +        this.selectionVisible = false
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        // 查询
 | 
	
		
			
				|  |  |        queryData () {
 | 
	
	
		
			
				|  | @@ -181,8 +207,61 @@
 | 
	
		
			
				|  |  |            this.$refs.detail.init(item)
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -      attachDetails (attachList) {
 | 
	
		
			
				|  |  | -        this.$refs.attachDetail.init(attachList)
 | 
	
		
			
				|  |  | +      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
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            this.$message.error(data.msg)
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 |