|
@@ -9,15 +9,54 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 变量控制样式 -->
|
|
|
- <div class="footerBtn">
|
|
|
- <el-button
|
|
|
+ <div class="select">
|
|
|
+ <div class="describeText" style="width: 130px">绑定设备:</div>
|
|
|
+
|
|
|
+ <el-select
|
|
|
v-if="!item.equitCode"
|
|
|
+ multiple
|
|
|
+ @click="getdevicelist(item.equitType, item)"
|
|
|
+ v-model="item.inputValueVal"
|
|
|
+ placeholder="选择固有设备请点击"
|
|
|
+ size="large"
|
|
|
+ v-loading="item.loading"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="selectBtn" v-if="!item.equitCode">
|
|
|
+ <el-button
|
|
|
+ class="btn"
|
|
|
+ v-if="item.selectStatus"
|
|
|
+ style="background-color: #0a59f7"
|
|
|
+ @click="binding(item)"
|
|
|
+ :disabled="item.scanStatus"
|
|
|
+ >确认绑定</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn"
|
|
|
+ v-if="item.selectStatus"
|
|
|
+ type="info"
|
|
|
+ @click="cancel(item)"
|
|
|
+ :disabled="item.scanStatus"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="footerBtn" v-if="!item.selectStatus">
|
|
|
+ <el-button
|
|
|
+ v-if="!item.equitCode && !item.selectStatus"
|
|
|
class="bottomBtn"
|
|
|
style="background-color: #0a59f7"
|
|
|
+ :disabled="item.selectStatus"
|
|
|
@click="openScanCode(index)"
|
|
|
- >点击扫描设备</el-button
|
|
|
+ >点击扫描其它设备</el-button
|
|
|
>
|
|
|
- <div v-else class="infoBox">
|
|
|
+ <div v-if="item.equitCode" class="infoBox">
|
|
|
<div class="info">
|
|
|
<div>
|
|
|
<div class="describeText" style="text-align: left">
|
|
@@ -52,12 +91,49 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { equitList, equitUpdate, queryByCode } from "@/api/prosteps/shebeijilu";
|
|
|
+import {
|
|
|
+ equitList,
|
|
|
+ equitUpdate,
|
|
|
+ queryByCode,
|
|
|
+ devicelist,
|
|
|
+ batchDevice,
|
|
|
+} from "@/api/prosteps/shebeijilu";
|
|
|
import { useProcessStore } from "@/store";
|
|
|
defineOptions({ name: "Shebeijilu" });
|
|
|
+const selectStatus = ref(false);
|
|
|
+const scanStatus = ref(false);
|
|
|
+const binding = async (item: any) => {
|
|
|
+ try {
|
|
|
+ const { data } = await batchDevice({
|
|
|
+ deviceNoList: item.inputValueVal,
|
|
|
+ recordId: item.id,
|
|
|
+ });
|
|
|
+ ElMessage.success("绑定成功!");
|
|
|
+ getEquitList();
|
|
|
+ } catch {
|
|
|
+ } finally {
|
|
|
+ selectStatus.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+const cancel = (item: any) => {
|
|
|
+ item.selectStatus = false;
|
|
|
+ item.inputValueVal = [];
|
|
|
+};
|
|
|
+const selectLoading = ref(false);
|
|
|
const store = useProcessStore();
|
|
|
const equitListData = ref([]);
|
|
|
const selectIndex = ref(null);
|
|
|
+const getdevicelist = async (type: any, item: any) => {
|
|
|
+ item.selectStatus = true;
|
|
|
+ item.loading = true;
|
|
|
+ try {
|
|
|
+ const { data } = await devicelist({ deviceType: type });
|
|
|
+ option.value = data;
|
|
|
+ } catch {
|
|
|
+ } finally {
|
|
|
+ item.loading = false;
|
|
|
+ }
|
|
|
+};
|
|
|
const getEquitList = async () => {
|
|
|
const { data } = await equitList({
|
|
|
seqNo: store.scanInfo.seqNo,
|
|
@@ -73,6 +149,17 @@ const showStatusVal = ref(false);
|
|
|
const equitCheck = async () => {
|
|
|
await equitUpdate({});
|
|
|
};
|
|
|
+const option = ref([]);
|
|
|
+const options = computed(() => {
|
|
|
+ let array = [];
|
|
|
+ for (let i = 0; i < option.value.length; i++) {
|
|
|
+ array.push({
|
|
|
+ value: option.value[i].deviceNo,
|
|
|
+ label: option.value[i].deviceNo,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return array;
|
|
|
+});
|
|
|
const openScanCode = (index) => {
|
|
|
showStatusVal.value = true;
|
|
|
selectIndex.value = index;
|
|
@@ -97,32 +184,48 @@ onMounted(() => {
|
|
|
<style lang="scss" scoped>
|
|
|
.recordBox {
|
|
|
min-width: 600px;
|
|
|
- height: 210px;
|
|
|
background-color: white;
|
|
|
border-radius: 16px;
|
|
|
display: flex;
|
|
|
padding: $p20;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-between;
|
|
|
-
|
|
|
+ .select {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 5px;
|
|
|
+ }
|
|
|
.headerText {
|
|
|
}
|
|
|
|
|
|
.describeBox {
|
|
|
}
|
|
|
+ .selectBtn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 10px;
|
|
|
+ .btn {
|
|
|
+ width: 150px;
|
|
|
+ color: white;
|
|
|
+ height: 50px;
|
|
|
+ border-radius: 16px;
|
|
|
+ font-size: $f20;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //按钮样式
|
|
|
.footerBtn {
|
|
|
width: 100%;
|
|
|
- height: 70px;
|
|
|
background-color: #00000015;
|
|
|
border-radius: 16px;
|
|
|
overflow: hidden;
|
|
|
+ height: 50px;
|
|
|
+ margin-top: 10px;
|
|
|
|
|
|
.bottomBtn {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- font-size: $f24;
|
|
|
+ font-size: $f20;
|
|
|
color: white;
|
|
|
}
|
|
|
|