|
@@ -60,34 +60,37 @@
|
|
|
>
|
|
|
{{ breadTitle }}
|
|
|
</div>
|
|
|
- <div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex">
|
|
|
- <div>物料名称:</div>
|
|
|
- <div class="font-['PingFang-SC'] text-sm font-normal">{{ selectMaterialName }}</div>
|
|
|
- </div>
|
|
|
- <div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex">
|
|
|
- <div class="min-w-20">物料规格:</div>
|
|
|
- <div>
|
|
|
- <van-tag
|
|
|
- v-for="i in wlList"
|
|
|
- :key="i.id"
|
|
|
- :color="i.id === wlSelectId ? '#004EA2' : '#F0F0F0'"
|
|
|
- :text-color="i.id === wlSelectId ? '#FFFFFF' : '#000000'"
|
|
|
- class="m-1 h-[35px] leading-[35px]"
|
|
|
- @click="changeWlCode(i)"
|
|
|
- >{{ i.specifications }}</van-tag
|
|
|
- >
|
|
|
+ <template v-if="wlList.length > 0">
|
|
|
+ <div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex">
|
|
|
+ <div>物料名称:</div>
|
|
|
+ <div class="font-['PingFang-SC'] text-sm font-normal">{{ selectMaterialName }}</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex items-center">
|
|
|
- <div>物料编码:</div>
|
|
|
- <div>{{ selectWlCode }}</div>
|
|
|
- <van-icon
|
|
|
- v-show="selectWlCode"
|
|
|
- name="description-o"
|
|
|
- class="text-[#004EA2] description-o ml-1 cursor-pointer"
|
|
|
- @click="codeCopy"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex">
|
|
|
+ <div class="min-w-20">物料规格:</div>
|
|
|
+ <div>
|
|
|
+ <van-tag
|
|
|
+ v-for="i in wlList"
|
|
|
+ :key="i.id"
|
|
|
+ :color="i.id === wlSelectId ? '#004EA2' : '#F0F0F0'"
|
|
|
+ :text-color="i.id === wlSelectId ? '#FFFFFF' : '#000000'"
|
|
|
+ class="m-1 h-[35px] leading-[35px] cursor-pointer"
|
|
|
+ @click="changeWlCode(i)"
|
|
|
+ >{{ i.specifications }}</van-tag
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex items-center">
|
|
|
+ <div>物料编码:</div>
|
|
|
+ <div>{{ selectWlCode }}</div>
|
|
|
+ <van-icon
|
|
|
+ v-show="selectWlCode"
|
|
|
+ name="description-o"
|
|
|
+ class="text-[#004EA2] description-o ml-1 cursor-pointer"
|
|
|
+ @click="codeCopy"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<div class="font-['PingFang-SC'] text-sm font-normal mt-10">
|
|
|
<div>附件:</div>
|
|
|
<van-cell-group>
|
|
@@ -122,12 +125,12 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
import { detailList } from '@/api/index.js'
|
|
|
import Clipboard from 'clipboard'
|
|
|
import { listTools } from '@/api/index.js'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const route = useRoute()
|
|
|
const queryId = ref(route.query.id)
|
|
|
const queryToolName = ref(route.query.toolName)
|
|
|
-console.log('route.query.id', queryId.value)
|
|
|
|
|
|
const wlList = ref([])
|
|
|
const wlSelectId = ref(0)
|
|
@@ -142,9 +145,9 @@ const breadTitle = ref('')
|
|
|
const typeOptions1Ref = ref([])
|
|
|
const init = () => {
|
|
|
detailList({ id: queryId.value }).then((res) => {
|
|
|
- const toolDetails = res.data.toolDetails
|
|
|
+ const toolDetails = res.data.toolDetails || []
|
|
|
wlList.value = toolDetails.filter((item) => item.informationType === 'wl')
|
|
|
- console.log(wlList.value)
|
|
|
+ // console.log(wlList.value)
|
|
|
if (wlList.value.length > 0) {
|
|
|
selectWlCode.value = wlList.value[0].materialNo
|
|
|
selectMaterialName.value = wlList.value[0].materialName
|
|
@@ -183,9 +186,11 @@ const codeCopy = async () => {
|
|
|
// 添加成功事件处理函数
|
|
|
clipboard.on('success', (e) => {
|
|
|
e.clearSelection()
|
|
|
+ ElMessage.success('粘贴成功')
|
|
|
})
|
|
|
// 添加失败事件处理函数
|
|
|
clipboard.on('error', () => {
|
|
|
+ ElMessage.error('无法复制到剪贴板!')
|
|
|
console.warn('无法复制到剪贴板!')
|
|
|
})
|
|
|
}
|
|
@@ -198,7 +203,7 @@ const changeWlCode = ({ id, materialNo, materialName }) => {
|
|
|
// informationType 物料 wl 点击切换 物料编码 materialNo
|
|
|
// informationType 示意图 syt 左侧图
|
|
|
const fileDownload = ({ fileName, filePath }) => {
|
|
|
- console.log('filePath', filePath)
|
|
|
+ // console.log('filePath', filePath)
|
|
|
const el = document.createElement('a')
|
|
|
el.style.display = 'none'
|
|
|
el.setAttribute('target', '_blank')
|