123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594 |
- <template>
- <el-drawer
- title="外协单信息"
- :with-header="false"
- v-model="visible"
- direction="rtl"
- size="100%"
- >
- <div class="form-container column-container">
- <div class="form-btns-container">
- <span class="title-label">
- <el-icon>
- <Document />
- </el-icon>
- <span>盘点批次</span>
- </span>
- <div class="close-btn" @click="cancel">
- <i class="fa fa-times" aria-hidden="true" />
- <!-- <span>关闭</span> -->
- </div>
- </div>
- <el-form
- class="list-search-container"
- :model="queryParams"
- ref="queryRef"
- :inline="true"
- style="margin-right: 0px"
- >
- <el-form-item class="section-title" label="盘点批次列表" />
- <el-form-item label="批次号:">
- <el-input
- placeholder="请输入批次号"
- v-model.trim="queryParams.lotCode"
- @keydown.enter.prevent
- clearable
- style="width: 130px"
- />
- </el-form-item>
- <el-form-item label="产品描述:">
- <el-input
- placeholder="请输入产品描述"
- v-model.trim="queryParams.productDescription"
- @keydown.enter.prevent
- clearable
- style="width: 130px"
- />
- </el-form-item>
- <el-form-item label="生产状态:">
- <el-select
- v-model="queryParams.isProductStatus"
- clearable
- placeholder="请选择生产状态"
- style="width: 145px"
- >
- <el-option
- v-for="dict in inventory_production_status"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="标识:">
- <el-select
- style="width: 160px"
- multiple
- v-model="queryParams.flags"
- collapse-tags
- collapse-tags-tooltip
- clearable
- placeholder="请选择标识"
- >
- <el-option
- v-for="item in is_identification"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item class="section-title" label="请选择当前工段:">
- <el-select-v2
- v-model="queryParams.deptId"
- :options="deptList"
- placeholder="请选择工段"
- style="width: 120px"
- />
- </el-form-item>
- <el-form-item label="盘点状态:">
- <el-select
- v-model="queryParams.isTaksStock"
- clearable
- placeholder="请选择盘点状态"
- style="width: 145px"
- >
- <el-option
- v-for="dict in is_taks_stock"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item style="margin-left: 0">
- <el-button type="info" icon="Search" @click="handleQuery"
- >搜索
- </el-button>
- <el-button
- type="info"
- icon="Download"
- @click="handleExport"
- v-hasPermi="['business:inventoryCheck:inventoryDetailCheck']"
- >导出盘点明细
- </el-button>
- <el-button
- :disabled="queryParams.deptId == null || queryParams.deptId == '0'"
- type="primary"
- icon="Check"
- v-hasPermi="['business:inventoryCheck:notProductionCheck']"
- @click="handleTaksLot"
- >未生产批次盘点
- </el-button>
- <el-button
- v-if="detailInfo.status != 2"
- type="primary"
- icon="List"
- @click="outsourceCheckFrom"
- >外协发出盘点
- </el-button>
- <!-- <el-button
- v-if="detailInfo.status != 2"
- type="primary"
- icon="List"
- @click="showOutsourceCheckDialog"
- >外协发出单盘点
- </el-button> -->
- <el-button
- type="info"
- icon="Download"
- @click="handleExportStorage"
- v-hasPermi="['business:inventoryCheck:notRetrievalCheck']"
- >导出零存库未领取批次
- </el-button>
- <el-button
- type="primary"
- icon="List"
- v-hasPermi="['business:inventoryCheck:notInboundCheck']"
- @click="handleNotInboundCheckFrom"
- >未入库盘点
- </el-button>
- <el-button
- type="primary"
- icon="List"
- v-hasPermi="['business:inventoryCheck:anyInboundCheck']"
- @click="handleAnyInboundCheckFrom"
- >部分入库盘点
- </el-button>
- </el-form-item>
- </el-form>
- <div class="el-table-container">
- <div class="el-table-inner-container">
- <el-table
- v-loading="loading"
- :data="dataList"
- size="small"
- border
- height="100%"
- >
- <el-table-column
- label="行号"
- type="index"
- align="center"
- width="48"
- />
- <el-table-column
- label="批次号"
- prop="lotCode"
- align="center"
- width="120px"
- >
- <template #default="scope">
- <el-button
- link
- type="primary"
- @click="handleColumnClick(scope.row.lotCode)"
- ><span>{{ scope.row.lotCode }}</span></el-button
- >
- </template>
- </el-table-column>
- <el-table-column
- label="产品描述"
- align="center"
- prop="productDescription"
- />
- <el-table-column
- label="箱号"
- align="center"
- prop="carrierName"
- width="110"
- />
- <el-table-column
- label="生产状态"
- prop="isProductStatus"
- width="90"
- align="center"
- >
- <template #default="scope">
- <dict-tag
- :options="inventory_production_status"
- :value="scope.row.isProductStatus"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="工段"
- align="center"
- prop="deptName"
- width="90"
- />
- <el-table-column
- label="工序"
- align="center"
- prop="processAlias"
- width="110"
- />
- <el-table-column
- label="投入数"
- align="center"
- prop="prodNum"
- width="80"
- />
- <el-table-column
- label="盘点数量"
- align="center"
- prop="taksStockNum"
- width="90"
- >
- <template #default="scope">
- <el-input-number
- v-if="scope.row.editStatus"
- v-model="scope.row.taksStockNum"
- controls-position="right"
- style="width: 100px"
- :min="0"
- :precision="0"
- :max="99999"
- @input="
- (val) => {
- handleChangeTaksStockNum(val, scope.row, scope.$index);
- }
- "
- />
- <div v-else>{{ scope.row.taksStockNum }}</div>
- </template>
- </el-table-column>
- <el-table-column
- label="外协单号"
- align="center"
- prop="outsourceFormNo"
- width="110"
- />
- <el-table-column
- label="报工状态"
- align="center"
- prop="statusLabel"
- width="110"
- >
- <template #default="scope">
- <span v-if="scope.row.statusLabel == 0">未开始</span>
- <span v-if="scope.row.statusLabel == 1">进行中</span>
- <span v-if="scope.row.statusLabel == 2">结束报工</span>
- <span v-if="scope.row.statusLabel == 3">工序已完成</span>
- <span v-if="scope.row.statusLabel == 4">待领取</span>
- <span v-if="scope.row.statusLabel == 6">已周转</span>
- <span v-if="scope.row.statusLabel == 7">已接收</span>
- </template>
- </el-table-column>
- <el-table-column label="标识" width="300" align="center">
- <template #default="scope">
- <el-tag
- v-if="scope.row.isWaste == 1"
- class="spacing"
- type="danger"
- >{{ "批废" }}</el-tag
- >
- <el-tag
- v-if="scope.row.isAmend == 1"
- class="spacing"
- type="danger"
- >{{ "工艺修改" }}</el-tag
- >
- <el-tag
- v-if="scope.row.isWasteRecycling == 1"
- class="spacing"
- type="primary"
- >{{ "废品回用" }}</el-tag
- >
- <el-tag
- v-if="scope.row.fromLotId != 0"
- class="spacing"
- type="warning"
- >{{ "分批" }}</el-tag
- >
- <el-tag
- v-if="scope.row.isSuperaddition == 1"
- class="spacing"
- type="info"
- >{{ "追增" }}</el-tag
- >
- </template>
- </el-table-column>
- <el-table-column
- label="盘点状态"
- prop="isTaksStock"
- width="200"
- align="center"
- >
- <template #default="scope">
- <el-select
- v-model="scope.row.isTaksStock"
- placeholder="请选择盘点状态"
- style="width: 160px"
- v-if="scope.row.editStatus"
- @change="
- (val) => {
- handleChangeTaksStock(val, scope.row, scope.$index);
- }
- "
- >
- <el-option
- v-for="dict in is_taks_stock"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- <div v-else>
- <dict-tag
- :options="is_taks_stock"
- :value="scope.row.isTaksStock"
- />
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- width="160"
- align="center"
- v-if="detailInfo.status != 2"
- >
- <template #default="scope">
- <el-button
- link
- icon="Check"
- v-if="scope.row.editStatus"
- type="success"
- @click="handleSave(scope.row)"
- >保存</el-button
- >
- <el-button
- link
- icon="Edit"
- v-else
- type="warning"
- @click="handleEdit(scope.row, scope.$index)"
- v-hasPermi="['business:inventoryCheck:editDetail']"
- >编辑</el-button
- >
- <el-button
- link
- icon="Close"
- v-if="scope.row.editStatus"
- type="danger"
- @click="handleCancel(scope.row, scope.$index)"
- >取消</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分页 -->
- <paginationMax
- v-show="total > 0"
- :total="total"
- v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- <OutsourceCheckDialog ref="outsourceCheckDialogRef" />
- <taksForm ref="taksFormRef" @handleSaveSuccess="getList" />
- <OutsourceCheckFom ref="outsourceCheckFom" @handleSaveSuccess="getList" />
- <NotInboundCheckForm ref="notInboundCheckForm" />
- <AnyInboundCheckForm ref="anyInboundCheckForm" />
- </el-drawer>
- </template>
- <script setup>
- import {
- listTaksStockLot,
- updateTaksStockLot,
- updateNoStartLot,
- exportNoStartLot,
- getProductionPlanDetail,
- } from "@/api/business/taksStockLot";
- import { exportStorageLot } from "@/api/business/storageRetrieval";
- import { getDeptList } from "@/api/business/planDetailSubDetail.js";
- import taksForm from "./notTaksForm.vue";
- import { ref } from "vue";
- import router from "@/router";
- import OutsourceCheckDialog from "./OutsourceCheckDialog.vue";
- import OutsourceCheckFom from "./OutsourceCheckFom.vue";
- import NotInboundCheckForm from "./notInboundCheckForm.vue";
- import AnyInboundCheckForm from "./anyInboundCheckForm.vue";
- const { proxy } = getCurrentInstance();
- /** 字典 */
- const { is_identification } = proxy.useDict("is_identification");
- const { is_taks_stock } = proxy.useDict("is_taks_stock");
- const { inventory_production_status } = proxy.useDict(
- "inventory_production_status"
- );
- // 组件
- const outsourceCheckDialogRef = ref(null);
- /** 表单抽屉 页变量 */
- const loading = ref(false);
- const visible = ref(false);
- const detailInfo = ref({});
- const total = ref(0);
- const isDispatch = ref(false);
- const deptList = ref([]);
- const dataList = ref([]);
- /** 查询对象 */
- const queryParams = ref({
- pageNum: 1,
- pageSize: 50,
- productDescription: "",
- lotCode: "",
- deptId: null,
- flags: null,
- isTaksStock: null,
- });
- /**************************** 方法区 ****************************/
- /** 打开抽屉 */
- const open = (row) => {
- visible.value = true;
- console.log(is_identification.value);
- is_identification.value = is_identification.value.filter(
- (item) => item.value != 0
- );
- reset();
- detailInfo.value = proxy.deepClone(row);
- getDeptList().then((response) => {
- deptList.value = response.data.rows;
- isDispatch.value = response.data.others.isDispatch;
- if (isDispatch.value) {
- deptList.value.unshift({ label: "全部", value: "0" });
- }
- queryParams.value.deptId = deptList.value[0].value;
- queryParams.value.takeStockPeriodId = row.id;
- getList();
- });
- };
- function getList() {
- loading.value = true;
- listTaksStockLot(queryParams.value).then((res) => {
- res.rows.forEach((element) => {
- element.isTaksStock = element.isTaksStock + "";
- element.taksStockNum = Number(element.taksStockNum);
- });
- dataList.value = res.rows;
- total.value = res.total;
- loading.value = false;
- });
- }
- function handleEdit(row, index) {
- row.editStatus = true;
- console.log(row);
- if (row.isTaksStock != 1) {
- row.taksStockNum = row.prodNum;
- row.isTaksStock = "1";
- }
- console.log(row);
- }
- //一键盘点
- // function handleTaksLot() {
- // console.log(queryParams.value.deptId)
- // updateNoStartLot({ takeStockPeriodId: queryParams.value.takeStockPeriodId, deptId: queryParams.value.deptId }).then(res => {
- // if (res.code == 200) {
- // proxy.$modal.msgSuccess("盘点成功");
- // getList()
- // }
- // })
- // }
- //发出盘点按钮
- function outsourceCheckFrom() {
- proxy.$refs.outsourceCheckFom.open(detailInfo.value);
- }
- function handleNotInboundCheckFrom(){
- proxy.$refs.notInboundCheckForm.open(detailInfo.value);
- }
- function handleAnyInboundCheckFrom(){
- proxy.$refs.anyInboundCheckForm.open(detailInfo.value);
- }
- function handleTaksLot() {
- getProductionPlanDetail(queryParams.value).then((res) => {
- if (res.data.length > 0) {
- let detail = {};
- detail.deptId = queryParams.value.deptId;
- detail.deptList = deptList.value;
- detail.takeStockPeriodId = queryParams.value.takeStockPeriodId;
- detail.status = detailInfo.value.status;
- proxy.$refs.taksFormRef.open(detail);
- } else {
- proxy.$modal.msgError("当前工段无未生产的批次");
- }
- });
- }
- function handleSave(row) {
- updateTaksStockLot(row).then((res) => {
- if (res.code == 200) {
- proxy.$modal.msgSuccess("保存成功");
- getList();
- }
- });
- }
- /** 打开批次详情页 */
- // function handleColumnClick(lotCode) {
- // router.push({ path: "/reviseBath/lotFormParticulars/" + lotCode });
- // }
- function handleColumnClick(lotCode) {
- // 拼接 URL
- const url = "/reviseBath/lotFormParticulars/" + lotCode;
- // 在新标签页打开 URL
- window.open(url, "_blank");
- }
- function handleChangeTaksStock(value, row, index) {
- if (value == 0) {
- dataList.value[index].taksStockNum = 0;
- }
- }
- function handleChangeTaksStockNum(value, row, index) {
- if (value != 0) {
- dataList.value[index].isTaksStock = "1";
- }
- }
- function handleCancel(row, index) {
- dataList.value[index].editStatus = false;
- getList();
- }
- function handleQuery() {
- getList();
- }
- /** 取消按钮 */
- const cancel = () => {
- visible.value = false;
- reset();
- };
- /** 表单重置 */
- const reset = () => {
- queryParams.value = {
- pageNum: 1,
- pageSize: 50,
- productDescription: "",
- lotCode: "",
- deptId: null,
- flags: null,
- isTaksStock: null,
- };
- dataList.value = [];
- };
- function handleExport() {
- exportNoStartLot({ takeStockPeriodId: queryParams.value.takeStockPeriodId });
- }
- function handleExportStorage() {
- exportStorageLot({ takeStockPeriodId: queryParams.value.takeStockPeriodId });
- }
- function showOutsourceCheckDialog() {
- outsourceCheckDialogRef.value.open(detailInfo.value);
- }
- /** 暴露给父组件的方法 */
- defineExpose({
- open,
- });
- </script>
|