|
@@ -15,27 +15,246 @@
|
|
|
@size-change="dataList"
|
|
|
@current-change="dataList"
|
|
|
>
|
|
|
+ <template #menu-left="{ size }">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-primary"
|
|
|
+ :size="size"
|
|
|
+ @click="addVal"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template #menu="{ size, row, index }">
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ text
|
|
|
+ @click="showSeqPage(row)"
|
|
|
+ type="primary"
|
|
|
+ :size="size"
|
|
|
+ >出入库明细</el-button>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog4.visible"
|
|
|
+ :title="dialog4.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog4.visible = false"
|
|
|
+ >
|
|
|
+ <order-details :orderInfo="infoObj" />
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog3.visible"
|
|
|
+ :title="dialog3.title"
|
|
|
+ width="1100px"
|
|
|
+ @close="dialog3.visible = false"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="ruleFormRef"
|
|
|
+ label-width="90px"
|
|
|
+ :rules="rules"
|
|
|
+ >
|
|
|
+ <el-row :gutter="22" style="margin-top:5px;">
|
|
|
+ <el-col :span="11">
|
|
|
+ <el-form-item label="类型" prop="type">
|
|
|
+ <el-select
|
|
|
+ v-model="form.type"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in fieldOptions"
|
|
|
+ :key="option.value"
|
|
|
+ :label="option.label"
|
|
|
+ :value="option.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="11">
|
|
|
+ <el-form-item label="载具编号" prop="vehicleCode">
|
|
|
+ <el-input
|
|
|
+ v-model="form.vehicleCode"
|
|
|
+ placeholder="请输入载具编号"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="22" style="margin-top:5px;">
|
|
|
+ <el-col :span="11">
|
|
|
+ <el-form-item label="库位坐标" prop="locationNo">
|
|
|
+ <el-input
|
|
|
+ v-model="form.locationNo"
|
|
|
+ placeholder="请输入库位坐标"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+<!-- <el-col :span="11">
|
|
|
+ <el-form-item label="载具编号">
|
|
|
+ <el-input
|
|
|
+ v-model="form.vehicleCode"
|
|
|
+ placeholder="请输入载具编号"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>-->
|
|
|
+ </el-row>
|
|
|
+ <el-divider />
|
|
|
+ <el-text class="mx-1" size="large">物料详情</el-text>
|
|
|
+ <el-button type="primary" @click="addItem" icon="el-icon-plus" style="margin-left:15px;width:25px;height:25px;" circle />
|
|
|
+ <el-button type="danger" @click="minusItem" icon="el-icon-minus" style="margin-left:15px;width:25px;height:25px;" circle />
|
|
|
+ <el-row :gutter="22" style="margin-top:5px;" v-for="(item, index) in formDataList" :key="index">
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-input
|
|
|
+ v-model="item.materialNo"
|
|
|
+ placeholder="请选择物料编号"
|
|
|
+ readonly
|
|
|
+ :onclick="choiceItem(item)"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3"><el-input
|
|
|
+ v-model="item.materialName"
|
|
|
+ placeholder="请选择物料名称"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input
|
|
|
+ v-model="item.spec"
|
|
|
+ placeholder="物料型号"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-select
|
|
|
+ v-model="item.materialType"
|
|
|
+ placeholder="请选择物料类别"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in stock_material_type_list"
|
|
|
+ :key="option.dictValue"
|
|
|
+ :label="option.dictLabel"
|
|
|
+ :value="option.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-input
|
|
|
+ v-model="item.unit"
|
|
|
+ placeholder="单位"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-input
|
|
|
+ v-model="item.batchCode"
|
|
|
+ placeholder="二维码"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-input
|
|
|
+ v-model="item.num"
|
|
|
+ placeholder="数量"
|
|
|
+ min="0"
|
|
|
+ max="9999"
|
|
|
+ type="number"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div class="dialog-footer" style="margin-top:20px" align="center">
|
|
|
+ <el-button type="primary" @click="handleSubmit">保 存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog2.visible"
|
|
|
+ :title="dialog2.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog2.visible = false"
|
|
|
+ >
|
|
|
+ <choice-item-page @material-info="materialInfo" />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
-import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
-
|
|
|
+import {queryDictDataByType} from "@/api/system/dict"
|
|
|
+import {wmsOrderAdd} from "@/api/storage"
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
-import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
+const ruleFormRef = ref(ElForm);
|
|
|
const test = () => {
|
|
|
isShowTable.value = true;
|
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
};
|
|
|
-
|
|
|
+const showSeqPage = (info) => {
|
|
|
+ infoObj.value = info;
|
|
|
+ dialog4.visible = true;
|
|
|
+};
|
|
|
+const dialog3 = reactive({
|
|
|
+ title: "新增",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const dialog4 = reactive({
|
|
|
+ title: "出入库明细",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const rules = reactive({
|
|
|
+ vehicleCode: [{ required: true, message: "请选择载具", trigger: "blur" }],
|
|
|
+ type: [{ required: true, message: "请选择类型", trigger: "blur" }],
|
|
|
+ locationNo: [{ required: true, message: "请输入坐标", trigger: "blur" }],
|
|
|
+});
|
|
|
+const materialInfo = (value) => {
|
|
|
+ clickObj.value.materialNo = value.materialCode;
|
|
|
+ clickObj.value.materialName = value.materialName;
|
|
|
+ clickObj.value.spec = value.spec;
|
|
|
+ clickObj.value.unit = value.unitDictValue
|
|
|
+ dialog2.visible = false;
|
|
|
+};
|
|
|
+const dialog2 = reactive({
|
|
|
+ title: "物料选择",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const addVal = () =>{
|
|
|
+ dialog3.visible = true
|
|
|
+}
|
|
|
+const addItem =()=>{
|
|
|
+ typeIndex.value = 1
|
|
|
+ formDataList.value.push({})
|
|
|
+}
|
|
|
+const typeIndex = ref(0)
|
|
|
+const minusItem =()=>{
|
|
|
+ typeIndex.value = 0
|
|
|
+ formDataList.value.splice(formDataList.value.length - 1,1)
|
|
|
+}
|
|
|
+const clickObj = ref(null)
|
|
|
+const choiceItem =(item)=>{
|
|
|
+ if(typeIndex.value === 1){
|
|
|
+ dialog2.visible = true
|
|
|
+ clickObj.value = item
|
|
|
+ }
|
|
|
+}
|
|
|
+const fieldOptions = ref([{label: "入库",value: "1"},{label: "出库",value: "2"},{label: "退料",value: "3"}])
|
|
|
+const stock_material_type_list = ref()
|
|
|
+const formDataList = ref([]);
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: "/api/v1/wmsOrder",
|
|
|
+ dataListUrl: "/api/v1/wmsOrder/pageDetails"
|
|
|
});
|
|
|
+const handleSubmit = ()=>{
|
|
|
+ form.value.details = formDataList.value
|
|
|
+ wmsOrderAdd(form.value).then((res)=>{
|
|
|
+ if(res.code ==='200'){
|
|
|
+ ElMessage.success("操作成功");
|
|
|
+ dataList();
|
|
|
+ form.value = null
|
|
|
+ formDataList.value=[]
|
|
|
+ dialog3.visible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const infoObj = ref(null)
|
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
@@ -47,10 +266,10 @@ option.value = Object.assign(option.value, {
|
|
|
selection: false,
|
|
|
viewBtn: false,
|
|
|
editBtn: false,
|
|
|
- menu: false,
|
|
|
+ menu: true,
|
|
|
addBtn: false,
|
|
|
column: [
|
|
|
- {
|
|
|
+ /*{
|
|
|
label: "任务单号",
|
|
|
prop: "taskNo",
|
|
|
search: true,
|
|
@@ -61,7 +280,7 @@ option.value = Object.assign(option.value, {
|
|
|
label: "计划单号",
|
|
|
prop: "planNo",
|
|
|
search: true,
|
|
|
- },
|
|
|
+ },*/
|
|
|
{
|
|
|
label: "类型",
|
|
|
prop: "type",
|
|
@@ -71,11 +290,10 @@ option.value = Object.assign(option.value, {
|
|
|
},
|
|
|
{
|
|
|
label: "载具编号",
|
|
|
- width: 130,
|
|
|
overHidden: true,
|
|
|
prop: "vehicleCode",
|
|
|
},
|
|
|
- {
|
|
|
+ /*{
|
|
|
label: "物料编号",
|
|
|
width: 130,
|
|
|
search: true,
|
|
@@ -99,13 +317,13 @@ option.value = Object.assign(option.value, {
|
|
|
label: "单位",
|
|
|
overHidden: true,
|
|
|
prop: "unit",
|
|
|
- },
|
|
|
+ },*/
|
|
|
{
|
|
|
label: "库位",
|
|
|
overHidden: true,
|
|
|
prop: "locationNo",
|
|
|
},
|
|
|
- {
|
|
|
+ /* {
|
|
|
label: "二维码",
|
|
|
prop: "batchCode",
|
|
|
width:150,
|
|
@@ -121,8 +339,8 @@ option.value = Object.assign(option.value, {
|
|
|
{
|
|
|
label: "数量",
|
|
|
prop: "num",
|
|
|
- },
|
|
|
- {
|
|
|
+ },*/
|
|
|
+ /*{
|
|
|
label: "状态",
|
|
|
prop: "state",
|
|
|
type: "select",
|
|
@@ -134,11 +352,10 @@ option.value = Object.assign(option.value, {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|
|
|
}
|
|
|
- },
|
|
|
+ },*/
|
|
|
{
|
|
|
label: "操作时间",
|
|
|
prop: "created",
|
|
|
- width: 180,
|
|
|
display: false
|
|
|
},
|
|
|
{
|
|
@@ -153,5 +370,8 @@ onMounted(() => {
|
|
|
// console.log("crudRef", crudRef)
|
|
|
//search.value.type = '2'
|
|
|
dataList();
|
|
|
+ queryDictDataByType("stock_material_type").then((res)=>{
|
|
|
+ stock_material_type_list.value = res.data
|
|
|
+ })
|
|
|
});
|
|
|
</script>
|