|
@@ -85,22 +85,24 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
const toCreateORDelMtrlPf = (type: number, list: any) => {
|
|
|
if (type === 1) {
|
|
|
- const $table = state.QdTableRef.element;
|
|
|
- if ($table) {
|
|
|
- $table.clearEdit();
|
|
|
-
|
|
|
- const { visibleData } = $table.getTableData();
|
|
|
- console.log("visibleData :>> ", visibleData);
|
|
|
- try {
|
|
|
- visibleData.map((o, idx) => {
|
|
|
- if (!o.erp_mtrlid && idx > 35) {
|
|
|
- state.QdTableRef.scrollTo(o, "erp_mtrlid");
|
|
|
- throw new Error(`第${idx + 1}行:产品补充未填入L1物料信息,请先选择L1物料修改`);
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (error) {
|
|
|
- ElMessage.error(error.message);
|
|
|
- return false;
|
|
|
+ if (state.QdTableRef) {
|
|
|
+ const $table = state.QdTableRef.element;
|
|
|
+ if ($table) {
|
|
|
+ $table.clearEdit();
|
|
|
+
|
|
|
+ const { visibleData } = $table.getTableData();
|
|
|
+ console.log("visibleData :>> ", visibleData);
|
|
|
+ try {
|
|
|
+ visibleData.map((o, idx) => {
|
|
|
+ if (!o.erp_mtrlid && o.actual_useqty <= 0) {
|
|
|
+ state.QdTableRef.scrollTo(o, "erp_mtrlid");
|
|
|
+ throw new Error(`第${idx + 1}行:产品补充未填入L1物料信息,请先选择L1物料修改`);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error(error.message);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|