|
@@ -60,7 +60,7 @@
|
|
>
|
|
>
|
|
{{ breadTitle }}
|
|
{{ breadTitle }}
|
|
</div>
|
|
</div>
|
|
- <template v-if="wlList.length > 0">
|
|
|
|
|
|
+ <!-- <template v-if="wlList.length > 0">
|
|
<div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex">
|
|
<div class="font-['PingFang-SC'] text-sm font-normal mt-10 flex">
|
|
<div>物料名称:</div>
|
|
<div>物料名称:</div>
|
|
<div class="font-['PingFang-SC'] text-sm font-normal">{{ selectMaterialName }}</div>
|
|
<div class="font-['PingFang-SC'] text-sm font-normal">{{ selectMaterialName }}</div>
|
|
@@ -89,7 +89,69 @@
|
|
@click="codeCopy"
|
|
@click="codeCopy"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
|
|
+
|
|
|
|
+ <div class="my-8" v-if="wlList.length > 0">
|
|
|
|
+ <!-- 搜索表单 -->
|
|
|
|
+ <el-form :model="queryParams" ref="searchFormRef" :inline="true" v-show="showSearch">
|
|
|
|
+ <el-form-item label="物料编码" prop="materialNo">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.materialNo"
|
|
|
|
+ placeholder="请输入物料编码"
|
|
|
|
+ clearable
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="物料名称" prop="materialName">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.materialName"
|
|
|
|
+ placeholder="请输入物料名称"
|
|
|
|
+ clearable
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
|
|
+ <el-button @click="resetQuery">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+
|
|
|
|
+ <!-- 是否展示搜索图标 -->
|
|
|
|
+ <van-icon class="float-right" name="search" @click="toggleSearch()" />
|
|
|
|
+
|
|
|
|
+ <!-- 表格 -->
|
|
|
|
+ <el-table :data="wlList">
|
|
|
|
+ <el-table-column label="物料编码" align="center" prop="materialNo">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div class="flex items-center justify-center">
|
|
|
|
+ <div>{{ scope.row.materialNo }}</div>
|
|
|
|
+ <van-icon
|
|
|
|
+ v-show="selectWlCode"
|
|
|
|
+ name="description-o"
|
|
|
|
+ class="text-[#004EA2] description-o ml-1 cursor-pointer"
|
|
|
|
+ @click="codeCopy(scope.row.materialNo)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="物料名称" align="center" prop="materialName" />
|
|
|
|
+ <el-table-column label="规格" align="center" prop="specifications" />
|
|
|
|
+ </el-table>
|
|
|
|
+ <div class="w-full mt-2">
|
|
|
|
+ <el-pagination
|
|
|
|
+ class="float-right"
|
|
|
|
+ v-if="total > 0"
|
|
|
|
+ :current-page="pageNum"
|
|
|
|
+ :page-size="20"
|
|
|
|
+ :pager-count="5"
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
+ :total="1000"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
|
|
<div class="font-['PingFang-SC'] text-sm font-normal mt-10">
|
|
<div class="font-['PingFang-SC'] text-sm font-normal mt-10">
|
|
<div>附件:</div>
|
|
<div>附件:</div>
|
|
@@ -143,6 +205,16 @@ const sytPath = ref('')
|
|
const devPath = import.meta.env.VITE_APP_BASE_API
|
|
const devPath = import.meta.env.VITE_APP_BASE_API
|
|
const breadTitle = ref('')
|
|
const breadTitle = ref('')
|
|
const typeOptions1Ref = ref([])
|
|
const typeOptions1Ref = ref([])
|
|
|
|
+
|
|
|
|
+// 物料搜索相关参数
|
|
|
|
+const queryParams = ref({
|
|
|
|
+ materialNo: '',
|
|
|
|
+ materialName: ''
|
|
|
|
+})
|
|
|
|
+const showSearch = ref(false)
|
|
|
|
+const pageNum = ref(1)
|
|
|
|
+const total = ref(10)
|
|
|
|
+
|
|
const init = () => {
|
|
const init = () => {
|
|
detailList({ id: queryId.value }).then((res) => {
|
|
detailList({ id: queryId.value }).then((res) => {
|
|
const toolDetails = res.data.toolDetails || []
|
|
const toolDetails = res.data.toolDetails || []
|
|
@@ -179,14 +251,16 @@ const changeImg = ({ id, filePath }) => {
|
|
sytPath.value = filePath
|
|
sytPath.value = filePath
|
|
}
|
|
}
|
|
|
|
|
|
-const codeCopy = async () => {
|
|
|
|
|
|
+const codeCopy = async (val) => {
|
|
|
|
+ // console.log(val)
|
|
const clipboard = new Clipboard('.description-o', {
|
|
const clipboard = new Clipboard('.description-o', {
|
|
- text: () => selectWlCode.value
|
|
|
|
|
|
+ text: () => val
|
|
})
|
|
})
|
|
// 添加成功事件处理函数
|
|
// 添加成功事件处理函数
|
|
clipboard.on('success', (e) => {
|
|
clipboard.on('success', (e) => {
|
|
e.clearSelection()
|
|
e.clearSelection()
|
|
ElMessage.success('复制成功')
|
|
ElMessage.success('复制成功')
|
|
|
|
+ clipboard.destroy()
|
|
})
|
|
})
|
|
// 添加失败事件处理函数
|
|
// 添加失败事件处理函数
|
|
clipboard.on('error', () => {
|
|
clipboard.on('error', () => {
|
|
@@ -195,11 +269,11 @@ const codeCopy = async () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-const changeWlCode = ({ id, materialNo, materialName }) => {
|
|
|
|
- wlSelectId.value = id
|
|
|
|
- selectWlCode.value = materialNo
|
|
|
|
- selectMaterialName.value = materialName
|
|
|
|
-}
|
|
|
|
|
|
+// const changeWlCode = ({ id, materialNo, materialName }) => {
|
|
|
|
+// wlSelectId.value = id
|
|
|
|
+// selectWlCode.value = materialNo
|
|
|
|
+// selectMaterialName.value = materialName
|
|
|
|
+// }
|
|
// informationType 物料 wl 点击切换 物料编码 materialNo
|
|
// informationType 物料 wl 点击切换 物料编码 materialNo
|
|
// informationType 示意图 syt 左侧图
|
|
// informationType 示意图 syt 左侧图
|
|
const fileDownload = ({ fileName, filePath }) => {
|
|
const fileDownload = ({ fileName, filePath }) => {
|
|
@@ -216,7 +290,37 @@ const fileDownload = ({ fileName, filePath }) => {
|
|
}
|
|
}
|
|
|
|
|
|
const handleReturn = (typeItem) => {
|
|
const handleReturn = (typeItem) => {
|
|
- router.push({ path: '/', query: { id: typeItem.id } })
|
|
|
|
|
|
+ router.push({ path: '/home', query: { id: typeItem.id } })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 搜索物料
|
|
|
|
+const handleQuery = () => {
|
|
|
|
+ const params = {
|
|
|
|
+ materialNo: queryParams.value.materialNo || '',
|
|
|
|
+ materialName: queryParams.value.materialName || '',
|
|
|
|
+ // 看看有没有分页
|
|
|
|
+ pageNum: pageNum.value,
|
|
|
|
+ pageSize: 5
|
|
|
|
+ }
|
|
|
|
+ console.log('搜索物料', params)
|
|
|
|
+ // getList(params)
|
|
|
|
+}
|
|
|
|
+const searchFormRef = ref(null)
|
|
|
|
+// 重置
|
|
|
|
+const resetQuery = () => {
|
|
|
|
+ searchFormRef.value.resetForm('searchFormRef')
|
|
|
|
+ handleQuery()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 切换分页
|
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
|
+ console.log(val)
|
|
|
|
+ pageNum.value = val
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 显示搜索框
|
|
|
|
+const toggleSearch = () => {
|
|
|
|
+ showSearch.value = !showSearch.value
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|