|
@@ -159,18 +159,37 @@
|
|
|
<el-checkbox v-model="checkAll" @change="handleCheckAll">
|
|
|
全选
|
|
|
</el-checkbox>
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ margin: auto 10px auto 10px;
|
|
|
+ vertical-align: 2px;
|
|
|
+ font-weight: 200;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 管号总数: {{ options.length }}
|
|
|
+ </span>
|
|
|
<el-input
|
|
|
- v-model="toSelectCount"
|
|
|
- placeholder="请输入选中前面数量"
|
|
|
+ v-model="toSelectStartCount"
|
|
|
+ placeholder="请输入开始区间"
|
|
|
+ class="selectInput"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ <span style="margin: 0 0 0 10px">-</span>
|
|
|
+ <el-input
|
|
|
+ v-model="toSelectEndCount"
|
|
|
+ placeholder="请输入结束区间"
|
|
|
class="selectInput"
|
|
|
size="small"
|
|
|
>
|
|
|
- <template #append>
|
|
|
- <el-button type="primary" @click="startToSelectAheads"
|
|
|
- >选择</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
</el-input>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="startToSelectAheads"
|
|
|
+ size="small"
|
|
|
+ class="confirmBtn"
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -255,6 +274,8 @@ const ExDataObj = ref({});
|
|
|
const workOderShow = ref(false);
|
|
|
const showProList = ref([]);
|
|
|
const showSeqList = ref([]);
|
|
|
+const toSelectStartCount = ref(null);
|
|
|
+const toSelectEndCount = ref(null);
|
|
|
const showSeq = (seqs) => {
|
|
|
showSeqList.value = seqs;
|
|
|
dialog2.visible = true;
|
|
@@ -317,6 +338,8 @@ const submit = async () => {
|
|
|
ElMessage.warning("请检查表单选项");
|
|
|
}
|
|
|
});
|
|
|
+ toSelectStartCount.value = null;
|
|
|
+ toSelectEndCount.value = null;
|
|
|
};
|
|
|
const closeShow = () => {
|
|
|
workOderShow.value = false;
|
|
@@ -326,6 +349,8 @@ const resetForm = () => {
|
|
|
formSeq.value.seqNoList = [];
|
|
|
formSeq.value.workOrderCode = "";
|
|
|
formSeq.value.operationId = "";
|
|
|
+ options.value = [];
|
|
|
+ operations.value = [];
|
|
|
};
|
|
|
const toAdd = async () => {
|
|
|
const { code } = await addReplace({ ...formSeq.value });
|
|
@@ -396,7 +421,6 @@ const setOperationList = async () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const seqListlength = ref(null);
|
|
|
const setSeqList = async () => {
|
|
|
formSeq.value.seqNoList = [];
|
|
|
const { data } = await getSeqList(
|
|
@@ -422,16 +446,57 @@ const add = () => {
|
|
|
const cancel = () => {
|
|
|
resetForm();
|
|
|
dialog.visible = false;
|
|
|
+ toSelectStartCount.value = null;
|
|
|
+ toSelectEndCount.value = null;
|
|
|
};
|
|
|
|
|
|
-const toSelectCount = ref(null);
|
|
|
const startToSelectAheads = () => {
|
|
|
- if (Number(toSelectCount.value)) {
|
|
|
- const count = Number(toSelectCount.value);
|
|
|
+
|
|
|
+if (!Number(toSelectCount.value)) {
|
|
|
+ElMessage.error("请输入正确的数字");
|
|
|
+ return;
|
|
|
+}
|
|
|
+ const count = Number(toSelectCount.value);
|
|
|
const seqNoList = options.value.map((item) => item.value);
|
|
|
formSeq.value.seqNoList = seqNoList.slice(0, count);
|
|
|
- } else {
|
|
|
- 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 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("请输入正确的数字");
|
|
|
+};
|
|
|
+
|
|
|
+const isAllChecked = (choseLength, seqLength) => {
|
|
|
+ if (choseLength === seqLength) {
|
|
|
+ checkAll.value = true; } else {
|
|
|
+ checkAll.value = false;
|
|
|
}
|
|
|
};
|
|
|
onMounted(() => {
|
|
@@ -514,7 +579,11 @@ option.value = Object.assign(option.value, {
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
.selectInput {
|
|
|
- width: 30%;
|
|
|
+ width: 20%;
|
|
|
+ margin: 0 0 8px 10px;
|
|
|
+}
|
|
|
+.confirmBtn {
|
|
|
margin: 0 0 8px 10px;
|
|
|
+ height: 22px;
|
|
|
}
|
|
|
</style>
|