页面修改
This commit is contained in:
		
							parent
							
								
									377a8fb1ad
								
							
						
					
					
						commit
						de636dc350
					
				| 
						 | 
					@ -44,6 +44,16 @@ export function drpWareHousePageApi(data) {
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//获取菜品原料反算接口dishes/convert
 | 
				
			||||||
 | 
					export function dishesConvertApi(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/smart-canteen/cook_dishes/dishes/convert',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// -------------采购合同---------------
 | 
					// -------------采购合同---------------
 | 
				
			||||||
//获取采购合同分页列表
 | 
					//获取采购合同分页列表
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -169,15 +169,15 @@ export const constantRoutes = [
 | 
				
			||||||
    redirect: 'noredirect',
 | 
					    redirect: 'noredirect',
 | 
				
			||||||
    children: [
 | 
					    children: [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'planDetail',
 | 
					        path: 'purchasePlanDetail',
 | 
				
			||||||
        component: () => import('@/views/foodManage/purchaseManage/purchasePlan/detail'),
 | 
					        component: () => import('@/views/foodManage/purchaseManage/purchasePlan/detail'),
 | 
				
			||||||
        name: 'PlanDetail',
 | 
					        name: 'purchasePlanDetail',
 | 
				
			||||||
        meta: { title: '采购计划详情', icon: '' }
 | 
					        meta: { title: '采购计划详情', icon: '' }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'planEdit',
 | 
					        path: 'purchasePlanEdit',
 | 
				
			||||||
        component: () => import('@/views/foodManage/purchaseManage/purchasePlan/edit'),
 | 
					        component: () => import('@/views/foodManage/purchaseManage/purchasePlan/edit'),
 | 
				
			||||||
        name: 'PlanEdit',
 | 
					        name: 'PurchasePlanEdit',
 | 
				
			||||||
        meta: { title: '采购计划新增/编辑', icon: '' }
 | 
					        meta: { title: '采购计划新增/编辑', icon: '' }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -402,7 +402,7 @@
 | 
				
			||||||
            //             this.menuTypeList.push(item)
 | 
					            //             this.menuTypeList.push(item)
 | 
				
			||||||
            //         }
 | 
					            //         }
 | 
				
			||||||
            //     })
 | 
					            //     })
 | 
				
			||||||
                this.menuTypeList = [{bindType: 7,id: 2,name: "智慧餐台/消费机"},{bindType: 1,id: 6,name: "移动端当餐点餐"},{bindType: 2,id: 7,name: "移动端预订餐"},{bindType: 3,id: 8,name: "移动端一周菜谱"}]
 | 
					                this.menuTypeList = [{bindType: 7,id: 2,name: "智慧餐台/消费机"},{bindType: 2,id: 7,name: "移动端预订餐"},{bindType: 3,id: 8,name: "移动端一周菜谱"}]
 | 
				
			||||||
                this.bindType = this.menuTypeList[0].bindType
 | 
					                this.bindType = this.menuTypeList[0].bindType
 | 
				
			||||||
            // });
 | 
					            // });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@
 | 
				
			||||||
<script> 
 | 
					<script> 
 | 
				
			||||||
import { getFetchMaterialInfoApi } from "@/api/foodManage/pickManage";
 | 
					import { getFetchMaterialInfoApi } from "@/api/foodManage/pickManage";
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    name: "orderDetail",
 | 
					    name: "MaterialPickingDetail",
 | 
				
			||||||
    dicts: [],
 | 
					    dicts: [],
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -167,7 +167,7 @@ import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/ap
 | 
				
			||||||
import { systemMaterialTreeApi,getStockMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/pickManage"; 
 | 
					import { systemMaterialTreeApi,getStockMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/pickManage"; 
 | 
				
			||||||
import { getFetchMaterialInfoApi,addFetchMaterialApi,editFetchMaterialApi } from "@/api/foodManage/pickManage"; 
 | 
					import { getFetchMaterialInfoApi,addFetchMaterialApi,editFetchMaterialApi } from "@/api/foodManage/pickManage"; 
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    name: "orderEdit",
 | 
					    name: "MaterialPickingEdit",
 | 
				
			||||||
    dicts: [],
 | 
					    dicts: [],
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -165,10 +165,8 @@
 | 
				
			||||||
    <!-- 添加或修改参数配置对话框 -->
 | 
					    <!-- 添加或修改参数配置对话框 -->
 | 
				
			||||||
    <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
 | 
					    <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
 | 
				
			||||||
        <el-table v-loading="loading2" :data="dialogTableList" height="600">
 | 
					        <el-table v-loading="loading2" :data="dialogTableList" height="600">
 | 
				
			||||||
            <el-table-column label="序号" align="center" width="80" type="index"></el-table-column> 
 | 
					            <el-table-column label="序号" align="center" width="80" type="index"></el-table-column>  
 | 
				
			||||||
            <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="materialName" :show-overflow-tooltip="true" /> 
 | 
					 | 
				
			||||||
            <el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" /> 
 | 
					 | 
				
			||||||
            <el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
 | 
					            <el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
 | 
				
			||||||
                <!-- <template slot-scope="scope">
 | 
					                <!-- <template slot-scope="scope">
 | 
				
			||||||
                    <span v-if="scope.row.salesMode==1">按份</span>
 | 
					                    <span v-if="scope.row.salesMode==1">按份</span>
 | 
				
			||||||
| 
						 | 
					@ -176,21 +174,28 @@
 | 
				
			||||||
                </template> -->
 | 
					                </template> -->
 | 
				
			||||||
            </el-table-column> 
 | 
					            </el-table-column> 
 | 
				
			||||||
            <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />  
 | 
					            <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />  
 | 
				
			||||||
            <el-table-column label="可食用部分(%)" align="center" prop="" :show-overflow-tooltip="true" width="120">
 | 
					            <el-table-column label="可食用部分(%)" align="center" prop="edible" :show-overflow-tooltip="true" width="120">
 | 
				
			||||||
                <template slot-scope="scope">
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
                    <span>100</span> 
 | 
					                    <span>100</span> 
 | 
				
			||||||
                </template>
 | 
					                </template>
 | 
				
			||||||
            </el-table-column>
 | 
					            </el-table-column>
 | 
				
			||||||
            <el-table-column label="系统分解重量(kg)" align="center" prop="" :show-overflow-tooltip="true" width="140"/> 
 | 
					            <el-table-column label="系统分解重量(kg)" align="center" prop="totalConvertWeight" :show-overflow-tooltip="true" width="140"/> 
 | 
				
			||||||
            <el-table-column label="预留比例(%)" align="center" prop="" :show-overflow-tooltip="true" width="140">
 | 
					            <el-table-column label="预留比例(%)" align="center" prop="rate" :show-overflow-tooltip="true" width="140">
 | 
				
			||||||
                
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
 | 
					                    <!-- <el-input-number v-model="scope.row.rate" style="width: 100%;" controls-position="right" maxlength="3" :min="0" :max="100" @change="inputRate(scope.row)"></el-input-number> -->
 | 
				
			||||||
 | 
					                    <el-input  v-model="scope.row.rate" style="width: 100%;" maxlength="6" clearable @input="inputRate(scope.row)"/>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
            </el-table-column>    
 | 
					            </el-table-column>    
 | 
				
			||||||
            <el-table-column label="数量(kg)" align="center" prop="" :show-overflow-tooltip="true" width="150">
 | 
					            <el-table-column align="center" prop="purchaseNum" :show-overflow-tooltip="true" width="150">
 | 
				
			||||||
 | 
					                 <template slot="header" slot-scope="scope">
 | 
				
			||||||
 | 
					                    <span>数量(kg)</span>
 | 
				
			||||||
 | 
					                    <el-button type="text" style="margin-left: 10px;" @click="">取整</el-button>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					                <template slot-scope="scope"> 
 | 
				
			||||||
 | 
					                    <el-input  v-model="scope.row.purchaseNum" maxlength="10" clearable @input="(v)=>(scope.row.purchaseNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
            </el-table-column>  
 | 
					            </el-table-column>  
 | 
				
			||||||
        </el-table>
 | 
					        </el-table> 
 | 
				
			||||||
 | 
					 | 
				
			||||||
       
 | 
					 | 
				
			||||||
      <div slot="footer" class="dialog-footer">
 | 
					      <div slot="footer" class="dialog-footer">
 | 
				
			||||||
        <el-button type="primary" @click="submitPlan">生成采购计划</el-button>
 | 
					        <el-button type="primary" @click="submitPlan">生成采购计划</el-button>
 | 
				
			||||||
        <el-button @click="cancel">取 消</el-button>
 | 
					        <el-button @click="cancel">取 消</el-button>
 | 
				
			||||||
| 
						 | 
					@ -201,9 +206,9 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";  
 | 
					import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";  
 | 
				
			||||||
import { supplierPageApi } from "@/api/foodManage/purchaseManage"; 
 | 
					import { supplierPageApi,dishesConvertApi } from "@/api/foodManage/purchaseManage"; 
 | 
				
			||||||
import { productionPlanPageApi,delProductionPlanApi } from "@/api/foodManage/purchaseManage"; 
 | 
					import { productionPlanPageApi,delProductionPlanApi,getProductionPlanInfoApi,addPurchasePlanApi } from "@/api/foodManage/purchaseManage";  
 | 
				
			||||||
import { addPurchaseInspectApi } from "../../../../api/foodManage/purchaseManage";
 | 
					import { getSettingListApi } from "@/api/foodManage/baseInfo.js";
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    name: "",
 | 
					    name: "",
 | 
				
			||||||
    dicts: [],
 | 
					    dicts: [],
 | 
				
			||||||
| 
						 | 
					@ -267,6 +272,8 @@ export default {
 | 
				
			||||||
            open: false, 
 | 
					            open: false, 
 | 
				
			||||||
            loading2: false, 
 | 
					            loading2: false, 
 | 
				
			||||||
            dialogTableList: [], 
 | 
					            dialogTableList: [], 
 | 
				
			||||||
 | 
					            rowData:{},
 | 
				
			||||||
 | 
					            material_conversion_rounding_method:null,//配置-菜品原料换算取整方式
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    created() { 
 | 
					    created() { 
 | 
				
			||||||
| 
						 | 
					@ -275,6 +282,17 @@ export default {
 | 
				
			||||||
      this.getList();
 | 
					      this.getList();
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
 | 
					        getSettings(){
 | 
				
			||||||
 | 
					            getSettingListApi().then(response => { 
 | 
				
			||||||
 | 
					                let arr = response.rows;
 | 
				
			||||||
 | 
					                arr.forEach(item=>{
 | 
				
			||||||
 | 
					                    if(item.itemName=='material_conversion_rounding_method'){
 | 
				
			||||||
 | 
					                        this.material_conversion_rounding_method = item.itemValue
 | 
				
			||||||
 | 
					                    } 
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
 | 
					                console.log(this.material_conversion_rounding_method)
 | 
				
			||||||
 | 
					            }); 
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        //区域树
 | 
					        //区域树
 | 
				
			||||||
        getAreaTreeData() {
 | 
					        getAreaTreeData() {
 | 
				
			||||||
            systemAreaTreeApi({}).then((response) => {
 | 
					            systemAreaTreeApi({}).then((response) => {
 | 
				
			||||||
| 
						 | 
					@ -358,26 +376,30 @@ export default {
 | 
				
			||||||
            this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} });
 | 
					            this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 生成采购计划操作 */
 | 
					        /** 生成采购计划操作 */
 | 
				
			||||||
        handlePurchasePlan(row) { //purchaseManage/planEdit
 | 
					        handlePurchasePlan(row) { //purchaseManage/purchasePlanEdit
 | 
				
			||||||
            this.dialogTableList = []; 
 | 
					            this.dialogTableList = []; 
 | 
				
			||||||
            // let param = { 
 | 
					            this.rowData = row
 | 
				
			||||||
                // "productionPlanCode": this.queryParams.productionPlanCode,     
 | 
					             let param = {
 | 
				
			||||||
                // "goodsType":1,
 | 
					                planId:row.planId
 | 
				
			||||||
                // "areaId": this.queryParams.areaId,  
 | 
					            }
 | 
				
			||||||
                // "canteenId": this.queryParams.canteenId,  
 | 
					            //查询查询食堂下拉结构
 | 
				
			||||||
                // "stallId": this.queryParams.stallId,  
 | 
					            getProductionPlanInfoApi(param).then((response) => {
 | 
				
			||||||
                // "status": this.queryParams.status,  
 | 
					                let param = response.data.productionPlanDetailVOList
 | 
				
			||||||
                // "decompositionState": this.queryParams.decompositionState,   
 | 
					                this.loading2=true;
 | 
				
			||||||
            // }
 | 
					                dishesConvertApi(param).then(response => {
 | 
				
			||||||
            // this.loading2=true;
 | 
					                    this.dialogTableList = response;  
 | 
				
			||||||
            // productionPlanPageApi(param).then(response => {
 | 
					                    this.dialogTableList.forEach((item)=>{
 | 
				
			||||||
            //     this.dialogTableList = response.rows;  
 | 
					                        this.$set(item,"rate",0)
 | 
				
			||||||
                this.title = "生成采购计划"
 | 
					                        this.$set(item,"purchaseNum",item.totalConvertWeight) 
 | 
				
			||||||
                this.open=true;
 | 
					                    })
 | 
				
			||||||
            //     this.loading2 = false;
 | 
					                    this.title = "生成采购计划"
 | 
				
			||||||
            // }).catch(() => {
 | 
					                    this.open=true;
 | 
				
			||||||
            //     this.loading2 = false;
 | 
					                    this.loading2 = false;
 | 
				
			||||||
            // });
 | 
					                }).catch(() => {
 | 
				
			||||||
 | 
					                    this.loading2 = false;
 | 
				
			||||||
 | 
					                }); 
 | 
				
			||||||
 | 
					            }) 
 | 
				
			||||||
 | 
					           
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        // 取消按钮
 | 
					        // 取消按钮
 | 
				
			||||||
        cancel() {
 | 
					        cancel() {
 | 
				
			||||||
| 
						 | 
					@ -385,8 +407,31 @@ export default {
 | 
				
			||||||
            this.dialogTableList = []; 
 | 
					            this.dialogTableList = []; 
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 提交按钮 */
 | 
					        /** 提交按钮 */
 | 
				
			||||||
        submitPlan: {
 | 
					        submitPlan() {
 | 
				
			||||||
             
 | 
					            let param = {
 | 
				
			||||||
 | 
					                "status": 1,
 | 
				
			||||||
 | 
					                "purchaseDate": this.formatDateTime(new Date()), 
 | 
				
			||||||
 | 
					                "productionPlanId": this.rowData.planId,  
 | 
				
			||||||
 | 
					                "areaId": this.rowData.areaId,
 | 
				
			||||||
 | 
					                "canteenId": this.rowData.canteenId,
 | 
				
			||||||
 | 
					                "stallId": this.rowData.stallId,
 | 
				
			||||||
 | 
					                "purchaseBudgetTotal": 0,  
 | 
				
			||||||
 | 
					                "totalNum": 0, 
 | 
				
			||||||
 | 
					                "purchasePlanDetailList":[]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            this.dialogTableList.forEach(item=>{ 
 | 
				
			||||||
 | 
					                    let obj = Object.assign({}, item)
 | 
				
			||||||
 | 
					                    obj.productionPlanNum = Number(obj.purchaseNum)
 | 
				
			||||||
 | 
					                    obj.unitPrice = 100
 | 
				
			||||||
 | 
					                    obj.purchasingBudgetPrice =  (100*Number(obj.purchaseNum))
 | 
				
			||||||
 | 
					                    param.purchasePlanDetailList.push(obj)
 | 
				
			||||||
 | 
					                    param.totalNum = param.totalNum+Number(obj.purchaseNum)
 | 
				
			||||||
 | 
					                    param.purchaseBudgetTotal = param.purchaseBudgetTotal+obj.purchasingBudgetPrice 
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            addPurchasePlanApi(param).then((response) => { 
 | 
				
			||||||
 | 
					                let res = response.data;//planId
 | 
				
			||||||
 | 
					                this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanEdit",query: {purchasePlanRowData:JSON.stringify(res)} }); 
 | 
				
			||||||
 | 
					            }).catch(() => {});
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 删除按钮操作 */
 | 
					        /** 删除按钮操作 */
 | 
				
			||||||
        handleDelete(row) { 
 | 
					        handleDelete(row) { 
 | 
				
			||||||
| 
						 | 
					@ -396,7 +441,11 @@ export default {
 | 
				
			||||||
                this.getList();
 | 
					                this.getList();
 | 
				
			||||||
                this.$modal.msgSuccess("删除成功");
 | 
					                this.$modal.msgSuccess("删除成功");
 | 
				
			||||||
            }).catch(() => {});
 | 
					            }).catch(() => {});
 | 
				
			||||||
        }, 
 | 
					        },  
 | 
				
			||||||
 | 
					        inputRate(row){ 
 | 
				
			||||||
 | 
					            this.$set(row,"rate",row.rate.replace(/[^\d]/g,''))
 | 
				
			||||||
 | 
					            this.$set(row,"purchaseNum",(row.totalConvertWeight*((Number(row.rate)/100)+1)).toFixed(4))
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        defaultDateRange() {
 | 
					        defaultDateRange() {
 | 
				
			||||||
          const end = new Date(new Date().toLocaleDateString());
 | 
					          const end = new Date(new Date().toLocaleDateString());
 | 
				
			||||||
          end.setTime(end.getTime() + 24 * 60 * 60 * 1000 -1);
 | 
					          end.setTime(end.getTime() + 24 * 60 * 60 * 1000 -1);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -113,7 +113,7 @@
 | 
				
			||||||
<script>  
 | 
					<script>  
 | 
				
			||||||
import { getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage";
 | 
					import { getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage";
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    name: "PlanDetail",
 | 
					    name: "PurchasePlanDetail",
 | 
				
			||||||
    dicts: [],
 | 
					    dicts: [],
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
| 
						 | 
					@ -194,7 +194,7 @@ export default {
 | 
				
			||||||
    methods: { 
 | 
					    methods: { 
 | 
				
			||||||
        // 返回列表页
 | 
					        // 返回列表页
 | 
				
			||||||
        jumpList() {
 | 
					        jumpList() {
 | 
				
			||||||
            const obj = { path: "foodManage/purchaseManage/planEdit" };
 | 
					            const obj = { path: "foodManage/purchaseManage/purchasePlanEdit" };
 | 
				
			||||||
            this.$tab.closeOpenPage(obj);
 | 
					            this.$tab.closeOpenPage(obj);
 | 
				
			||||||
            this.$router.replace({ path: "/foodManage/purchaseManage/purchasePlan" }); // 要打开的页面 
 | 
					            this.$router.replace({ path: "/foodManage/purchaseManage/purchasePlan" }); // 要打开的页面 
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -182,11 +182,11 @@ import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/ap
 | 
				
			||||||
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";  
 | 
					import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";  
 | 
				
			||||||
import { getPurchasePlanInfoApi, addPurchasePlanApi, editPurchasePlanApi } from "@/api/foodManage/purchaseManage";
 | 
					import { getPurchasePlanInfoApi, addPurchasePlanApi, editPurchasePlanApi } from "@/api/foodManage/purchaseManage";
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    name: "PlanEdit",
 | 
					    name: "PurchasePlanEdit",
 | 
				
			||||||
    dicts: [],
 | 
					    dicts: [],
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
        purchasePlanRowData:{},//页面传参
 | 
					        purchasePlanRowData:{},//编辑页面传参 
 | 
				
			||||||
        loading:false,
 | 
					        loading:false,
 | 
				
			||||||
        loadingBtn:false,
 | 
					        loadingBtn:false,
 | 
				
			||||||
        baseInfo: {},
 | 
					        baseInfo: {},
 | 
				
			||||||
| 
						 | 
					@ -195,9 +195,9 @@ export default {
 | 
				
			||||||
            purchaseDate: [
 | 
					            purchaseDate: [
 | 
				
			||||||
                { required: true, message: "采购日期不能为空", trigger: "change" }
 | 
					                { required: true, message: "采购日期不能为空", trigger: "change" }
 | 
				
			||||||
            ], 
 | 
					            ], 
 | 
				
			||||||
            deliverGoodsDate: [
 | 
					            // deliverGoodsDate: [
 | 
				
			||||||
                { required: true, message: "交货日期不能为空", trigger: "change" }
 | 
					            //     { required: true, message: "交货日期不能为空", trigger: "change" }
 | 
				
			||||||
            ],  
 | 
					            // ],  
 | 
				
			||||||
            areaId: [
 | 
					            areaId: [
 | 
				
			||||||
                { required: true, message: "所属区域不能为空", trigger: "change" }
 | 
					                { required: true, message: "所属区域不能为空", trigger: "change" }
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
| 
						 | 
					@ -228,8 +228,7 @@ export default {
 | 
				
			||||||
        total: 0, // 总条数
 | 
					        total: 0, // 总条数
 | 
				
			||||||
        tableListData: [],//货品弹窗-货品表格数据
 | 
					        tableListData: [],//货品弹窗-货品表格数据
 | 
				
			||||||
        batchChosenMaterial:[],//货品弹窗-货品表格-选中的货品数组
 | 
					        batchChosenMaterial:[],//货品弹窗-货品表格-选中的货品数组
 | 
				
			||||||
        noMaterial:false, 
 | 
					        noMaterial:false,
 | 
				
			||||||
        
 | 
					 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    created() {
 | 
					    created() {
 | 
				
			||||||
| 
						 | 
					@ -245,19 +244,17 @@ export default {
 | 
				
			||||||
            if(newId){
 | 
					            if(newId){
 | 
				
			||||||
                this.purchasePlanRowData = JSON.parse(newId)
 | 
					                this.purchasePlanRowData = JSON.parse(newId)
 | 
				
			||||||
                this.getContractInfo()
 | 
					                this.getContractInfo()
 | 
				
			||||||
            }else{
 | 
					 | 
				
			||||||
                this.baseInfo={}
 | 
					 | 
				
			||||||
                this.materialList=[]
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: { 
 | 
					    methods: { 
 | 
				
			||||||
        // 返回列表页
 | 
					        // 返回列表页
 | 
				
			||||||
        jumpList() {
 | 
					        jumpList() {
 | 
				
			||||||
            const obj = { path: "foodManage/purchaseManage/planEdit" };
 | 
					            const obj = { path: "foodManage/purchaseManage/purchasePlanEdit" };
 | 
				
			||||||
            this.$tab.closeOpenPage(obj);
 | 
					            this.$tab.closeOpenPage(obj);
 | 
				
			||||||
            this.$router.replace({ path: "/foodManage/purchaseManage/purchasePlan" }); // 要打开的页面 
 | 
					            this.$router.replace({ path: "/foodManage/purchaseManage/purchasePlan" }); // 要打开的页面 
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        //编辑计划-获取详情
 | 
				
			||||||
        getContractInfo(){
 | 
					        getContractInfo(){
 | 
				
			||||||
            console.log(this.purchasePlanRowData) 
 | 
					            console.log(this.purchasePlanRowData) 
 | 
				
			||||||
            let param = {
 | 
					            let param = {
 | 
				
			||||||
| 
						 | 
					@ -416,7 +413,9 @@ export default {
 | 
				
			||||||
                if (valid) { 
 | 
					                if (valid) { 
 | 
				
			||||||
                    let param = Object.assign({},this.baseInfo); 
 | 
					                    let param = Object.assign({},this.baseInfo); 
 | 
				
			||||||
                    param.purchaseDate = this.formatDateTime(this.baseInfo.purchaseDate)
 | 
					                    param.purchaseDate = this.formatDateTime(this.baseInfo.purchaseDate)
 | 
				
			||||||
                    param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)   
 | 
					                    if(this.baseInfo.deliverGoodsDate){
 | 
				
			||||||
 | 
					                        param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)   
 | 
				
			||||||
 | 
					                    }  
 | 
				
			||||||
                    param.purchaseBudgetTotal = 0
 | 
					                    param.purchaseBudgetTotal = 0
 | 
				
			||||||
                    param.totalNum=0
 | 
					                    param.totalNum=0
 | 
				
			||||||
                    param.status=1
 | 
					                    param.status=1
 | 
				
			||||||
| 
						 | 
					@ -477,7 +476,9 @@ export default {
 | 
				
			||||||
                if (valid) { 
 | 
					                if (valid) { 
 | 
				
			||||||
                    let param = Object.assign({},this.baseInfo); 
 | 
					                    let param = Object.assign({},this.baseInfo); 
 | 
				
			||||||
                    param.purchaseDate = this.formatDateTime(this.baseInfo.purchaseDate)
 | 
					                    param.purchaseDate = this.formatDateTime(this.baseInfo.purchaseDate)
 | 
				
			||||||
                    param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)   
 | 
					                    if(this.baseInfo.deliverGoodsDate){
 | 
				
			||||||
 | 
					                        param.deliverGoodsDate = this.formatDate(this.baseInfo.deliverGoodsDate)   
 | 
				
			||||||
 | 
					                    }  
 | 
				
			||||||
                    param.purchaseBudgetTotal = 0
 | 
					                    param.purchaseBudgetTotal = 0
 | 
				
			||||||
                    param.totalNum=0
 | 
					                    param.totalNum=0
 | 
				
			||||||
                    param.status=2
 | 
					                    param.status=2
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -307,15 +307,15 @@ export default {
 | 
				
			||||||
        },  
 | 
					        },  
 | 
				
			||||||
        /** 新增按钮操作 */
 | 
					        /** 新增按钮操作 */
 | 
				
			||||||
        handleAdd() {
 | 
					        handleAdd() {
 | 
				
			||||||
            this.$router.push({ path: "/foodManage/purchaseManage/planEdit" });
 | 
					            this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanEdit" });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 修改按钮操作 */
 | 
					        /** 修改按钮操作 */
 | 
				
			||||||
        handleView(row) { 
 | 
					        handleView(row) { 
 | 
				
			||||||
            this.$router.push({ path: "/foodManage/purchaseManage/planDetail",query: {purchasePlanRowData:JSON.stringify(row)} });
 | 
					            this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanDetail",query: {purchasePlanRowData:JSON.stringify(row)} });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        /** 修改按钮操作 */
 | 
					        /** 修改按钮操作 */
 | 
				
			||||||
        handleUpdate(row) { 
 | 
					        handleUpdate(row) { 
 | 
				
			||||||
            this.$router.push({ path: "/foodManage/purchaseManage/planEdit",query: {purchasePlanRowData:JSON.stringify(row)} });
 | 
					            this.$router.push({ path: "/foodManage/purchaseManage/purchasePlanEdit",query: {purchasePlanRowData:JSON.stringify(row)} });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        // 取消按钮
 | 
					        // 取消按钮
 | 
				
			||||||
        cancel() {
 | 
					        cancel() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1266,8 +1266,8 @@ export default {
 | 
				
			||||||
                    validateNewPassword(null, value, errorMessage)
 | 
					                    validateNewPassword(null, value, errorMessage)
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            }).then(({ value }) => {
 | 
					            }).then(({ value }) => {
 | 
				
			||||||
                    let password = encryptWithSM4(value)
 | 
					                    // let password = encryptWithSM4(value)
 | 
				
			||||||
                    resetUserPwd(row.userId, password).then((response) => {
 | 
					                    resetUserPwd(row.userId, value).then((response) => {
 | 
				
			||||||
                        this.$modal.msgSuccess('修改成功,新密码是:' + value)
 | 
					                        this.$modal.msgSuccess('修改成功,新密码是:' + value)
 | 
				
			||||||
                    })
 | 
					                    })
 | 
				
			||||||
            }).catch(() => {})
 | 
					            }).catch(() => {})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue