|
@@ -451,46 +451,43 @@ const cancel = () => {
|
|
|
};
|
|
|
|
|
|
const startToSelectAheads = () => {
|
|
|
-
|
|
|
-if (!Number(toSelectCount.value)) {
|
|
|
-ElMessage.error("请输入正确的数字");
|
|
|
- return;
|
|
|
-}
|
|
|
- const count = Number(toSelectCount.value);
|
|
|
+ if (!Number(toSelectCount.value)) {
|
|
|
+ ElMessage.error("请输入正确的数字");
|
|
|
+ resetInput();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const count = Number(toSelectCount.value);
|
|
|
const seqNoList = options.value.map((item) => item.value);
|
|
|
formSeq.value.seqNoList = seqNoList.slice(0, count);
|
|
|
-if (options.value.length === 0) {
|
|
|
- ElMessage.error("请先选择工单和工序");
|
|
|
- toSelectStartCount.value = null;
|
|
|
- toSelectEndCount.value = null;
|
|
|
- return;
|
|
|
- }
|
|
|
- const start = Number(toSelectStartCount.value);
|
|
|
- const end = Number(toSelectEndCount.value);
|
|
|
- const seqNoList = options.value.map((item) => item.value);
|
|
|
- const seqListlength = seqNoList.length;
|
|
|
- if (Number.isInteger(start) && start > 0 && end === 0) {
|
|
|
- form.value.seqNoList = seqNoList.slice(start - 1, seqListlength);
|
|
|
- isAllChecked(form.value.seqNoList.length, seqNoList.length);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (Number.isInteger(end) && end > 0 && start === 0) {
|
|
|
- form.value.seqNoList = seqNoList.slice(0, end);
|
|
|
- isAllChecked(form.value.seqNoList.length, seqNoList.length);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (
|
|
|
- Number.isInteger(start) &&
|
|
|
- Number.isInteger(end) &&
|
|
|
- start > 0 &&
|
|
|
- end > 0
|
|
|
- ) {
|
|
|
- form.value.seqNoList = seqNoList.slice(start - 1, end);
|
|
|
- isAllChecked(form.value.seqNoList.length, seqNoList.length);
|
|
|
- return;
|
|
|
- }
|
|
|
- resetInput();
|
|
|
- ElMessage.error("请输入正确的数字");
|
|
|
+ if (options.value.length === 0) {
|
|
|
+ ElMessage.error("请先选择工单和工序");
|
|
|
+ toSelectStartCount.value = null;
|
|
|
+ toSelectEndCount.value = null;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const start = Number(toSelectStartCount.value);
|
|
|
+ const end = Number(toSelectEndCount.value);
|
|
|
+ const seqListlength = seqNoList.length;
|
|
|
+ if (Number.isInteger(start) && start > 0 && end === 0) {
|
|
|
+ form.value.seqNoList = seqNoList.slice(start - 1, seqListlength);
|
|
|
+ isAllChecked(form.value.seqNoList.length, seqNoList.length);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Number.isInteger(end) && end > 0 && start === 0) {
|
|
|
+ form.value.seqNoList = seqNoList.slice(0, end);
|
|
|
+ isAllChecked(form.value.seqNoList.length, seqNoList.length);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ Number.isInteger(start) &&
|
|
|
+ Number.isInteger(end) &&
|
|
|
+ start > 0 &&
|
|
|
+ end > 0
|
|
|
+ ) {
|
|
|
+ form.value.seqNoList = seqNoList.slice(start - 1, end);
|
|
|
+ isAllChecked(form.value.seqNoList.length, seqNoList.length);
|
|
|
+ return;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const isAllChecked = (choseLength, seqLength) => {
|