import request from "@/utils/request";
import { SERVICE_DATA_API_BASE } from "@/config/serviceSettings";

export let showStockCountModual = {
  methods: {
    showStockCount(itemId) {
      getStockCount({ itemId: itemId }).then((res) => {
        if (!res.success) {
          this.$exception(res);
          return;
        }
        if (res.data) {
            this.items[0].value = res.data[0].dtQty;
            this.items[1].value = res.data[0].kDt;
            this.items[2].value = res.data[0].hjQty;
            this.items[3].value = res.data[0].kHj;
        }
     
      });
    },
  },
};

function getStockCount(parameter) {
  return request({
    method: "post",
    url: SERVICE_DATA_API_BASE + "/search",
    data: {
      num: "212",
      params: parameter,
    },
  });
}
