
const productionPlanDetailStore = defineStore('productionPlanDetail', {
  state: () => ({
    productionPlanNo: null,
    productionPlanDetailQueryParams: null
  }),
  actions: {
    setProductionPlanDetailQueryParams(value) {
      this.productionPlanDetailQueryParams = value;
    },
    setProductionPlanNo(value) {
      this.productionPlanNo = value
      if (this.productionPlanDetailQueryParams != null) {
        this.productionPlanDetailQueryParams.productionPlanNo = value
      }
    },
    checkClean(obj) {
      // console.log(obj.name)
      if (obj.name == 'DayworkSelect') {
        this.productionPlanNo = null
        this.productionPlanDetailQueryParams = null
      }
    },
    allClean() {
      this.productionPlanNo = null
      this.productionPlanDetailQueryParams = null
    },
    otherClean(obj) {
      if (obj.name != 'DayworkSelect') {
        this.productionPlanNo = null
        this.productionPlanDetailQueryParams = null

      }
    }
  }
})

export default productionPlanDetailStore
