|
|
|
@ -44,7 +44,7 @@
|
|
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__left"> |
|
|
|
|
<!-- 批量入库 --> |
|
|
|
|
<el-button type="primary" icon="Switch" @click="handleAudit">批量入库</el-button> |
|
|
|
|
<el-button type="primary" icon="Switch" @click="handleBatchImcoming">批量入库</el-button> |
|
|
|
|
|
|
|
|
|
<!-- 批量查看二维码 --> |
|
|
|
|
<el-button type="primary" icon="Printer" @click="handleBatchShowQrCode" |
|
|
|
@ -79,7 +79,12 @@
|
|
|
|
|
<el-text @click="() => handleShowQrCode(slotProps.scope)"> 查看二维码 </el-text> |
|
|
|
|
|
|
|
|
|
<!-- 入库 --> |
|
|
|
|
<el-text @click="() => handleIncoming(slotProps.scope)"> 入库 </el-text> |
|
|
|
|
<el-text |
|
|
|
|
v-if="Number(slotProps.scope.row.inWarehouse) !== 1" |
|
|
|
|
@click="() => handleIncoming(slotProps.scope)" |
|
|
|
|
> |
|
|
|
|
入库 |
|
|
|
|
</el-text> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
@ -137,12 +142,13 @@ import {
|
|
|
|
|
handleClearTableQuery, |
|
|
|
|
handleInputQuery, |
|
|
|
|
handleSelectQuery, |
|
|
|
|
handleTranslationDataSeclect, |
|
|
|
|
} from '@/utils/util'; |
|
|
|
|
import { columnList } from '@/option/warehouse/PreStoragePackage'; |
|
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
|
import { deepClone } from '@/utils/util'; |
|
|
|
|
import { showOrderPackgeCode } from '@/api/distribution/distributionStockArticle'; |
|
|
|
|
import { getList } from '@/api/warehouse/PreStoragePackage'; |
|
|
|
|
import { getList, getInOrder } from '@/api/warehouse/PreStoragePackage'; |
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'; |
|
|
|
|
|
|
|
|
|
// 获取路由实例 |
|
|
|
@ -188,7 +194,7 @@ const details = reactive<any>({
|
|
|
|
|
/** 列表 */ |
|
|
|
|
columnList: deepClone(columnList), |
|
|
|
|
/** 列表数据 */ |
|
|
|
|
data: [{}], |
|
|
|
|
data: [], |
|
|
|
|
/** 页面loading */ |
|
|
|
|
loadingObj: { |
|
|
|
|
/** 列表加载loading */ |
|
|
|
@ -245,6 +251,8 @@ const onLoad = async (params = {}) => {
|
|
|
|
|
details.data = data.records; |
|
|
|
|
details.page.total = data.total; |
|
|
|
|
|
|
|
|
|
handleTranslationDataSeclect(details.data, details.columnList); |
|
|
|
|
|
|
|
|
|
return res.data; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
@ -329,14 +337,6 @@ const currentChange = pageNum => {
|
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 批量审核 */ |
|
|
|
|
const handleAudit = () => { |
|
|
|
|
if (details.selectionList.length === 0) { |
|
|
|
|
ElMessage.warning('请选择要审核的单据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 导出 */ |
|
|
|
|
const handleExport = () => { |
|
|
|
|
ElMessageBox.confirm('是否确认导出?', '提示', { |
|
|
|
@ -352,7 +352,28 @@ const handleExport = () => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 查看二维码 */ |
|
|
|
|
const handleShowQrCode = ({ row }) => {}; |
|
|
|
|
const handleShowQrCode = async ({ row }) => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
|
|
|
|
|
let qr = { |
|
|
|
|
ids: row.id, |
|
|
|
|
}; |
|
|
|
|
details.html = ''; |
|
|
|
|
const res = await showOrderPackgeCode(qr); |
|
|
|
|
|
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
|
|
|
|
|
if (code !== 200) return; |
|
|
|
|
details.html = details.getHtmls(data.dataList, data.templateHtml); |
|
|
|
|
|
|
|
|
|
details.popUpShow.dialogVisible = true; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.pageLoading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 批量查看二维码 */ |
|
|
|
|
const handleBatchShowQrCode = async () => { |
|
|
|
@ -390,14 +411,60 @@ const handleIncoming = ({ row }) => {
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
}).then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
|
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '入库成功!', |
|
|
|
|
}); |
|
|
|
|
let submitData = { |
|
|
|
|
ids: row.id, |
|
|
|
|
}; |
|
|
|
|
const res = await getInOrder(submitData); |
|
|
|
|
|
|
|
|
|
const { code, data, msg } = res.data; |
|
|
|
|
|
|
|
|
|
if (code !== 200) return; |
|
|
|
|
|
|
|
|
|
ElMessage.success(msg); |
|
|
|
|
initOnLoad(); |
|
|
|
|
details.html = ''; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.pageLoading = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 批量入库 */ |
|
|
|
|
const handleBatchImcoming = () => { |
|
|
|
|
if (details.selectionList.length === 0) return ElMessage.warning('请选择要批量入库的数据'); |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < details.selectionList.length; i++) { |
|
|
|
|
const item = details.selectionList[i]; |
|
|
|
|
|
|
|
|
|
if (Number(item.inWarehouse) === 1) return ElMessage.warning('存在已入库的包件不可重复入库'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ElMessageBox.confirm('是否确认批量入库?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.pageLoading = true; |
|
|
|
|
|
|
|
|
|
let submitData = { |
|
|
|
|
ids: details.selectionList.map(val => val.id).join(','), |
|
|
|
|
}; |
|
|
|
|
const res = await getInOrder(submitData); |
|
|
|
|
|
|
|
|
|
const { code, data, msg } = res.data; |
|
|
|
|
|
|
|
|
|
if (code !== 200) return; |
|
|
|
|
|
|
|
|
|
ElMessage.success(msg); |
|
|
|
|
initOnLoad(); |
|
|
|
|
details.html = ''; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|