|
@@ -17,7 +17,49 @@
|
|
|
:row-style="rowStyle"
|
|
|
:cell-style="cellStyle"
|
|
|
@selection-change="selectionChange"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template #menu-left="{ size }">
|
|
|
+ <el-button
|
|
|
+ :disabled="toDeleteIds.length < 1"
|
|
|
+ type="primary"
|
|
|
+ :size="size"
|
|
|
+ @click="dialog3.visible = true"
|
|
|
+ >出库
|
|
|
+ </el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog3.visible"
|
|
|
+ :title="dialog3.title"
|
|
|
+ width="550px"
|
|
|
+ @close="dialog3.visible = false"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="outWorkOrderCode"
|
|
|
+ placeholder="选择出库工单号"
|
|
|
+ :prefix-icon="Search"
|
|
|
+ @click="dialog4.visible = true"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialog3.visible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="outInventory">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog4.visible"
|
|
|
+ :title="dialog4.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog4.visible = false"
|
|
|
+ >
|
|
|
+ <work-order-page @order-info="materialInfo2" :queryType="99"/>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -36,11 +78,13 @@ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
-import { getSemi, oprerate } from "@/api/storage/index";
|
|
|
+import {getSemi, oprerate, outInv} from "@/api/storage/index";
|
|
|
import { useDictionaryStore } from "@/store";
|
|
|
+import {Search} from "@element-plus/icons-vue";
|
|
|
const { dicts } = useDictionaryStore();
|
|
|
const emits = defineEmits(["close"]);
|
|
|
const ruleFormRef = ref(null);
|
|
|
+const outWorkOrderCode = ref(null);
|
|
|
const dialog1 = reactive({
|
|
|
title: "工单号选择",
|
|
|
visible: false,
|
|
@@ -49,6 +93,40 @@ const materialInfo1 = (value) => {
|
|
|
formData.value.outWorkOrderCode = value.workOrderCode;
|
|
|
dialog1.visible = false;
|
|
|
};
|
|
|
+
|
|
|
+const materialInfo2 = async (value) => {
|
|
|
+ outWorkOrderCode.value = value.workOrderCode;
|
|
|
+ dialog4.visible = false;
|
|
|
+};
|
|
|
+const dialog3 = reactive({
|
|
|
+ title: "出库",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+
|
|
|
+const dialog4 = reactive({
|
|
|
+ visible: false,
|
|
|
+ title: "工单编码选择",
|
|
|
+});
|
|
|
+const outInventory = () => {
|
|
|
+
|
|
|
+ outInv({
|
|
|
+ inStockId: props.id,
|
|
|
+ ids: toDeleteIds.value,
|
|
|
+ outNum: toDeleteIds.value.length,
|
|
|
+ outWorkOrderCode: outWorkOrderCode.value
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == "200") {
|
|
|
+ ElMessage.success("出库成功!");
|
|
|
+ } else {
|
|
|
+ ElMessage.error("出库失败!");
|
|
|
+ }
|
|
|
+ dialog3.visible = false;
|
|
|
+ outWorkOrderCode.value = null;
|
|
|
+ search.value.inStockId = props.id;
|
|
|
+ dataList();
|
|
|
+ });
|
|
|
+
|
|
|
+};
|
|
|
const formData = ref({
|
|
|
stockId: "",
|
|
|
stockType: "2",
|
|
@@ -97,8 +175,19 @@ option.value = Object.assign(option.value, {
|
|
|
viewBtn: false,
|
|
|
menu: false,
|
|
|
addBtn: false,
|
|
|
+ selectable: (row) => {
|
|
|
+ // 返回 true 表示允许勾选,false 表示禁用勾选
|
|
|
+ return row.inventoryStatus === 1; // 例如:状态不是 "已审核" 的行才能勾选
|
|
|
+ },
|
|
|
column: [
|
|
|
{
|
|
|
+ label: "管号",
|
|
|
+ prop: "workOrderSeqNo",
|
|
|
+ editDisabled: true,
|
|
|
+ addDisplay: false,
|
|
|
+ search: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "生产批号",
|
|
|
prop: "workOrderCode",
|
|
|
editDisabled: true,
|
|
@@ -112,11 +201,30 @@ option.value = Object.assign(option.value, {
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- label: "管号",
|
|
|
- prop: "workOrderSeqNo",
|
|
|
+ label: "出库工单号",
|
|
|
+ prop: "outWorkOrderCode",
|
|
|
editDisabled: true,
|
|
|
addDisplay: false,
|
|
|
- search: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ trigger: "trigger",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否已出库",
|
|
|
+ prop: "inventoryStatus",
|
|
|
+ editDisabled: true,
|
|
|
+ addDisplay: false,
|
|
|
+ html: true,
|
|
|
+ formatter: (val) => {
|
|
|
+ if (val.inventoryStatus === 2) {
|
|
|
+ return '<b class="el-tag el-tag--success el-tag--light">是</b>';
|
|
|
+ } else {
|
|
|
+ return '<b class="el-tag el-tag--danger el-tag--light">否</b>';
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
]
|