|
@@ -0,0 +1,284 @@
|
|
|
+<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-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="计划单号" align="center" prop="productionPlanNo" width="104" />
|
|
|
+ <el-table-column label="批次号" align="center" prop="lotCode" width="104" />
|
|
|
+ <el-table-column label="产品描述" align="center" prop="productDescription" />
|
|
|
+ <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="100" />
|
|
|
+ <el-table-column label="投入数" align="center" prop="prodNum" width="96" />
|
|
|
+ <el-table-column label="盘点数量" align="center" prop="taksStockNum" width="96" >
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number
|
|
|
+ v-if="scope.row.editStatus"
|
|
|
+ v-model="scope.row.taksStockNum"
|
|
|
+ controls-position="right"
|
|
|
+ style="width: 100px"
|
|
|
+ :min="0"
|
|
|
+ @input="(val) => {handleChangeTaksStockNum(val, scope.row,scope.$index)}"
|
|
|
+ />
|
|
|
+ <div v-else>{{ scope.row.taksStockNum }}</div>
|
|
|
+ </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
|
|
|
+ >
|
|
|
+ </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="() => (scope.row.editStatus = true)"
|
|
|
+ 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>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import {
|
|
|
+ listTaksStockLot,updateTaksStockLot
|
|
|
+} from "@/api/business/taksStockLot";
|
|
|
+import { getDeptList } from "@/api/business/planDetailSubDetail.js";
|
|
|
+import { ref } from "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 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: 10,
|
|
|
+ productDescription: "",
|
|
|
+ lotCode: "",
|
|
|
+ deptId: null,
|
|
|
+ flags: null,
|
|
|
+ isTaksStock:null
|
|
|
+});
|
|
|
+
|
|
|
+/**************************** 方法区 ****************************/
|
|
|
+/** 打开抽屉 */
|
|
|
+const open = (row) => {
|
|
|
+ visible.value = true;
|
|
|
+ reset();
|
|
|
+ detailInfo.value = proxy.deepClone(row);
|
|
|
+ getDeptList().then((response) => {
|
|
|
+ deptList.value = response.data.rows;
|
|
|
+ isDispatch.value = response.data.others.isDispatch;
|
|
|
+ loading.value = false;
|
|
|
+ if (isDispatch.value) {
|
|
|
+ deptList.value.unshift({ label: "全部", value: "0" });
|
|
|
+ }
|
|
|
+ queryParams.value.deptId = deptList.value[0].value;
|
|
|
+ queryParams.value.takeStockPeriodId = row.id
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+}
|
|
|
+function getList() {
|
|
|
+ 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;
|
|
|
+ })
|
|
|
+}
|
|
|
+function handleSave(row) {
|
|
|
+ updateTaksStockLot(row).then(res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ proxy.$modal.msgSuccess("保存成功");
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+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: 10,
|
|
|
+ productDescription: "",
|
|
|
+ lotCode: "",
|
|
|
+ deptId: null,
|
|
|
+ flags: null,
|
|
|
+ isTaksStock:null
|
|
|
+ };
|
|
|
+ dataList.value = [];
|
|
|
+};
|
|
|
+
|
|
|
+/** 暴露给父组件的方法 */
|
|
|
+defineExpose({
|
|
|
+ open,
|
|
|
+});
|
|
|
+</script>
|