询价导入采购计划,出库导入领料单单
This commit is contained in:
		
							parent
							
								
									ce50baff7f
								
							
						
					
					
						commit
						9ed322f9d5
					
				| 
						 | 
				
			
			@ -71,6 +71,7 @@
 | 
			
		|||
                </div>
 | 
			
		||||
                <div style="display: flex;align-items: center;">
 | 
			
		||||
                    <el-button type="primary" plain @click="addMaterial">添加货品</el-button>
 | 
			
		||||
                    <el-button type="primary" plain @click="importPurchasePlan">导入采购计划</el-button>
 | 
			
		||||
                    <el-button type="danger" plain @click="delMaterial">删除</el-button>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -179,6 +180,71 @@
 | 
			
		|||
                <el-button @click="openDialog=false">取 消</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </el-dialog>
 | 
			
		||||
 | 
			
		||||
        <!-- 导入 -->
 | 
			
		||||
        <el-dialog title="导入采购计划" :visible.sync="openImportDialog" width="60%" append-to-body >
 | 
			
		||||
            <div style="width: 100%;height:650px;">
 | 
			
		||||
                <el-form :model="queryParams2" ref="queryForm2" size="small" :inline="true" label-width="100px">  
 | 
			
		||||
                    <el-form-item label="计划日期">
 | 
			
		||||
                        <el-date-picker
 | 
			
		||||
                            v-model="dateRange"
 | 
			
		||||
                            type="datetimerange"
 | 
			
		||||
                            align="right"
 | 
			
		||||
                            unlink-panels
 | 
			
		||||
                            range-separator="至"
 | 
			
		||||
                            start-placeholder="开始日期"
 | 
			
		||||
                            end-placeholder="结束日期"
 | 
			
		||||
                            format="yyyy-MM-dd HH:mm:ss" style="width: 400px"
 | 
			
		||||
                            :default-time="['00:00:00', '23:59:59']"
 | 
			
		||||
                            :picker-options="pickerOptions2" >
 | 
			
		||||
                        </el-date-picker>
 | 
			
		||||
                    </el-form-item>
 | 
			
		||||
                    <el-form-item label="采购计划单号" prop="planCode">
 | 
			
		||||
                        <el-input v-model="queryParams2.planCode" placeholder="请输入采购单号" maxlength="20" clearable style="width: 240px"/>
 | 
			
		||||
                    </el-form-item>
 | 
			
		||||
 | 
			
		||||
                    <el-form-item>
 | 
			
		||||
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery2">搜索</el-button>
 | 
			
		||||
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery2">重置</el-button>
 | 
			
		||||
                    </el-form-item>
 | 
			
		||||
                </el-form>
 | 
			
		||||
                <!--  :row-key="(row)=>{return row.fetchMaterialId}" @selection-change="handleSelectionChange3" -->
 | 
			
		||||
                <el-table v-loading="loading2" :data="tableListData2" ref="multipleTable2" highlight-current-row @current-change="handleCurrentChange" height="300">
 | 
			
		||||
                    <!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
 | 
			
		||||
                    <el-table-column label="序号" align="center" width="80" type="index">
 | 
			
		||||
                        <template slot-scope="scope">
 | 
			
		||||
                        <span>{{(queryParams2.pageNum - 1) * queryParams2.pageSize + scope.$index + 1}}</span>
 | 
			
		||||
                        </template>
 | 
			
		||||
                    </el-table-column> 
 | 
			
		||||
                    <el-table-column label="采购计划单号" align="center" prop="planCode" :show-overflow-tooltip="true" /> 
 | 
			
		||||
                    <el-table-column label="采购计划时间" align="center" prop="purchaseDate" :show-overflow-tooltip="true" />  
 | 
			
		||||
                    <el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" /> 
 | 
			
		||||
                    <el-table-column label="所属档口" align="center" prop="stallName" :show-overflow-tooltip="true" />   
 | 
			
		||||
                    <el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" />  
 | 
			
		||||
                </el-table>
 | 
			
		||||
                <pagination
 | 
			
		||||
                    v-show="total2>0"
 | 
			
		||||
                    :total="total2"
 | 
			
		||||
                    :page.sync="queryParams2.pageNum"
 | 
			
		||||
                    :limit.sync="queryParams2.pageSize"
 | 
			
		||||
                    @pagination="getList2"
 | 
			
		||||
                /> 
 | 
			
		||||
                <div>
 | 
			
		||||
                    <div>采购计划明细</div>
 | 
			
		||||
                    <el-table :data="materialDetailsData"  height="250"> 
 | 
			
		||||
                        <el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" /> 
 | 
			
		||||
                        <el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" /> 
 | 
			
		||||
                        <el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" /> 
 | 
			
		||||
                        <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> 
 | 
			
		||||
                        <el-table-column label="计划采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true" />  
 | 
			
		||||
                    </el-table> 
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div slot="footer" class="dialog-footer">
 | 
			
		||||
                <el-button type="primary" @click="confirmImport">确 定</el-button>
 | 
			
		||||
                <el-button @click="openImportDialog=false">取 消</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </el-dialog> 
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -187,6 +253,7 @@ import { imgUpLoadTwo } from '@/api/system/upload'
 | 
			
		|||
import { systemAreaTreeApi } from "@/api/base/stall";
 | 
			
		||||
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/stockManage";
 | 
			
		||||
import { getGoodsInquiryInfoApi,addGoodsInquiryApi,editGoodsInquiryApi } from "@/api/foodManage/purchaseManage";
 | 
			
		||||
import { purchasePlanPageApi,getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage";
 | 
			
		||||
export default {
 | 
			
		||||
    name: "GoodsInquiryEdit",
 | 
			
		||||
    dicts: [],
 | 
			
		||||
| 
						 | 
				
			
			@ -257,6 +324,46 @@ export default {
 | 
			
		|||
        tableListData: [],//货品弹窗-货品表格数据
 | 
			
		||||
        batchChosenMaterial:[],//货品弹窗-货品表格-选中的货品数组
 | 
			
		||||
        noMaterial:false,
 | 
			
		||||
        //导入功能
 | 
			
		||||
        openImportDialog:false,
 | 
			
		||||
        queryParams2: { // 货品弹窗-货品表格-查询参数
 | 
			
		||||
            pageNum: 1,
 | 
			
		||||
            pageSize: 10, 
 | 
			
		||||
            planCode:null
 | 
			
		||||
        }, 
 | 
			
		||||
        loading2:false,
 | 
			
		||||
        total2: 0, // 总条数
 | 
			
		||||
        tableListData2: [],//导入弹窗-表格数据
 | 
			
		||||
        importRow:{},//导入弹窗-表格数据-选中数据
 | 
			
		||||
        materialDetailsData: [],//导入弹窗-明细数据
 | 
			
		||||
        dateRange:this.defaultDateRange(),//区域树
 | 
			
		||||
        pickerOptions2: {
 | 
			
		||||
            shortcuts: [{
 | 
			
		||||
                text: '最近一周',
 | 
			
		||||
                onClick(picker) {
 | 
			
		||||
                const start = new Date();
 | 
			
		||||
                const end = new Date();
 | 
			
		||||
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
 | 
			
		||||
                picker.$emit('pick', [start, end]);
 | 
			
		||||
                }
 | 
			
		||||
            },{
 | 
			
		||||
                text: '最近一个月',
 | 
			
		||||
                onClick(picker) {
 | 
			
		||||
                const start = new Date();
 | 
			
		||||
                const end = new Date();
 | 
			
		||||
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
 | 
			
		||||
                picker.$emit('pick', [start, end]);
 | 
			
		||||
                }
 | 
			
		||||
            },{
 | 
			
		||||
                text: '最近三个月',
 | 
			
		||||
                onClick(picker) {
 | 
			
		||||
                const start = new Date();
 | 
			
		||||
                const end = new Date();
 | 
			
		||||
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
 | 
			
		||||
                picker.$emit('pick', [start, end]);
 | 
			
		||||
                }
 | 
			
		||||
            }]
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +711,93 @@ export default {
 | 
			
		|||
                }
 | 
			
		||||
            });
 | 
			
		||||
        }, 
 | 
			
		||||
 | 
			
		||||
        //导入
 | 
			
		||||
        importPurchasePlan(){
 | 
			
		||||
            if(this.baseInfo.areaId!=undefined){
 | 
			
		||||
                this.openImportDialog=true 
 | 
			
		||||
                this.resetQuery2()
 | 
			
		||||
                // setTimeout(()=>{
 | 
			
		||||
                //     this.$refs.multipleTable2.clearSelection() 
 | 
			
		||||
                // },300) 
 | 
			
		||||
            }else{
 | 
			
		||||
                this.$modal.msgError("请先选择区域!");
 | 
			
		||||
            }  
 | 
			
		||||
        },
 | 
			
		||||
        /** 搜索按钮操作 */
 | 
			
		||||
        handleQuery2() {
 | 
			
		||||
            this.queryParams2.pageNum = 1;
 | 
			
		||||
            this.getList2();
 | 
			
		||||
        },
 | 
			
		||||
        /** 重置按钮操作 */
 | 
			
		||||
        resetQuery2() { 
 | 
			
		||||
            this.dateRange = this.defaultDateRange()
 | 
			
		||||
             this.queryParams2 = {
 | 
			
		||||
                pageNum: 1,
 | 
			
		||||
                pageSize: 10, 
 | 
			
		||||
            }
 | 
			
		||||
            this.resetForm("queryForm2");
 | 
			
		||||
            this.handleQuery2();
 | 
			
		||||
        },
 | 
			
		||||
        /** 查询列表 */
 | 
			
		||||
        getList2() {
 | 
			
		||||
            this.loading2 = true;
 | 
			
		||||
            let param = {
 | 
			
		||||
                "pageSize": this.queryParams2.pageSize,
 | 
			
		||||
                "pageNum": this.queryParams2.pageNum,
 | 
			
		||||
                "planCode": this.queryParams2.planCode,
 | 
			
		||||
                "status":2,
 | 
			
		||||
                "areaId": this.baseInfo.areaId,
 | 
			
		||||
            }
 | 
			
		||||
            if(this.dateRange&&this.dateRange.length>0){
 | 
			
		||||
                param.startDateTime=this.formatDateTime(this.dateRange[0])
 | 
			
		||||
                param.endDateTime=this.formatDateTime(this.dateRange[1])
 | 
			
		||||
            }else{
 | 
			
		||||
                param.startDateTime=undefined;
 | 
			
		||||
                param.endDateTime=undefined;
 | 
			
		||||
            }  
 | 
			
		||||
            purchasePlanPageApi(param).then(response => {
 | 
			
		||||
                this.tableListData2 = response.rows;
 | 
			
		||||
                this.total2 = Number(response.total);
 | 
			
		||||
                this.loading2 = false;
 | 
			
		||||
            });
 | 
			
		||||
        },
 | 
			
		||||
        //选中
 | 
			
		||||
        handleCurrentChange(row){
 | 
			
		||||
            console.log(row)
 | 
			
		||||
            this.importRow = row;
 | 
			
		||||
            let param = {
 | 
			
		||||
                planId:this.importRow.planId
 | 
			
		||||
            }
 | 
			
		||||
            getPurchasePlanInfoApi(param).then((response) => { 
 | 
			
		||||
                this.materialDetailsData = response.data.purchasePlanDetailList||[];  
 | 
			
		||||
            });
 | 
			
		||||
        },
 | 
			
		||||
        confirmImport(){ 
 | 
			
		||||
            if(this.materialDetailsData.length>0){
 | 
			
		||||
                this.$modal.confirm('是否确认覆盖货品明细?').then(() => {
 | 
			
		||||
                    this.materialList = this.materialDetailsData; 
 | 
			
		||||
                    this.materialList.forEach(item=>{
 | 
			
		||||
                        this.$set(item,"purNum",item.purchaseNum)
 | 
			
		||||
                    })
 | 
			
		||||
                    this.baseInfo.purchasePlanCode = this.importRow.planCode; 
 | 
			
		||||
                    this.$set(this.baseInfo,"remark","导入采购计划")
 | 
			
		||||
                    setTimeout(()=>{ 
 | 
			
		||||
                        this.openImportDialog=false
 | 
			
		||||
                    },500) 
 | 
			
		||||
                }).catch(() => {}); 
 | 
			
		||||
            }else{
 | 
			
		||||
                this.$modal.msgError("采购计划明细无货品");
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        defaultDateRange() {
 | 
			
		||||
          const end = new Date(new Date().toLocaleDateString());
 | 
			
		||||
          end.setTime(end.getTime() + 24 * 60 * 60 * 1000 -1);
 | 
			
		||||
          const start = new Date((new Date().toLocaleDateString()));
 | 
			
		||||
          start.setTime(start.getTime() - 30 * 24 * 60 * 60 * 1000); 
 | 
			
		||||
          this.start = parseInt(start.getTime() / 1000)
 | 
			
		||||
          this.end = parseInt(end.getTime() / 1000)
 | 
			
		||||
          return [start, end]
 | 
			
		||||
        }, 
 | 
			
		||||
        //日期
 | 
			
		||||
        formatDate(date) {
 | 
			
		||||
            // 格式化为 YYYY-MM-DD
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -427,6 +427,14 @@ export default {
 | 
			
		|||
        confirmChosen(){
 | 
			
		||||
            if(this.batchChosenMaterial.length>0){
 | 
			
		||||
                this.loading = true 
 | 
			
		||||
                if(this.baseInfo.fetchMaterialId&&this.baseInfo.fetchMaterialId!=""){
 | 
			
		||||
                    this.$modal.confirm('是否确认覆盖货品明细?').then(() => {
 | 
			
		||||
                        this.baseInfo.fetchMaterialId = null
 | 
			
		||||
                        this.materialList = this.batchChosenMaterial
 | 
			
		||||
                        this.loading = false
 | 
			
		||||
                        this.openDialog=false
 | 
			
		||||
                    }).catch(() => {});
 | 
			
		||||
                }else{
 | 
			
		||||
                    let items = [...this.materialList,...this.batchChosenMaterial] 
 | 
			
		||||
                    let uniqueItems = items.filter((item, index, array) => {
 | 
			
		||||
                        return array.findIndex((t) => (t.materialId === item.materialId)) === index;
 | 
			
		||||
| 
						 | 
				
			
			@ -437,6 +445,7 @@ export default {
 | 
			
		|||
                        this.openDialog=false
 | 
			
		||||
                    },500) 
 | 
			
		||||
                }
 | 
			
		||||
            } 
 | 
			
		||||
        },
 | 
			
		||||
        //保存草稿
 | 
			
		||||
        confirmSave(){
 | 
			
		||||
| 
						 | 
				
			
			@ -612,7 +621,7 @@ export default {
 | 
			
		|||
                    // this.materialList.forEach(item=>{
 | 
			
		||||
                    //     this.$set(item,"orderNum",item.purchaseNum)
 | 
			
		||||
                    // })
 | 
			
		||||
                    // this.baseInfo.purchasePlanCode = this.importRow.planCode; 
 | 
			
		||||
                    this.baseInfo.fetchMaterialId = this.importRow.fetchMaterialId; 
 | 
			
		||||
                    this.$set(this.baseInfo,"remark","导入领料单")
 | 
			
		||||
                    setTimeout(()=>{ 
 | 
			
		||||
                        this.openImportDialog=false
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,8 +36,8 @@ module.exports = {
 | 
			
		|||
            // detail: https://cli.vuejs.org/config/#devserver-proxy
 | 
			
		||||
            [process.env.VUE_APP_BASE_API]: {
 | 
			
		||||
                // target: `http://192.168.2.75:48380`,//旭
 | 
			
		||||
                target: `http://192.168.0.244:48380`,//测试
 | 
			
		||||
                // target: `http://192.168.0.176:48380`,//刘鑫
 | 
			
		||||
                // target: `http://192.168.0.244:48380`,//测试
 | 
			
		||||
                target: `http://192.168.0.176:48380`,//刘鑫
 | 
			
		||||
                // target: `http://192.168.0.44:48380`,//测试
 | 
			
		||||
                // target: `http://192.168.0.176:48380`,//
 | 
			
		||||
                changeOrigin: true,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue