|
@@ -3,46 +3,64 @@
|
|
|
<view class="font-bold mt-16" style="padding: 0 20rpx">
|
|
<view class="font-bold mt-16" style="padding: 0 20rpx">
|
|
|
该书共{{ detail.num }}本,其中:良好{{ getAuditCateNum(1) }}本,一般{{ getAuditCateNum(2) }}本,极差{{ getAuditCateNum(3) }}本
|
|
该书共{{ detail.num }}本,其中:良好{{ getAuditCateNum(1) }}本,一般{{ getAuditCateNum(2) }}本,极差{{ getAuditCateNum(3) }}本
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="mt-10 bind-code" style="padding: 10rpx 20rpx">
|
|
|
|
|
- SH码:未绑码
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
|
|
|
- <view class="mt-20 bg-white flex flex-j-a flex-a-c" style="padding:20rpx;border-radius: 10rpx;">
|
|
|
|
|
- <view class="u-page__tag-item" v-for="(item, index) in auditList" :key="index">
|
|
|
|
|
- <u-tag size="large" :text="item.label" :plain="current != item.sts" type="primary" :name="item.sts"
|
|
|
|
|
- @click="radioClick">
|
|
|
|
|
- </u-tag>
|
|
|
|
|
|
|
+ <view v-if="auditCommentList.length > 0" v-for="(audit, index) in auditCommentList" :key="index">
|
|
|
|
|
+ <view class="mt-10 bind-code" style="padding: 10rpx 20rpx">
|
|
|
|
|
+ 第{{ index + 1 }}本的审核意见
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="mt-20 bg-white flex flex-j-a flex-a-c" style="padding:20rpx;border-radius: 10rpx;">
|
|
|
|
|
+ <view class="u-page__tag-item" v-for="(item, idx) in auditList" :key="idx">
|
|
|
|
|
+ <u-tag size="large" :text="item.label" :plain="audit.sts != item.sts" type="primary"
|
|
|
|
|
+ :name="item.sts" :class="{ 'disabled': item.sts == 2 }"
|
|
|
|
|
+ @click="radioClick(audit, index, item.sts)">
|
|
|
|
|
+ </u-tag>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
|
|
|
|
- <view class="mt-20 bg-white" style="padding:20rpx;border-radius: 10rpx;" v-if="current == 3">
|
|
|
|
|
- <view class="flex flex-a-c flex-wrap">
|
|
|
|
|
- <text class="mr-10 reason-item" v-for="(item, index) in reasonList" :key="index"
|
|
|
|
|
- @click="toggleReason(item)" :class="{ 'selected': selectedReasons.includes(item.label) }">
|
|
|
|
|
- <view class="ml-10">{{ item.label }}</view>
|
|
|
|
|
- </text>
|
|
|
|
|
|
|
+ <view class="mt-20 bg-white" style="padding:20rpx;border-radius: 10rpx;" v-if="audit.sts == 3">
|
|
|
|
|
+ <view class="flex flex-a-c flex-wrap">
|
|
|
|
|
+ <view class="mr-10 reason-item" v-for="(item, idx) in reasonList" :key="idx"
|
|
|
|
|
+ @click="toggleReason(audit, index, item)"
|
|
|
|
|
+ :class="{ 'selected': audit.comList.includes(item.label) }">
|
|
|
|
|
+ {{ item.label }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
|
+import { ref, watch } from 'vue';
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
detail: {
|
|
detail: {
|
|
|
type: Object,
|
|
type: Object,
|
|
|
default: () => ({})
|
|
default: () => ({})
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const auditList = ref([{ sts: 1, label: '品相良好' }, { sts: 2, label: '品相一般', disabled: true }, { sts: 3, label: '品相极差' }])
|
|
|
|
|
-const current = ref(0)
|
|
|
|
|
|
|
|
|
|
-const radioClick = (index) => {
|
|
|
|
|
- current.value = index
|
|
|
|
|
|
|
+const auditCommentList = ref([])
|
|
|
|
|
+watch(() => props.detail?.auditCommentList, (newVal) => {
|
|
|
|
|
+ if (!newVal) return
|
|
|
|
|
+ auditCommentList.value = newVal.map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ isbn: props.detail.isbn,
|
|
|
|
|
+ comList: item.com ? (typeof item.com === 'string' ? item.com.split(',') : item.com) : []
|
|
|
|
|
+ }))
|
|
|
|
|
+}, { immediate: true, deep: true })
|
|
|
|
|
|
|
|
- let data = formatReason()
|
|
|
|
|
- emit('selected', data)
|
|
|
|
|
|
|
+const auditList = ref([{ sts: 1, label: '品相良好' }, { sts: 2, label: '品相一般', disabled: true }, { sts: 3, label: '品相极差' }])
|
|
|
|
|
+const emit = defineEmits(['selected'])
|
|
|
|
|
+const radioClick = (audit, index, sts) => {
|
|
|
|
|
+ if (sts == 2) return
|
|
|
|
|
+ audit.sts = sts
|
|
|
|
|
+ auditCommentList.value[index] = audit
|
|
|
|
|
+ formatReason()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const getAuditCateNum = (cate) => {
|
|
const getAuditCateNum = (cate) => {
|
|
@@ -65,29 +83,31 @@ let reasonList = ref([
|
|
|
{ sts: 3, label: '图书馆/藏书印章' }
|
|
{ sts: 3, label: '图书馆/藏书印章' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-function formatReason() {
|
|
|
|
|
- return [
|
|
|
|
|
- {
|
|
|
|
|
- "isbn": props.detail.isbn,
|
|
|
|
|
- "sts": current.value,
|
|
|
|
|
- "com": selectedReasons.value.join(',')
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+const formatReason = () => {
|
|
|
|
|
+ let list = auditCommentList.value.map((item, index) => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ idx: index,
|
|
|
|
|
+ com: item.comList.join(',')
|
|
|
|
|
+ }))
|
|
|
|
|
+ console.log(list, 'list')
|
|
|
|
|
+ return list
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const emit = defineEmits(['selected'])
|
|
|
|
|
-const selectedReasons = ref([]);
|
|
|
|
|
-const toggleReason = (item) => {
|
|
|
|
|
- const index = selectedReasons.value.indexOf(item.label);
|
|
|
|
|
- if (index > -1) {
|
|
|
|
|
- selectedReasons.value.splice(index, 1);
|
|
|
|
|
|
|
+const toggleReason = (audit, index, item) => {
|
|
|
|
|
+ const idx = audit.comList.indexOf(item.label)
|
|
|
|
|
+
|
|
|
|
|
+ if (idx > -1) {
|
|
|
|
|
+ audit.comList.splice(idx, 1)
|
|
|
} else {
|
|
} else {
|
|
|
- selectedReasons.value.push(item.label);
|
|
|
|
|
|
|
+ audit.comList.push(item.label)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ auditCommentList.value[index] = audit
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- let data = formatReason()
|
|
|
|
|
- emit('selected', data)
|
|
|
|
|
-};
|
|
|
|
|
|
|
+defineExpose({
|
|
|
|
|
+ formatReason
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -106,4 +126,8 @@ const toggleReason = (item) => {
|
|
|
.selected {
|
|
.selected {
|
|
|
background-color: #d0e8ff;
|
|
background-color: #d0e8ff;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.disabled {
|
|
|
|
|
+ background-color: #d0d0d0;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|