Merge branch 'material-ui' of http://192.168.0.56:3000/bonus/bonus-ui into material-ui
This commit is contained in:
		
						commit
						e8d1aa05e0
					
				| 
						 | 
				
			
			@ -54,10 +54,11 @@ export function addBackApply(data) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
// 退料--删除
 | 
			
		||||
export function backApplyRemove(ids) {
 | 
			
		||||
export function backApplyRemove(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/back_apply_info/' + ids,
 | 
			
		||||
    method: 'delete',
 | 
			
		||||
    url: '/material/back_apply_info/deleteById',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -158,7 +158,7 @@
 | 
			
		|||
        </el-row>
 | 
			
		||||
        <el-table
 | 
			
		||||
            v-loading="loading"
 | 
			
		||||
            :data="equipmentList"
 | 
			
		||||
            :data="equipmentList" 
 | 
			
		||||
            @selection-change="handleSelectionChange"
 | 
			
		||||
        >
 | 
			
		||||
            <el-table-column
 | 
			
		||||
| 
						 | 
				
			
			@ -286,8 +286,8 @@
 | 
			
		|||
            </el-table-column>
 | 
			
		||||
        </el-table>
 | 
			
		||||
 | 
			
		||||
        <el-dialog title="编码退料" :visible.sync="open" width="1000px" append-to-body> 
 | 
			
		||||
            <el-row :gutter="10" class="mb8">
 | 
			
		||||
        <el-dialog title="编码退料" :visible.sync="open" width="1200px" append-to-body> 
 | 
			
		||||
            <!-- <el-row :gutter="10" class="mb8">
 | 
			
		||||
                <el-col :span="6">
 | 
			
		||||
                    <div style="width: 100%;height: 100%;display: flex;align-items: center;">
 | 
			
		||||
                        <span style="width: 80px;">编码:</span>
 | 
			
		||||
| 
						 | 
				
			
			@ -303,12 +303,13 @@
 | 
			
		|||
                <el-col :span="1.5">
 | 
			
		||||
                    <el-button type="primary" size="mini" @click="handleAddCode">添加编码</el-button>
 | 
			
		||||
                </el-col>
 | 
			
		||||
            </el-row>
 | 
			
		||||
            <el-table :data="maCodeList" width="100%" height="450px">
 | 
			
		||||
            </el-row> -->
 | 
			
		||||
            <el-table :data="machineList" width="100%" ref="codeTableList" height="450px"  row-key="maId"  @selection-change="codeSelectionChange">
 | 
			
		||||
                <el-table-column type="selection" width="55" align="center" />
 | 
			
		||||
                <el-table-column label="序号" type="index" width="55" align="center"/>
 | 
			
		||||
                <el-table-column label="类型名称" prop="materialName" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                <el-table-column label="类型名称" prop="typeName" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column label="规格型号" prop="typeName" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                <el-table-column label="规格型号" prop="materialName" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column> 
 | 
			
		||||
                <el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
| 
						 | 
				
			
			@ -343,12 +344,12 @@
 | 
			
		|||
                        </div>
 | 
			
		||||
                    </template>
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column label="操作" align="center"   width="120px">
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <el-button size="mini" type="danger"
 | 
			
		||||
                        @click="handleDeleteCode({ ...scope.row, index: scope.$index })">删除</el-button>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
                <!-- <el-table-column label="操作" align="center"   width="120px">
 | 
			
		||||
                    <template slot-scope="scope">
 | 
			
		||||
                        <el-button size="mini" type="danger"
 | 
			
		||||
                            @click="handleDeleteCode({ ...scope.row, index: scope.$index })">删除</el-button>
 | 
			
		||||
                    </template>
 | 
			
		||||
                </el-table-column> -->
 | 
			
		||||
            </el-table>
 | 
			
		||||
            <div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;">
 | 
			
		||||
                <el-button type="primary" size="mini" @click="saveDevCode">保存</el-button>
 | 
			
		||||
| 
						 | 
				
			
			@ -782,6 +783,7 @@ export default {
 | 
			
		|||
                    // this.queryParams.createBy = this.user.name
 | 
			
		||||
                    // this.queryParams.companyId = this.companyId
 | 
			
		||||
                    this.queryParams.backApplyInfo = {
 | 
			
		||||
                        id:this.rowId,
 | 
			
		||||
                        backPerson: this.queryParams.backPerson,
 | 
			
		||||
                        phone: this.queryParams.phone,
 | 
			
		||||
                        remark: this.queryParams.remark,
 | 
			
		||||
| 
						 | 
				
			
			@ -792,7 +794,6 @@ export default {
 | 
			
		|||
                    }
 | 
			
		||||
                    if (this.rowId != '') {
 | 
			
		||||
                        let params = {
 | 
			
		||||
                            id:this.rowId,
 | 
			
		||||
                            backApplyInfo: this.queryParams.backApplyInfo,
 | 
			
		||||
                            backApplyDetailsList:
 | 
			
		||||
                                this.queryParams.equipmentList,
 | 
			
		||||
| 
						 | 
				
			
			@ -878,7 +879,7 @@ export default {
 | 
			
		|||
                            const obj = JSON.parse(JSON.stringify(z.data))
 | 
			
		||||
                            console.log(obj)
 | 
			
		||||
                            obj.typeModel = obj.typeName
 | 
			
		||||
                            obj.typeName = deviceTypeList[2].data.typeName
 | 
			
		||||
                            obj.typeName = obj.materialName
 | 
			
		||||
                            obj.preNum = 0
 | 
			
		||||
                            obj.apDetection = ''
 | 
			
		||||
                            obj.remark = ''
 | 
			
		||||
| 
						 | 
				
			
			@ -927,71 +928,107 @@ export default {
 | 
			
		|||
            template.useNum = node.data.useNum
 | 
			
		||||
            return template
 | 
			
		||||
        },
 | 
			
		||||
        //编码下拉选数据
 | 
			
		||||
        getMachineById(typeId){
 | 
			
		||||
      
 | 
			
		||||
        // changeMachine(val){
 | 
			
		||||
        //     console.log(val)
 | 
			
		||||
        //     this.maData = this.machineList.find(option => option.maId == val);
 | 
			
		||||
        //     //  = this.machineList[index]
 | 
			
		||||
        // },
 | 
			
		||||
         //编码数据
 | 
			
		||||
        async getMachineById(typeId){
 | 
			
		||||
            let param = {
 | 
			
		||||
                unitId:this.queryParams.unitId,
 | 
			
		||||
                proId:this.queryParams.proId,
 | 
			
		||||
                typeId:typeId
 | 
			
		||||
            }
 | 
			
		||||
            getMachineById(param).then((res) => {
 | 
			
		||||
            await getMachineById(param).then((res) => {
 | 
			
		||||
                this.machineList=res.data
 | 
			
		||||
                this.machineList.forEach((item)=>{
 | 
			
		||||
                    item.bmFileInfos=[];
 | 
			
		||||
                    item.apDetection=""
 | 
			
		||||
                })
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
        changeMachine(val){
 | 
			
		||||
            console.log(val)
 | 
			
		||||
            this.maData = this.machineList.find(option => option.maId == val);
 | 
			
		||||
            //  = this.machineList[index]
 | 
			
		||||
        },
 | 
			
		||||
        //编码类型-弹窗
 | 
			
		||||
        openAddCode(row){
 | 
			
		||||
            this.rowData=row;
 | 
			
		||||
            this.getMachineById(row.typeId)
 | 
			
		||||
            this.maId=""
 | 
			
		||||
            this.maCodeList=[]
 | 
			
		||||
            if(this.rowData.maCodeList&&this.rowData.maCodeList.length>0){
 | 
			
		||||
                this.maCodeList = this.rowData.maCodeList
 | 
			
		||||
            }
 | 
			
		||||
        async openAddCode(row){
 | 
			
		||||
            this.rowData=row; 
 | 
			
		||||
            await this.getMachineById(row.typeId)
 | 
			
		||||
            // this.maId="" 
 | 
			
		||||
                if(this.rowData.maCodeList&&this.rowData.maCodeList.length>0){
 | 
			
		||||
                    this.maCodeList = this.rowData.maCodeList;
 | 
			
		||||
                    // console.log(this.maCodeList)
 | 
			
		||||
                    // console.log(this.machineList)
 | 
			
		||||
                    if (this.rowId != '') {//编辑插入已选数据后再回显勾选 
 | 
			
		||||
                        this.maCodeList.forEach((item)=>{
 | 
			
		||||
                            this.machineList.unshift(item)//插入
 | 
			
		||||
                            this.$nextTick(() => {
 | 
			
		||||
                                this.$refs.codeTableList.toggleRowSelection(item,true);
 | 
			
		||||
                            })
 | 
			
		||||
                        }) 
 | 
			
		||||
                    }else{//新增回显勾选
 | 
			
		||||
                        // console.log("新增")
 | 
			
		||||
                        this.machineList.forEach((item)=>{
 | 
			
		||||
                            this.maCodeList.forEach((sub)=>{
 | 
			
		||||
                                if(sub.maId==item.maId){
 | 
			
		||||
                                    this.$nextTick(() => {
 | 
			
		||||
                                        setTimeout(()=>{
 | 
			
		||||
                                            this.$refs.codeTableList.toggleRowSelection(item,true);
 | 
			
		||||
                                        },500)
 | 
			
		||||
                                    }) 
 | 
			
		||||
                                }
 | 
			
		||||
                            }) 
 | 
			
		||||
                        }) 
 | 
			
		||||
                    }
 | 
			
		||||
                }else{
 | 
			
		||||
                    this.maCodeList=[]
 | 
			
		||||
                }
 | 
			
		||||
            this.open=true;
 | 
			
		||||
        },
 | 
			
		||||
        codeSelectionChange(selection) {
 | 
			
		||||
                this.maCodeList=selection
 | 
			
		||||
            // console.log(selection)
 | 
			
		||||
           
 | 
			
		||||
            // this.queryParams.equipmentList = selection
 | 
			
		||||
        },
 | 
			
		||||
        //查询添加
 | 
			
		||||
        handleAddCode(){
 | 
			
		||||
            console.log(this.rowData)
 | 
			
		||||
            console.log(this.maId)
 | 
			
		||||
            console.log(this.maData)
 | 
			
		||||
            if(this.maId!=""){
 | 
			
		||||
                let obj = {
 | 
			
		||||
                    materialName:this.maData.materialName,
 | 
			
		||||
                    typeId:this.maData.typeId,
 | 
			
		||||
                    typeName:this.maData.typeName,
 | 
			
		||||
                    maId:this.maData.maId,
 | 
			
		||||
                    maCode:this.maData.maCode,
 | 
			
		||||
                    maStatus:this.maData.maStatus,
 | 
			
		||||
                    bmFileInfos:[],
 | 
			
		||||
                    apDetection:"",
 | 
			
		||||
                }
 | 
			
		||||
                let index = this.maCodeList.findIndex(v=>v.maId==this.maId)
 | 
			
		||||
                if(index>-1){
 | 
			
		||||
                    this.$message.error('设备编码已存在!')
 | 
			
		||||
                }else{
 | 
			
		||||
                    this.maCodeList.push(obj)
 | 
			
		||||
                }
 | 
			
		||||
            }else{
 | 
			
		||||
                this.$message.error('请先填写设备编码!')
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        /** 删除按钮操作 */
 | 
			
		||||
        handleDeleteCode(row) {
 | 
			
		||||
            this.maCodeList.splice(row.index, 1)
 | 
			
		||||
        },
 | 
			
		||||
        // 弹窗保存
 | 
			
		||||
        saveDevCode(){
 | 
			
		||||
            // console.log(this.rowData)
 | 
			
		||||
            // console.log(this.maCodeList)
 | 
			
		||||
            // console.log(this.maId)
 | 
			
		||||
            // console.log(this.maData)
 | 
			
		||||
            // if(this.maId!=""){
 | 
			
		||||
                // let obj = {
 | 
			
		||||
                //     materialName:this.maData.materialName,
 | 
			
		||||
                //     typeId:this.maData.typeId,
 | 
			
		||||
                //     typeName:this.maData.typeName,
 | 
			
		||||
                //     maId:this.maData.maId,
 | 
			
		||||
                //     maCode:this.maData.maCode,
 | 
			
		||||
                //     maStatus:this.maData.maStatus,
 | 
			
		||||
                //     bmFileInfos:[],
 | 
			
		||||
                //     apDetection:"",
 | 
			
		||||
                // }
 | 
			
		||||
                // let index = this.maCodeList.findIndex(v=>v.maId==this.maId)
 | 
			
		||||
                // if(index>-1){
 | 
			
		||||
                //     this.$message.error('设备编码已存在!')
 | 
			
		||||
                // }else{
 | 
			
		||||
                //     this.maCodeList.push(obj)
 | 
			
		||||
                // }
 | 
			
		||||
            // }else{
 | 
			
		||||
            //     this.$message.error('请先填写设备编码!')
 | 
			
		||||
            // }
 | 
			
		||||
        },
 | 
			
		||||
        // /** 删除按钮操作 */
 | 
			
		||||
        // handleDeleteCode(row) {
 | 
			
		||||
        //     this.maCodeList.splice(row.index, 1)
 | 
			
		||||
        // },
 | 
			
		||||
        // 弹窗保存
 | 
			
		||||
        saveDevCode(){
 | 
			
		||||
            console.log(this.rowData)
 | 
			
		||||
            console.log(this.maCodeList)
 | 
			
		||||
            this.rowData.maCodeList = this.maCodeList;
 | 
			
		||||
            this.rowData.preNum = this.maCodeList.length;
 | 
			
		||||
            this.open=false
 | 
			
		||||
            // console.log(this.equipmentList)
 | 
			
		||||
            console.log(this.equipmentList)
 | 
			
		||||
        },
 | 
			
		||||
        //文件上传前
 | 
			
		||||
        beforeFileUpload(row){ 
 | 
			
		||||
| 
						 | 
				
			
			@ -1006,19 +1043,19 @@ export default {
 | 
			
		|||
                }
 | 
			
		||||
                let index = this.equipmentList.findIndex(v=>v.typeId==this.fileData.typeId)
 | 
			
		||||
                this.equipmentList[index].bmFileInfos=[obj]
 | 
			
		||||
                 
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        // 文件上传成功处理-编码弹窗上传
 | 
			
		||||
        handleFileSuccess2(response, file, fileList) { 
 | 
			
		||||
            console.log(1111)
 | 
			
		||||
            if(response.code==200){
 | 
			
		||||
                let obj = {
 | 
			
		||||
                    "name": response.data.name,
 | 
			
		||||
                    "url": response.data.url,
 | 
			
		||||
                }
 | 
			
		||||
                let index = this.maCodeList.findIndex(v=>v.maCode==this.fileData.maCode)
 | 
			
		||||
                this.maCodeList[index].bmFileInfos=[obj]
 | 
			
		||||
                 
 | 
			
		||||
                let index = this.machineList.findIndex(v=>v.maCode==this.fileData.maCode)
 | 
			
		||||
                this.machineList[index].bmFileInfos=[obj]
 | 
			
		||||
                console.log(this.machineList)
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        //图片查看
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,9 +28,9 @@
 | 
			
		|||
                    style="width: 240px"
 | 
			
		||||
                />
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <el-form-item label="退料状态" prop="taskStatus">
 | 
			
		||||
            <el-form-item label="退料状态" prop="status">
 | 
			
		||||
                <el-select
 | 
			
		||||
                    v-model="queryParams.taskStatus"
 | 
			
		||||
                    v-model="queryParams.status"
 | 
			
		||||
                    clearable
 | 
			
		||||
                    filterable
 | 
			
		||||
                    style="width: 240px"
 | 
			
		||||
| 
						 | 
				
			
			@ -424,7 +424,7 @@ export default {
 | 
			
		|||
                keyWord: '', //关键字
 | 
			
		||||
                unitId: '', //单位id
 | 
			
		||||
                lotId: '', //工程id
 | 
			
		||||
                taskStatus: '', //状态
 | 
			
		||||
                status: '', //状态
 | 
			
		||||
                typeId: '', //工机具类型
 | 
			
		||||
                time: '',
 | 
			
		||||
                agreementCode: '', //协议
 | 
			
		||||
| 
						 | 
				
			
			@ -630,7 +630,7 @@ export default {
 | 
			
		|||
            this.$modal
 | 
			
		||||
                .confirm('是否确认删除所选择的退料任务?')
 | 
			
		||||
                .then(() => {
 | 
			
		||||
                    return backApplyRemove(row.id)
 | 
			
		||||
                    return backApplyRemove({id:row.id})
 | 
			
		||||
                })
 | 
			
		||||
                .then(() => {
 | 
			
		||||
                    this.getList() 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -81,7 +81,7 @@
 | 
			
		|||
                <dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/>
 | 
			
		||||
            </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="备注" align="center" prop="remark" />
 | 
			
		||||
        <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
 | 
			
		||||
        <el-table-column label="操作" align="center" width="250">
 | 
			
		||||
                        <template slot-scope="scope">
 | 
			
		||||
                            <el-button
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue