退料管理,退料列表新增页面
This commit is contained in:
		
							parent
							
								
									c7561b83e7
								
							
						
					
					
						commit
						92badead39
					
				| 
						 | 
				
			
			@ -0,0 +1,852 @@
 | 
			
		|||
<template>
 | 
			
		||||
    <div>
 | 
			
		||||
        <el-form
 | 
			
		||||
            :model="queryParams"
 | 
			
		||||
            ref="queryForm"
 | 
			
		||||
            size="small"
 | 
			
		||||
            :rules="queryRules"
 | 
			
		||||
            :inline="true"
 | 
			
		||||
            v-show="showSearch"
 | 
			
		||||
            label-width="100px"
 | 
			
		||||
        >
 | 
			
		||||
            <el-row>
 | 
			
		||||
                <el-form-item label="退料单位" prop="unitId">
 | 
			
		||||
                    <el-select
 | 
			
		||||
                        v-model="queryParams.unitId"
 | 
			
		||||
                        clearable
 | 
			
		||||
                        filterable
 | 
			
		||||
                        @change="GetProData"
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                        placeholder="请选择"
 | 
			
		||||
                        :disabled="isEdit"
 | 
			
		||||
                    >
 | 
			
		||||
                        <el-option
 | 
			
		||||
                            v-for="item in unitList"
 | 
			
		||||
                            :key="item.id"
 | 
			
		||||
                            :label="item.name"
 | 
			
		||||
                            :value="item.id"
 | 
			
		||||
                        >
 | 
			
		||||
                        </el-option>
 | 
			
		||||
                    </el-select>
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
                <el-form-item label="退料工程" prop="proId">
 | 
			
		||||
                    <el-select
 | 
			
		||||
                        v-model="queryParams.proId"
 | 
			
		||||
                        clearable
 | 
			
		||||
                        filterable
 | 
			
		||||
                        @change="GetUnitData"
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                        placeholder="请选择"
 | 
			
		||||
                        :disabled="isEdit"
 | 
			
		||||
                    >
 | 
			
		||||
                        <el-option
 | 
			
		||||
                            v-for="item in proList"
 | 
			
		||||
                            :key="item.id"
 | 
			
		||||
                            :label="item.name"
 | 
			
		||||
                            :value="item.id"
 | 
			
		||||
                        >
 | 
			
		||||
                        </el-option>
 | 
			
		||||
                    </el-select>
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
                <!-- <el-form-item label="协议号" prop="agreementCode">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model="queryParams.agreementCode"
 | 
			
		||||
                        disabled
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                    ></el-input>
 | 
			
		||||
                </el-form-item> -->
 | 
			
		||||
              
 | 
			
		||||
                <el-form-item label="退料人" prop="backPerson">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model="queryParams.backPerson"
 | 
			
		||||
                        placeholder="请输入退料人"
 | 
			
		||||
                        clearable 
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                    />
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
                <el-form-item label="退料人电话" prop="phone">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model="queryParams.phone"
 | 
			
		||||
                        placeholder="请输入退料人电话"
 | 
			
		||||
                        clearable
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                        :maxlength="11"
 | 
			
		||||
                    />
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
                <el-form-item label="物品类型" prop="status">
 | 
			
		||||
                    <el-cascader
 | 
			
		||||
                        placeholder="请输入物品类型"
 | 
			
		||||
                        :options="deviceTypeTree"
 | 
			
		||||
                        :props="deviceTypeTreeProps"
 | 
			
		||||
                        v-model="deviceType"
 | 
			
		||||
                        @change="deviceTypeChange"
 | 
			
		||||
                        ref="deviceTypeCascader"
 | 
			
		||||
                        filterable
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                    ></el-cascader>
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
                <el-form-item label="退料时间" prop="backTime">
 | 
			
		||||
                    <el-date-picker
 | 
			
		||||
                        v-model="queryParams.backTime"
 | 
			
		||||
                        type="date"
 | 
			
		||||
                        value-format="yyyy-MM-dd"
 | 
			
		||||
                        placeholder="选择时间"
 | 
			
		||||
                        style="width: 240px"
 | 
			
		||||
                    >
 | 
			
		||||
                    </el-date-picker>
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
               
 | 
			
		||||
                <el-form-item label="备注" prop="roleName">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model="queryParams.remark"
 | 
			
		||||
                        placeholder="请输入备注"
 | 
			
		||||
                        clearable
 | 
			
		||||
                        rows="1"
 | 
			
		||||
                        type="textarea"
 | 
			
		||||
                        style="width: 240px" 
 | 
			
		||||
                    />
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
            </el-row>
 | 
			
		||||
            <el-row> </el-row>
 | 
			
		||||
        </el-form>
 | 
			
		||||
 | 
			
		||||
        <el-row :gutter="10" class="mb8">
 | 
			
		||||
            <!-- <el-col :span="1.5">
 | 
			
		||||
                <el-button
 | 
			
		||||
                    type="success"
 | 
			
		||||
                    plain
 | 
			
		||||
                    icon="el-icon-back"
 | 
			
		||||
                    size="mini"
 | 
			
		||||
                    @click="handleBack"
 | 
			
		||||
                    >退料管理</el-button
 | 
			
		||||
                >
 | 
			
		||||
            </el-col> -->
 | 
			
		||||
            <el-col :span="1.5">
 | 
			
		||||
                <el-button
 | 
			
		||||
                    type="primary"
 | 
			
		||||
                    plain
 | 
			
		||||
                    icon="el-icon-plus"
 | 
			
		||||
                    size="mini"
 | 
			
		||||
                    @click="handleAdd"
 | 
			
		||||
                    >保存</el-button
 | 
			
		||||
                >
 | 
			
		||||
            </el-col>
 | 
			
		||||
 | 
			
		||||
            <el-col :span="1.5">
 | 
			
		||||
                <!-- <el-button
 | 
			
		||||
            type="warning"
 | 
			
		||||
            plain
 | 
			
		||||
            icon="el-icon-download"
 | 
			
		||||
            size="mini"
 | 
			
		||||
            @click="handleExport"
 | 
			
		||||
            v-hasPermi="['system:role:export']"
 | 
			
		||||
          >导出</el-button> -->
 | 
			
		||||
            </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-table
 | 
			
		||||
            v-loading="loading"
 | 
			
		||||
            :data="backApplyDetails"
 | 
			
		||||
            @selection-change="handleSelectionChange"
 | 
			
		||||
        >
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                type="selection"
 | 
			
		||||
                min-width="55"
 | 
			
		||||
                align="center"
 | 
			
		||||
                :selectable="selectable"
 | 
			
		||||
            />
 | 
			
		||||
            <el-table-column label="序号" type="index" align="center" min-width="80" />
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="类型名称"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="typeName" 
 | 
			
		||||
                :show-overflow-tooltip="true"
 | 
			
		||||
            />
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="规格型号"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="typeCode" 
 | 
			
		||||
                :show-overflow-tooltip="true"
 | 
			
		||||
            />
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="计量单位"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="unitNames" 
 | 
			
		||||
            />
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="当前在用量"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="useNum" 
 | 
			
		||||
            >
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="管理模式"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="unitNames"
 | 
			
		||||
            />
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="退料数量"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="createTime" 
 | 
			
		||||
                 min-width="100"
 | 
			
		||||
            >
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model.number="scope.row.num"
 | 
			
		||||
                        placeholder="退料数量"
 | 
			
		||||
                        type="number"
 | 
			
		||||
                        min="1"
 | 
			
		||||
                        clearable
 | 
			
		||||
                        @input="checkNum(scope.row)"
 | 
			
		||||
                        style="width: 100%"
 | 
			
		||||
                    />
 | 
			
		||||
                    <div style="color: rgb(2, 167, 240);" @click="openAddCode(scope.row)">添加编码</div>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="外观判定"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="look"
 | 
			
		||||
                min-width="120"
 | 
			
		||||
            >
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model.number="scope.row.look"
 | 
			
		||||
                        placeholder="外观判定"
 | 
			
		||||
                        type="text" 
 | 
			
		||||
                        clearable  maxlength="20"
 | 
			
		||||
                        style="width: 100%"
 | 
			
		||||
                    />
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="备注"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="remark"
 | 
			
		||||
                min-width="120"
 | 
			
		||||
            >
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model="scope.row.remark"
 | 
			
		||||
                        placeholder="备注"
 | 
			
		||||
                        clearable  maxlength="100"
 | 
			
		||||
                        style="width: 100%" 
 | 
			
		||||
                    />
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="附件"
 | 
			
		||||
                align="center"
 | 
			
		||||
                prop="file"
 | 
			
		||||
            >
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <div style="color: rgb(2, 167, 240);">上传</div>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
 | 
			
		||||
            <el-table-column
 | 
			
		||||
                label="操作"
 | 
			
		||||
                align="center"
 | 
			
		||||
                width="100px"
 | 
			
		||||
            >
 | 
			
		||||
                <template slot-scope="scope">
 | 
			
		||||
                    <el-button size="mini" type="danger" 
 | 
			
		||||
                        @click="handleDelete({ ...scope.row, index: scope.$index })">删除</el-button>
 | 
			
		||||
                </template>
 | 
			
		||||
            </el-table-column>
 | 
			
		||||
        </el-table>
 | 
			
		||||
 | 
			
		||||
        <el-dialog title="编码退料" :visible.sync="open" width="1000px" 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>
 | 
			
		||||
                        <el-input v-model="devCode" placeholder="请输入编码" clearable style="width: 100%"/>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </el-col>
 | 
			
		||||
                <el-col :span="1.5">
 | 
			
		||||
                    <el-button type="primary" size="mini" @click="handleAddCode">保存</el-button>
 | 
			
		||||
                </el-col>
 | 
			
		||||
            </el-row>
 | 
			
		||||
            <el-table :data="codeDataList" width="100%" height="450px">
 | 
			
		||||
                <el-table-column label="序号" type="index" width="55" align="center"/>
 | 
			
		||||
                <el-table-column label="类型名称" prop="typeName" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column label="规格型号" prop="typeCode" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column> 
 | 
			
		||||
                <el-table-column label="设备编码" prop="devCode" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column label="设备状态" prop="status" align="center" :show-overflow-tooltip="true">
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column label="外观判定" prop="look" align="center" width="150" :show-overflow-tooltip="true">
 | 
			
		||||
                    <template slot-scope="scope">
 | 
			
		||||
                    <el-input
 | 
			
		||||
                        v-model.number="scope.row.look"
 | 
			
		||||
                        placeholder="外观判定" maxlength="20"
 | 
			
		||||
                        type="text"  clearable 
 | 
			
		||||
                        style="width: 100%"
 | 
			
		||||
                    />
 | 
			
		||||
                </template>
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column label="附件" align="center" width="100">
 | 
			
		||||
                    <template slot-scope="scope">
 | 
			
		||||
                        <div style="display: flex;align-items: center;justify-content: center;">
 | 
			
		||||
                            <el-upload ref="upload" :limit="1" :headers="upload.headers"
 | 
			
		||||
                            :action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
 | 
			
		||||
                            :on-success="handleFileSuccess"   :auto-upload="true"
 | 
			
		||||
                            >
 | 
			
		||||
                            <el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
 | 
			
		||||
                                    上传
 | 
			
		||||
                            </el-button>
 | 
			
		||||
                            </el-upload>
 | 
			
		||||
                            <el-button size="mini" type="text" @click="picturePreview(scope.row)" v-if="scope.row.fileInfos&&scope.row.fileInfos.length>0">
 | 
			
		||||
                                查看
 | 
			
		||||
                            </el-button>
 | 
			
		||||
                        </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>
 | 
			
		||||
            <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>
 | 
			
		||||
                <el-button type="normal" size="mini" @click="open=false">取消</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </el-dialog>
 | 
			
		||||
 | 
			
		||||
        <!-- 图片查看弹窗 -->
 | 
			
		||||
        <el-dialog :visible.sync="dialogVisible" width="500px" height="500px" >
 | 
			
		||||
            <img width="100%" height="500px" :src="dialogImageUrl"  />
 | 
			
		||||
        </el-dialog>
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  import {
 | 
			
		||||
    equipmentTypeTree, 
 | 
			
		||||
} from '@/api/purchase/goodsArrived';
 | 
			
		||||
// import {
 | 
			
		||||
//     getProData,
 | 
			
		||||
//     getUnitData,
 | 
			
		||||
//     getDeviceTypeTree,
 | 
			
		||||
//     getAgreementInfoById,
 | 
			
		||||
//     submitLeaseApply,
 | 
			
		||||
//     getUseTypeTreee,
 | 
			
		||||
//     getUseNumByTypeId,
 | 
			
		||||
// } from '@/api/claimAndRefund/receive'
 | 
			
		||||
// import { submitBackApplyApi } from '@/api/claimAndRefund/return'
 | 
			
		||||
// import { 
 | 
			
		||||
//     materialReturnNoteByApply,
 | 
			
		||||
//     submitRefuseBackApply,
 | 
			
		||||
// } from '@/api/claimAndRefund/return.js'
 | 
			
		||||
import { mapState } from 'vuex'
 | 
			
		||||
import { getInfo, h } from '@/api/login'
 | 
			
		||||
import { getToken } from '@/utils/auth'
 | 
			
		||||
export default {
 | 
			
		||||
    name: 'ReturnApplyAdd',
 | 
			
		||||
    props: {
 | 
			
		||||
        rejectId: {
 | 
			
		||||
            type: [String, Number],
 | 
			
		||||
        },
 | 
			
		||||
        agreementId: {
 | 
			
		||||
            type: [String, Number],
 | 
			
		||||
        },
 | 
			
		||||
        isEdit: {
 | 
			
		||||
            type: Boolean
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
        const validatePhone = (rule, value, callback) => {
 | 
			
		||||
            const reg = /^[1][3-9][0-9]{9}$/
 | 
			
		||||
            if (!reg.test(value)) {
 | 
			
		||||
                this.queryParams.phone = ''
 | 
			
		||||
            } else {
 | 
			
		||||
                callback()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return {
 | 
			
		||||
            // 遮罩层
 | 
			
		||||
            loading: false,
 | 
			
		||||
            // 选中数组
 | 
			
		||||
            ids: [],
 | 
			
		||||
            // 非单个禁用
 | 
			
		||||
            single: true,
 | 
			
		||||
            // 非多个禁用
 | 
			
		||||
            multiple: true,
 | 
			
		||||
            // 显示搜索条件
 | 
			
		||||
            showSearch: true,
 | 
			
		||||
            // 总条数
 | 
			
		||||
            total: 0,
 | 
			
		||||
            // 角色表格数据
 | 
			
		||||
            roleList: [],
 | 
			
		||||
            // 弹出层标题
 | 
			
		||||
            title: '',
 | 
			
		||||
            // 是否显示弹出层
 | 
			
		||||
            open: false,
 | 
			
		||||
            rowData:{},
 | 
			
		||||
            devCode:"",
 | 
			
		||||
            codeDataList: [],
 | 
			
		||||
            //图片查看弹窗
 | 
			
		||||
            dialogImageUrl: '',
 | 
			
		||||
            dialogVisible: false,
 | 
			
		||||
            fileData:{},
 | 
			
		||||
            //上传
 | 
			
		||||
            upload: {
 | 
			
		||||
                // 设置上传的请求头部
 | 
			
		||||
                headers: { Authorization: 'Bearer ' + getToken() },
 | 
			
		||||
                // 上传的地址
 | 
			
		||||
                url: process.env.VUE_APP_BASE_API + '/file/upload'
 | 
			
		||||
            },
 | 
			
		||||
            // 查询参数
 | 
			
		||||
            queryParams: {
 | 
			
		||||
                types: 2, 
 | 
			
		||||
                unitId: null,
 | 
			
		||||
                proId: null,
 | 
			
		||||
                agreementId: null, //协议id
 | 
			
		||||
                agreementCode: null, //协议code
 | 
			
		||||
                companyId: '', //登录信息中取
 | 
			
		||||
                createBy: '', //用户名
 | 
			
		||||
                taskType: 29,
 | 
			
		||||
                taskStatus: 30,
 | 
			
		||||
                backTime: '', //申请时间
 | 
			
		||||
                //退料人信息
 | 
			
		||||
                leaseApplyInfo: {
 | 
			
		||||
                    backPerson: '',
 | 
			
		||||
                    phone: '',
 | 
			
		||||
                    remark: '',
 | 
			
		||||
                },
 | 
			
		||||
                //退料详情集合
 | 
			
		||||
                backApplyDetails: [],
 | 
			
		||||
            },
 | 
			
		||||
            backApplyDetails: [],
 | 
			
		||||
            //退料详情单条模板
 | 
			
		||||
            leaseApplyDetailsItem: {
 | 
			
		||||
                createBy: null,
 | 
			
		||||
                companyId: null,
 | 
			
		||||
                status: 0,
 | 
			
		||||
                typeId: null, //  树结构第4级   规格id
 | 
			
		||||
                typeName: '', //显示的设备类型
 | 
			
		||||
                typeCode: '', //显示的设备规格
 | 
			
		||||
                unitNames: '', //显示的设备 单位
 | 
			
		||||
                useNum: '', //当前在用量
 | 
			
		||||
                remark: '', //单条备注
 | 
			
		||||
                preNum: 1, //预领数量
 | 
			
		||||
            },
 | 
			
		||||
            //
 | 
			
		||||
            queryRules: {
 | 
			
		||||
                unitId: [
 | 
			
		||||
                    {
 | 
			
		||||
                        required: true,
 | 
			
		||||
                        message: '请选择退料单位',
 | 
			
		||||
                        trigger: 'change',
 | 
			
		||||
                        type: 'number',
 | 
			
		||||
                    },
 | 
			
		||||
                ],
 | 
			
		||||
                proId: [
 | 
			
		||||
                    {
 | 
			
		||||
                        required: true,
 | 
			
		||||
                        message: '请选择退料工程',
 | 
			
		||||
                        trigger: 'change',
 | 
			
		||||
                        type: 'number',
 | 
			
		||||
                    },
 | 
			
		||||
                ],
 | 
			
		||||
                backPerson: [
 | 
			
		||||
                    {
 | 
			
		||||
                        required: true,
 | 
			
		||||
                        message: '请输入退料人',
 | 
			
		||||
                        trigger: 'blur',
 | 
			
		||||
                    },
 | 
			
		||||
                ],
 | 
			
		||||
                backTime: [
 | 
			
		||||
                    {
 | 
			
		||||
                        required: true,
 | 
			
		||||
                        message: '请选择退料时间',
 | 
			
		||||
                        trigger: 'change',
 | 
			
		||||
                    },
 | 
			
		||||
                ],
 | 
			
		||||
                phone: [
 | 
			
		||||
                    {
 | 
			
		||||
                        required: true,
 | 
			
		||||
                        trigger: 'blur',
 | 
			
		||||
                        message: '请输入退料人的手机号',
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        pattern: /^1[3456789]\d{9}$/,
 | 
			
		||||
                        message: '请输入正确的手机号码',
 | 
			
		||||
                        trigger: 'blur',
 | 
			
		||||
                    },
 | 
			
		||||
                ],
 | 
			
		||||
                // phone: [
 | 
			
		||||
                //   { validator: validatePhone, trigger: "blur"},
 | 
			
		||||
                //   {required: true, message: '请输入正确的手机号', trigger: 'change'},
 | 
			
		||||
                // ],
 | 
			
		||||
            },
 | 
			
		||||
            unitList: [], //单位 集合
 | 
			
		||||
            proList: [], // 工程 集合
 | 
			
		||||
            deviceTypeTree: [], // 设备 树结构数据
 | 
			
		||||
            // 设备 树显示 配置
 | 
			
		||||
            deviceTypeTreeProps: {
 | 
			
		||||
                children: 'children',
 | 
			
		||||
                label: 'typeName',
 | 
			
		||||
                // multiple: false,
 | 
			
		||||
                value: 'typeId',
 | 
			
		||||
            },
 | 
			
		||||
            // 选中的设备类型
 | 
			
		||||
            deviceType: null, 
 | 
			
		||||
            // defaultProps: {
 | 
			
		||||
            //   children: "children",
 | 
			
		||||
            //   label: "label"
 | 
			
		||||
            // },  
 | 
			
		||||
            companyId: '',
 | 
			
		||||
            createBy: '',
 | 
			
		||||
            // isEdit: 'true',
 | 
			
		||||
            rowId: '',
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
        this.GetDeviceTypeTreeFn()
 | 
			
		||||
        // this.GetUnitData()
 | 
			
		||||
        // this.GetProData() 
 | 
			
		||||
        // console.log('this.$route.query.isEdit', this.$route.query.isEdit)
 | 
			
		||||
        // this.isEdit = this.$route.query.isEdit 
 | 
			
		||||
        // if (this.rejectId) {
 | 
			
		||||
        //     this.rowId = this.rejectId
 | 
			
		||||
        //     this.GetViewByApply({
 | 
			
		||||
        //         id: this.rejectId,
 | 
			
		||||
        //         agreementId: this.agreementId,
 | 
			
		||||
        //     })
 | 
			
		||||
        // }
 | 
			
		||||
        // getInfo().then((res) => {
 | 
			
		||||
        //     this.companyId = res.user.companyId
 | 
			
		||||
        //     this.createBy = res.user.userName
 | 
			
		||||
        // })
 | 
			
		||||
    },
 | 
			
		||||
    computed: {
 | 
			
		||||
        ...mapState(['user']),
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        // 获取 来往单位 列表数据
 | 
			
		||||
        async GetUnitData() {
 | 
			
		||||
            const params = {
 | 
			
		||||
                id: this.queryParams.proId /*  */,
 | 
			
		||||
            }
 | 
			
		||||
            // const res = await getUnitData(params)
 | 
			
		||||
            // this.unitList = res.data
 | 
			
		||||
            // this.GetAgreementInfoById()
 | 
			
		||||
        },
 | 
			
		||||
        // 获取 工程名称 列表数据
 | 
			
		||||
        async GetProData() {
 | 
			
		||||
            const params = {
 | 
			
		||||
                id: this.queryParams.unitId,
 | 
			
		||||
            }
 | 
			
		||||
            // const res = await getProData(params)
 | 
			
		||||
            // this.proList = res.data
 | 
			
		||||
            // this.GetAgreementInfoById()
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        // 获取 设备树结构数据
 | 
			
		||||
        async GetDeviceTypeTreeFn(agreementId) {
 | 
			
		||||
            // const params = {
 | 
			
		||||
            //     agreementId: agreementId,
 | 
			
		||||
            // }
 | 
			
		||||
            equipmentTypeTree().then((response) => {
 | 
			
		||||
                this.deviceTypeTree = response.data
 | 
			
		||||
            })
 | 
			
		||||
            // const res = await getUseTypeTreee(params)
 | 
			
		||||
            // console.log('resgetUseTypeTreee==========', res)
 | 
			
		||||
            // this.deviceTypeTree = res.data
 | 
			
		||||
        },
 | 
			
		||||
        // 获取 协议id
 | 
			
		||||
        async GetAgreementInfoById() {
 | 
			
		||||
            if (this.queryParams.unitId && this.queryParams.proId) {
 | 
			
		||||
                const params = {
 | 
			
		||||
                    unitId: this.queryParams.unitId,
 | 
			
		||||
                    projectId: this.queryParams.proId,
 | 
			
		||||
                }
 | 
			
		||||
                // const res = await getAgreementInfoById(params)
 | 
			
		||||
                // if (!(res.data && res.data.agreementId)) {
 | 
			
		||||
                //     this.$message.error('当前单位和工程未上传')
 | 
			
		||||
                //     this.queryParams.unitId = null
 | 
			
		||||
                //     this.queryParams.proId = null
 | 
			
		||||
                //     this.GetUnitData()
 | 
			
		||||
                //     this.GetProData()
 | 
			
		||||
                // } else {
 | 
			
		||||
                //     this.queryParams.agreementId = res.data.agreementId
 | 
			
		||||
                //     this.queryParams.agreementCode = res.data.agreementCode
 | 
			
		||||
                //     this.GetDeviceTypeTreeFn(res.data.agreementId)
 | 
			
		||||
                // }
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        // 获取 任务详情数据
 | 
			
		||||
        async GetViewByApply(params) {
 | 
			
		||||
            // const res = await materialReturnNoteByApply({
 | 
			
		||||
            //     id: params.id,
 | 
			
		||||
            //     agreementId: params.agreementId,
 | 
			
		||||
            // })
 | 
			
		||||
            // const data = res.data[0]
 | 
			
		||||
            // // console.log(data) 
 | 
			
		||||
            // this.queryParams.unitId = data.unitId
 | 
			
		||||
            // this.queryParams.proId = Number(data.proId)
 | 
			
		||||
            // this.$set(this.queryParams, 'phone', data.phone)
 | 
			
		||||
            // this.queryParams.backPerson = data.backPerson
 | 
			
		||||
            // this.queryParams.backTime = data.backTime
 | 
			
		||||
            // this.queryParams.agreementCode = data.agreementCode
 | 
			
		||||
            // this.queryParams.agreementId = data.agreementId
 | 
			
		||||
            // this.queryParams.remark = data.remark
 | 
			
		||||
            // this.backApplyDetails = res.data
 | 
			
		||||
            // this.GetDeviceTypeTreeFn(data.agreementId)
 | 
			
		||||
        }, 
 | 
			
		||||
         
 | 
			
		||||
        //是否可用勾选框
 | 
			
		||||
        selectable(row) {
 | 
			
		||||
            console.log(row)
 | 
			
		||||
            if (row.num != 0) {
 | 
			
		||||
                return true
 | 
			
		||||
            } else {
 | 
			
		||||
                return false
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        // 多选框选中数据
 | 
			
		||||
        handleSelectionChange(selection) {
 | 
			
		||||
            this.queryParams.backApplyDetails = selection
 | 
			
		||||
        }, 
 | 
			
		||||
 | 
			
		||||
        /** 保存按钮操作 */
 | 
			
		||||
        handleAdd() {
 | 
			
		||||
            this.$refs.queryForm.validate(async (valid) => {
 | 
			
		||||
                if (!valid) {
 | 
			
		||||
                    return false
 | 
			
		||||
                } else {
 | 
			
		||||
                    let backApplyInfo = []
 | 
			
		||||
                    if (this.queryParams.backApplyDetails.length == 0) {
 | 
			
		||||
                        this.$message.error('请添加数据')
 | 
			
		||||
                        return
 | 
			
		||||
                    }
 | 
			
		||||
                    // const isRemark = this.queryParams.backApplyDetails.some(
 | 
			
		||||
                    //   (item) => item.remark == '' || item.remark == undefined
 | 
			
		||||
                    // );
 | 
			
		||||
                    const isNum = this.queryParams.backApplyDetails.some(
 | 
			
		||||
                        (item) => item.num == '' || item.num == undefined,
 | 
			
		||||
                    )
 | 
			
		||||
                    if (isNum) {
 | 
			
		||||
                        this.$message.error('退料数量不能为空!')
 | 
			
		||||
                        return
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    this.queryParams.createBy = this.user.name
 | 
			
		||||
                    this.queryParams.companyId = this.companyId
 | 
			
		||||
                    this.queryParams.backApplyInfo = {
 | 
			
		||||
                        backPerson: this.queryParams.backPerson,
 | 
			
		||||
                        phone: this.queryParams.phone,
 | 
			
		||||
                        remark: this.queryParams.remark,
 | 
			
		||||
                        backTime: this.queryParams.backTime,
 | 
			
		||||
                        companyId: this.companyId,
 | 
			
		||||
                    }
 | 
			
		||||
                    if (this.rowId != '') {
 | 
			
		||||
                        let params = {
 | 
			
		||||
                            companyId: this.companyId,
 | 
			
		||||
                            createBy: this.createBy,
 | 
			
		||||
                            id: this.rowId,
 | 
			
		||||
                            agreementId: this.queryParams.agreementId,
 | 
			
		||||
                            backApplyInfo: this.queryParams.backApplyInfo,
 | 
			
		||||
                            backApplyDetails:
 | 
			
		||||
                                this.queryParams.backApplyDetails,
 | 
			
		||||
                        }
 | 
			
		||||
                        // const res = await submitRefuseBackApply(params)
 | 
			
		||||
                        // if (res.code == 200) {
 | 
			
		||||
                        //     this.$message({ type: 'success', message: res.msg })
 | 
			
		||||
                        //     setTimeout(() => {
 | 
			
		||||
                        //         this.$emit('goBackPage')
 | 
			
		||||
                        //         // this.$tab.closeOpenPage({
 | 
			
		||||
                        //         //     path: '/claimAndRefund/return/returnApplyByCq',
 | 
			
		||||
                        //         // })
 | 
			
		||||
                        //     }, 1000)
 | 
			
		||||
                        // }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        let params = {
 | 
			
		||||
                            companyId: this.companyId,
 | 
			
		||||
                            createBy: this.createBy,
 | 
			
		||||
                            agreementId: this.queryParams.agreementId,
 | 
			
		||||
                            backApplyInfo: this.queryParams.backApplyInfo,
 | 
			
		||||
                            backApplyDetails:
 | 
			
		||||
                                this.queryParams.backApplyDetails,
 | 
			
		||||
                        }
 | 
			
		||||
                        // const res = await submitBackApplyApi(params)
 | 
			
		||||
                        // if (res.code == 200) {
 | 
			
		||||
                        //     this.$message({ type: 'success', message: res.msg })
 | 
			
		||||
                        //     setTimeout(() => {
 | 
			
		||||
                        //         this.$emit('goBackPage')
 | 
			
		||||
                        //         // this.$tab.closeOpenPage({
 | 
			
		||||
                        //         //     path: '/claimAndRefund/return/returnApplyByCq',
 | 
			
		||||
                        //         // })
 | 
			
		||||
                        //     }, 1000)
 | 
			
		||||
                        // }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        }, 
 | 
			
		||||
  
 | 
			
		||||
       
 | 
			
		||||
 | 
			
		||||
        /** 删除按钮操作 */
 | 
			
		||||
        handleDelete(row) {
 | 
			
		||||
            this.backApplyDetails.splice(row.index, 1)
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
        /** 导出按钮操作 */
 | 
			
		||||
        handleExport() {
 | 
			
		||||
            this.download(
 | 
			
		||||
                'system/role/export',
 | 
			
		||||
                {
 | 
			
		||||
                    ...this.queryParams,
 | 
			
		||||
                },
 | 
			
		||||
                `role_${new Date().getTime()}.xlsx`,
 | 
			
		||||
            )
 | 
			
		||||
        },
 | 
			
		||||
        checkNum(row) {
 | 
			
		||||
            let maxNum = row.useNum
 | 
			
		||||
            if (row.num <= 1) {
 | 
			
		||||
                row.num = 1
 | 
			
		||||
            } else if (row.num >= maxNum) {
 | 
			
		||||
                row.num = maxNum
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        /////// 设备类型树  切换
 | 
			
		||||
        async deviceTypeChange(val) {
 | 
			
		||||
            let nodes = null
 | 
			
		||||
            console.log('vall1211221122',
 | 
			
		||||
                this.$refs.deviceTypeCascader.getCheckedNodes().length,
 | 
			
		||||
                this.$refs.deviceTypeCascader.getCheckedNodes(),
 | 
			
		||||
                [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)],
 | 
			
		||||
            )
 | 
			
		||||
            nodes =
 | 
			
		||||
                this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
 | 
			
		||||
                    ? this.$refs.deviceTypeCascader.getCheckedNodes()
 | 
			
		||||
                    : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
 | 
			
		||||
            console.log('nodes', nodes)
 | 
			
		||||
            // const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
 | 
			
		||||
            nodes[0].data.useNum = nodes[0].data.num
 | 
			
		||||
            if (nodes[0].level != 4) {
 | 
			
		||||
                return
 | 
			
		||||
            }
 | 
			
		||||
            if (nodes[0].data.useNum < 1) {
 | 
			
		||||
                this.$modal.msgError('所选机具类型当前无在用!')
 | 
			
		||||
                return
 | 
			
		||||
            }
 | 
			
		||||
            for (let i = 0; i < this.backApplyDetails.length; i++) {
 | 
			
		||||
                if (this.backApplyDetails[i].typeId == nodes[0].data.typeId) {
 | 
			
		||||
                    this.backApplyDetails.splice(i, 1)
 | 
			
		||||
                    break
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            this.backApplyDetails.push(this.handelTableItemData(nodes[0]))
 | 
			
		||||
            // this.$refs.cascader.$refs.panel.clearCheckedNodes()
 | 
			
		||||
            // // 设置为空可以让节点不高亮显示
 | 
			
		||||
            // this.$refs.cascader.$refs.panel.activePath = []
 | 
			
		||||
            this.deviceType = {}
 | 
			
		||||
        },
 | 
			
		||||
        //// 将数据处理成 表格中需要的数据
 | 
			
		||||
        handelTableItemData(node) {
 | 
			
		||||
            const template = JSON.parse(
 | 
			
		||||
                JSON.stringify(this.leaseApplyDetailsItem),
 | 
			
		||||
            )
 | 
			
		||||
            template.createBy = this.createBy
 | 
			
		||||
            template.typeId = node.data.typeId
 | 
			
		||||
            template.companyId = node.data.companyId
 | 
			
		||||
            // template.typeId = node.data.id
 | 
			
		||||
            template.unitNames = node.data.unitNames
 | 
			
		||||
            template.preNum = node.data.num
 | 
			
		||||
            template.typeName = node.pathLabels[2]
 | 
			
		||||
            template.typeCode = node.pathLabels[3]
 | 
			
		||||
            template.num = node.data.num
 | 
			
		||||
            template.useNum = node.data.useNum
 | 
			
		||||
            return template
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
         //编码接受
 | 
			
		||||
         openAddCode(row){
 | 
			
		||||
          this.rowData=row; 
 | 
			
		||||
          this.devCode=""
 | 
			
		||||
          this.codeDataList=[]
 | 
			
		||||
          if(this.rowData.codeDataList&&this.rowData.codeDataList.length>0){
 | 
			
		||||
            this.codeDataList = this.rowData.codeDataList
 | 
			
		||||
          }
 | 
			
		||||
          this.open=true
 | 
			
		||||
        },
 | 
			
		||||
        handleAddCode(){
 | 
			
		||||
            console.log(this.rowData)
 | 
			
		||||
            if(this.devCode!=""){
 | 
			
		||||
                let obj = {
 | 
			
		||||
                    typeName:this.rowData.typeName,
 | 
			
		||||
                    typeId:this.rowData.typeId,
 | 
			
		||||
                    typeCode:this.rowData.typeCode,
 | 
			
		||||
                    devCode:this.devCode,
 | 
			
		||||
                    status:this.rowData.status,
 | 
			
		||||
                    fileInfos:[],
 | 
			
		||||
                    look:"",
 | 
			
		||||
                }
 | 
			
		||||
                let index = this.codeDataList.findIndex(v=>v.devCode==this.devCode)
 | 
			
		||||
                if(index>-1){
 | 
			
		||||
                    this.$message.error('设备编码已存在!')
 | 
			
		||||
                }else{
 | 
			
		||||
                    this.codeDataList.push(obj)
 | 
			
		||||
                }
 | 
			
		||||
            }else{
 | 
			
		||||
                this.$message.error('请先填写设备编码!')
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
         /** 删除按钮操作 */
 | 
			
		||||
         handleDeleteCode(row) {
 | 
			
		||||
            this.codeDataList.splice(row.index, 1)
 | 
			
		||||
        }, 
 | 
			
		||||
        saveDevCode(){
 | 
			
		||||
            console.log(this.rowData)
 | 
			
		||||
            console.log(this.codeDataList)
 | 
			
		||||
            this.rowData.codeDataList = this.codeDataList
 | 
			
		||||
            console.log(this.backApplyDetails)
 | 
			
		||||
        },
 | 
			
		||||
        beforeFileUpload(row){ 
 | 
			
		||||
            this.fileData = row 
 | 
			
		||||
        },
 | 
			
		||||
        // 文件上传成功处理
 | 
			
		||||
        handleFileSuccess(response, file, fileList) { 
 | 
			
		||||
            if(response.code==200){
 | 
			
		||||
                let obj = {
 | 
			
		||||
                    "taskId": "",
 | 
			
		||||
                    "taskType": "0",
 | 
			
		||||
                    "name": response.data.name,
 | 
			
		||||
                    "url": response.data.url,
 | 
			
		||||
                    "modelId": this.rowData.typeId,
 | 
			
		||||
                    // "fileType": this.rowData.fileType
 | 
			
		||||
                }
 | 
			
		||||
                let index = this.codeDataList.findIndex(v=>v.devCode==this.fileData.devCode)
 | 
			
		||||
                this.codeDataList[index].fileInfos=[obj]
 | 
			
		||||
                 
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        //图片查看
 | 
			
		||||
        picturePreview(row) {
 | 
			
		||||
            console.log(row)
 | 
			
		||||
            console.log(row.fileInfos)
 | 
			
		||||
            if(row.fileInfos.length>0){
 | 
			
		||||
                let file = row.fileInfos[0]
 | 
			
		||||
                this.dialogImageUrl = file.url;
 | 
			
		||||
                const parts = file.name.split('.');
 | 
			
		||||
                const extension = parts.pop();
 | 
			
		||||
                if(extension === 'doc'||extension === 'docx'||extension === 'pdf'){
 | 
			
		||||
                const windowName = file.name;
 | 
			
		||||
                    window.open(file.url,windowName)
 | 
			
		||||
                }else{
 | 
			
		||||
                    this.dialogVisible = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,219 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <el-dialog
 | 
			
		||||
    v-dialogDrag
 | 
			
		||||
    v-loading.fullscreen.lock="fullscreenLoading"
 | 
			
		||||
    :before-close="cancel"
 | 
			
		||||
    :title="dialogTitle"
 | 
			
		||||
    :visible.sync="dialogShowFlag"
 | 
			
		||||
    append-to-body
 | 
			
		||||
    width="800px"
 | 
			
		||||
  >
 | 
			
		||||
    <div id="printcontent" style="height: 500px;overflow-y: scroll;padding: 0 20px;">
 | 
			
		||||
      <vue-easy-print tableShow ref="printRef">
 | 
			
		||||
        <div class="order_box">
 | 
			
		||||
          <div class="order_box_one">
 | 
			
		||||
            <div>
 | 
			
		||||
              <span>工程名称:</span><span>{{ rowObj.lotName }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <span>退料时间:</span><span>{{ rowObj.backTime }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="order_box_one">
 | 
			
		||||
            <div>
 | 
			
		||||
              <span>退料单位:</span><span>{{ rowObj.unitName }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <span>编号:</span><span>{{ rowObj.code }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <el-table :data="tableData" border style="width: 100%;margin-bottom: 10px;padding: 2px;">
 | 
			
		||||
          <el-table-column label="编号" align="center" type="index" />
 | 
			
		||||
          <el-table-column
 | 
			
		||||
            label="类型名称"
 | 
			
		||||
            align="center"
 | 
			
		||||
            prop="typeName"
 | 
			
		||||
            :show-overflow-tooltip="true"
 | 
			
		||||
          />
 | 
			
		||||
          <el-table-column
 | 
			
		||||
            label="规格型号"
 | 
			
		||||
            align="center"
 | 
			
		||||
            prop="typeCode"
 | 
			
		||||
            :show-overflow-tooltip="true"
 | 
			
		||||
          />
 | 
			
		||||
          <el-table-column
 | 
			
		||||
            label="退料数量"
 | 
			
		||||
            align="center"
 | 
			
		||||
            class-name="small-padding fixed-width"
 | 
			
		||||
            width="200"
 | 
			
		||||
            prop="num"
 | 
			
		||||
          >
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <!-- <el-table-column prop="remarks" label="备注" align="center">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <span
 | 
			
		||||
                @click="remarksClick"
 | 
			
		||||
                style="color: #1890ff; cursor: pointer"
 | 
			
		||||
                >{{ scope.row.remarks }}</span
 | 
			
		||||
              >
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column> -->
 | 
			
		||||
        </el-table>
 | 
			
		||||
        <div class="order_footer">
 | 
			
		||||
          <div>审核:</div>
 | 
			
		||||
          <div>退料:</div>
 | 
			
		||||
          <div>操作人:</div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </vue-easy-print>
 | 
			
		||||
      <div>
 | 
			
		||||
        <el-button type="primary" @click="print">打印</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
 | 
			
		||||
      <div style="height: 500px;overflow-y: scroll;padding: 0 20px;">
 | 
			
		||||
      <vue-easy-print tableShow ref="remarksPrintRef">
 | 
			
		||||
        <div class="remarks_box">
 | 
			
		||||
          <div class="remarks_box_title">退料编码明细</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <el-table :data="tableData" border style="width: 100%;margin-bottom: 10px;padding: 2px;">
 | 
			
		||||
          <el-table-column label="序号" align="center" type="index" />
 | 
			
		||||
          <el-table-column prop="name" label="名称" align="center">
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="type" label="规格型号" align="center">
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="unit" label="单位" align="center">
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="number" label="数量" align="center">
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table>
 | 
			
		||||
      </vue-easy-print>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div style="margin-top: 10px">
 | 
			
		||||
        <el-button type="primary" @click="remarksPrint">打印</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
  </el-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
// import vueEasyPrint from 'vue-easy-print';
 | 
			
		||||
// import { materialReturnNoteByApply } from "@/api/claimAndRefund/return.js"
 | 
			
		||||
export default {
 | 
			
		||||
  // components: { vueEasyPrint, },
 | 
			
		||||
  props: {
 | 
			
		||||
    // 弹窗是否显示
 | 
			
		||||
    isShowFlag: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: false
 | 
			
		||||
    },
 | 
			
		||||
    // 对应操作数据键值
 | 
			
		||||
    priKey: {
 | 
			
		||||
      type: [String, Number],
 | 
			
		||||
      default: ""
 | 
			
		||||
    },
 | 
			
		||||
    //弹窗标题
 | 
			
		||||
    dialogTitle: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: ""
 | 
			
		||||
    },
 | 
			
		||||
    rowObj: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    isShowFlag(val) {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        this.init();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    dialogShowFlag: {
 | 
			
		||||
      get() {
 | 
			
		||||
        return this.isShowFlag;
 | 
			
		||||
      },
 | 
			
		||||
      set(v) {
 | 
			
		||||
        this.$emit("update:isShowFlag", v);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      fullscreenLoading: false,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      open: false,
 | 
			
		||||
      title: ""
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init() {
 | 
			
		||||
      let params = {
 | 
			
		||||
        id: this.rowObj.id,
 | 
			
		||||
        agreementId: this.rowObj.agreementId,
 | 
			
		||||
      }
 | 
			
		||||
      // materialReturnNoteByApply(params).then(res => {
 | 
			
		||||
      //   this.tableData = res.data
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
    // 取消按钮
 | 
			
		||||
    cancel() {
 | 
			
		||||
      this.dialogShowFlag = false;
 | 
			
		||||
    },
 | 
			
		||||
    print() {
 | 
			
		||||
      this.$refs.printRef.print();
 | 
			
		||||
    },
 | 
			
		||||
    remarksClick() {
 | 
			
		||||
      this.title = '查看'
 | 
			
		||||
      this.open = true
 | 
			
		||||
    },
 | 
			
		||||
    remarksPrint() {
 | 
			
		||||
      this.$refs.remarksPrintRef.print();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // submit() {
 | 
			
		||||
    //   this.$refs["dynamicValidateForm"].validate(valid => {
 | 
			
		||||
    //     console.log("valid", valid);
 | 
			
		||||
    //     if (valid) {
 | 
			
		||||
    //       console.log("11111");
 | 
			
		||||
    //       this.cancel();
 | 
			
		||||
    //     } else {
 | 
			
		||||
    //       return false;
 | 
			
		||||
    //     }
 | 
			
		||||
    //   });
 | 
			
		||||
    // }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.order_box {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  flex-direction: column;
 | 
			
		||||
  .order_box_one {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    display: flex;
 | 
			
		||||
    align-content: center;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
    margin-bottom: 10px;
 | 
			
		||||
    :last-child {
 | 
			
		||||
      margin-right: 20px;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.order_footer {
 | 
			
		||||
  margin-top: 10px;
 | 
			
		||||
  display: flex;
 | 
			
		||||
  justify-content: space-around;
 | 
			
		||||
  align-items: center;
 | 
			
		||||
}
 | 
			
		||||
.remarks_box {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  // align-items: center;
 | 
			
		||||
  justify-content: center;
 | 
			
		||||
  .remarks_box_title {
 | 
			
		||||
    margin-bottom: 10px;
 | 
			
		||||
 | 
			
		||||
    font-size: 18px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
				
			
			@ -0,0 +1,62 @@
 | 
			
		|||
<template>
 | 
			
		||||
    <!-- 退料申请 -->
 | 
			
		||||
    <div class="app-container">
 | 
			
		||||
        <PageHeader
 | 
			
		||||
            v-if="isShowComponent !== 'Home'"
 | 
			
		||||
            :pageContent="pageContent"
 | 
			
		||||
            @goBack="goBack"
 | 
			
		||||
        />
 | 
			
		||||
        <component
 | 
			
		||||
            :is="isShowComponent"
 | 
			
		||||
            :rejectId="rejectId"
 | 
			
		||||
            :agreementId="agreementId"
 | 
			
		||||
            :isEdit="isEdit"
 | 
			
		||||
            @returnApply="returnApply"
 | 
			
		||||
            @rejectSubmit="rejectSubmit"
 | 
			
		||||
            @goBackPage="goBack"
 | 
			
		||||
        />
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import PageHeader from '@/components/pageHeader' 
 | 
			
		||||
import Home from './component/home.vue' 
 | 
			
		||||
import AddReturn from './component/addReturn.vue'
 | 
			
		||||
export default {
 | 
			
		||||
    components: {
 | 
			
		||||
        PageHeader,
 | 
			
		||||
        Home,
 | 
			
		||||
        AddReturn,
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            isShowComponent: 'Home',
 | 
			
		||||
            pageContent: '',
 | 
			
		||||
            rejectId: '',
 | 
			
		||||
            agreementId: '',
 | 
			
		||||
            isView: false,
 | 
			
		||||
            isEdit: false,
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        // 退料申请
 | 
			
		||||
        returnApply() {
 | 
			
		||||
            this.rejectId = ''
 | 
			
		||||
            this.pageContent = '新建退料任务'
 | 
			
		||||
            this.isShowComponent = 'AddReturn'
 | 
			
		||||
            this.isEdit = false
 | 
			
		||||
        },
 | 
			
		||||
        // 驳回提交
 | 
			
		||||
        rejectSubmit({id, agreementId}) {
 | 
			
		||||
            this.rejectId = id
 | 
			
		||||
            this.agreementId = agreementId
 | 
			
		||||
            this.isEdit = true
 | 
			
		||||
            this.pageContent = '编辑退料任务'
 | 
			
		||||
            this.isShowComponent = 'AddReturn'
 | 
			
		||||
        },
 | 
			
		||||
        goBack() {
 | 
			
		||||
            this.isShowComponent = 'Home'
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
		Loading…
	
		Reference in New Issue