|
@@ -0,0 +1,575 @@
|
|
|
+<template>
|
|
|
+ <div :style="{ backgroundColor: bgColor }">
|
|
|
+ <div style="color: transparent;">1111</div>
|
|
|
+ <q-dialog v-model="clickedinput" transition-show="jump-down" transition-hide="jump-up">
|
|
|
+ <q-card style="min-width: 350px; ">
|
|
|
+ <q-bar class="bg-light-blue-10 text-white rounded-borders" style="height: 50px">
|
|
|
+ <div>
|
|
|
+ {{ $t("stock.bin_setting") }}
|
|
|
+ </div>
|
|
|
+ <q-space></q-space>
|
|
|
+ <q-btn dense flat icon="close" v-close-popup>
|
|
|
+ <q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
|
|
|
+ content-style="font-size: 12px">
|
|
|
+ {{ $t("index.close") }}</q-tooltip>
|
|
|
+ </q-btn>
|
|
|
+ </q-bar>
|
|
|
+ <q-card-section class="flex flex-center">
|
|
|
+ <q-select ref="select" v-model="selected.label" :options="options" label="库位定义:" outlined
|
|
|
+ stack-label dense option-label="label" option-value="value" style="width: 90%"
|
|
|
+ class="q-my-md text-center" input-class="text-center">
|
|
|
+ <template v-slot:option="scope">
|
|
|
+ <q-item v-bind="scope.itemProps" class="text-center" @click="handleSelect(scope)">
|
|
|
+ <q-item-section>{{ scope.opt.label }}</q-item-section>
|
|
|
+ </q-item>
|
|
|
+ </template>
|
|
|
+ </q-select>
|
|
|
+ </q-card-section>
|
|
|
+ <div class="row justify-end q-pa-md q-gutter-x-md">
|
|
|
+ <q-btn color="primary" text-color="white" style="margin-right: 25px" v-close-popup class="q-px-lg">
|
|
|
+ {{ $t('cancel') }}</q-btn>
|
|
|
+ <q-btn color="primary" text-color="white" style="margin-right: 25px" @click=submit()
|
|
|
+ class="q-px-lg">
|
|
|
+ {{ $t('submit') }}</q-btn>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </q-card>
|
|
|
+ </q-dialog>
|
|
|
+ <q-dialog v-model="storage_dialog" transition-show="jump-down" transition-hide="jump-up" @show=prepareDialog()>
|
|
|
+ <q-card style="min-width: 600px; ">
|
|
|
+ <q-bar class="bg-light-blue-10 text-white rounded-borders" style="height: 50px">
|
|
|
+ <div>
|
|
|
+ {{ $t("stock.shelf.shelf_details") }} {{ rowIndex }}-{{ colIndex }}-{{layerIndex}}
|
|
|
+ </div>
|
|
|
+ <q-space></q-space>
|
|
|
+ <q-btn dense flat icon="close" v-close-popup>
|
|
|
+ <q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
|
|
|
+ content-style="font-size: 12px">
|
|
|
+ {{ $t("index.close") }}</q-tooltip>
|
|
|
+ </q-btn>
|
|
|
+ </q-bar>
|
|
|
+ <q-card-section class="q-pt-md ">
|
|
|
+ <q-tabs v-model="activeTab">
|
|
|
+ <q-tab name="tab1" label="货架属性" />
|
|
|
+ <q-tab name="tab2" label="货物信息" />
|
|
|
+ <q-tab name="tab3" label="库存明细" />
|
|
|
+ </q-tabs>
|
|
|
+ </q-card-section>
|
|
|
+ <!-- 选项卡内容 -->
|
|
|
+ <q-tab-panels v-model="activeTab" animated>
|
|
|
+ <q-tab-panel name="tab1" style="height:300px">
|
|
|
+ <div class="row q-gutter-x-md">
|
|
|
+ <div class="col column q-gutter-y-md">
|
|
|
+ <q-input dense outlined square v-model="storage_form.shelf_warehouse"
|
|
|
+ :label="$t('stock.shelf.shelf_warehouse')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.shelf_name"
|
|
|
+ :label="$t('stock.shelf.shelf_name')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_code"
|
|
|
+ :label="$t('stock.shelf.goods_code')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="col column q-gutter-y-md">
|
|
|
+ <q-input dense outlined square v-model="storage_form.shelf_department"
|
|
|
+ :label="$t('stock.shelf.shelf_department')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.shelf_status"
|
|
|
+ :label="$t('stock.shelf.shelf_status')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_name"
|
|
|
+ :label="$t('stock.shelf.goods_name')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </q-tab-panel>
|
|
|
+ <q-tab-panel name="tab2" style="height:300px">
|
|
|
+ <div class="row q-gutter-x-md">
|
|
|
+ <div class="col column q-gutter-y-md">
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_code"
|
|
|
+ :label="$t('stock.shelf.goods_code')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_batch"
|
|
|
+ :label="$t('stock.shelf.goods_batch')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_qty"
|
|
|
+ :label="$t('stock.shelf.goods_qty')" :readonly="onlyread"
|
|
|
+ :rules="[val => val >= 0 || error1]" class="col" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_desc"
|
|
|
+ :label="$t('stock.shelf.goods_desc')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="col column q-gutter-y-md">
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_name"
|
|
|
+ :label="$t('stock.shelf.goods_name')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_std"
|
|
|
+ :label="$t('stock.shelf.goods_std')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_unit"
|
|
|
+ :label="$t('stock.shelf.goods_unit')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="storage_form.goods_notes"
|
|
|
+ :label="$t('stock.shelf.goods_notes')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" />
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </q-tab-panel>
|
|
|
+ <q-tab-panel name="tab3" style="height:300px">
|
|
|
+ <div class="row q-gutter-x-md">
|
|
|
+ <div class="col column q-gutter-y-md">
|
|
|
+ </div>
|
|
|
+ <div class="col column q-gutter-y-md"></div>
|
|
|
+ </div>
|
|
|
+ </q-tab-panel>
|
|
|
+ </q-tab-panels>
|
|
|
+ <div style="position: absolute; right: 20px; bottom: 12px; z-index: 100">
|
|
|
+ <q-btn-group push>
|
|
|
+ <q-btn color="white" text-color="black" @click="shelfLocal = 'undefined'; handleclick()">
|
|
|
+ {{ $t('stock.return') }}
|
|
|
+ </q-btn>
|
|
|
+ <q-btn color="white" text-color="black" @click="showInventoryDetails = !showInventoryDetails">
|
|
|
+ {{ $t('stock.details') }}
|
|
|
+ </q-btn>
|
|
|
+ <q-btn color="primary" text-color="white" @click=handleEdit()>
|
|
|
+ {{ onlyread ? $t('stock.shelf.shelf_edit') : $t("stock.shelf.shelf_confirm") }}
|
|
|
+ </q-btn>
|
|
|
+ </q-btn-group>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="float: right; padding: 15px 15px 50px 15px ;min-width: 100%" flow="row wrap">
|
|
|
+ <q-card class="q-mb-md" bordered v-if="showInventoryDetails">
|
|
|
+ <q-card-actions class="q-px-none"
|
|
|
+ style="position: absolute; right: 20px; top: 10px; z-index: 100">
|
|
|
+ <q-btn v-if="!onlyread" @click=addInventoryDetail() icon="add" flat dense color="primary"
|
|
|
+ :label="$t('stock.add')" />
|
|
|
+ <q-btn v-if="!onlyread" @click=deleteInventoryDetail() icon="delete" flat dense
|
|
|
+ color="primary" :label="$t('stock.delete')" />
|
|
|
+ </q-card-actions>
|
|
|
+ <q-card-section>
|
|
|
+
|
|
|
+ <div class="text-h6 q-mb-md">{{ $t('stock.inventory_details') }}</div>
|
|
|
+
|
|
|
+ <!-- 动态生成的输入行 -->
|
|
|
+ <div v-for="(detail, index) in inventoryDetails" :key="index"
|
|
|
+ class="row q-col-gutter-md q-mb-sm">
|
|
|
+ <div class="col">
|
|
|
+ <q-input v-model="detail.id" :label="$t('stock.batch')" :readonly="onlyread" dense
|
|
|
+ outlined />
|
|
|
+ </div>
|
|
|
+ <div class="col">
|
|
|
+ <q-input v-model="detail.quantity" :label="$t('stock.quantity')"
|
|
|
+ :readonly="onlyread" type="number" dense outlined />
|
|
|
+ </div>
|
|
|
+ <div class="col">
|
|
|
+ <q-input v-model="detail.location" :label="$t('stock.location')"
|
|
|
+ :readonly="onlyread" dense standout outlined />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </q-card-section>
|
|
|
+ </q-card>
|
|
|
+ </div>
|
|
|
+ </q-card>
|
|
|
+ </q-dialog>
|
|
|
+ <q-dialog v-model="elevator_dialog" transition-show="jump-down" transition-hide="jump-up" @show=prepareDialog()>
|
|
|
+ <q-card style="min-width: 350px;">
|
|
|
+ <q-bar class="bg-light-blue-10 text-white rounded-borders" style="height: 50px">
|
|
|
+ <div>
|
|
|
+ {{ $t("stock.elevator.elevator") }}
|
|
|
+ </div>
|
|
|
+ <q-space></q-space>
|
|
|
+ <q-btn dense flat icon="close" v-close-popup>
|
|
|
+ <q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
|
|
|
+ content-style="font-size: 12px">
|
|
|
+ {{ $t("index.close") }}</q-tooltip>
|
|
|
+ </q-btn>
|
|
|
+ </q-bar>
|
|
|
+ <q-card-section class="q-pt-md">
|
|
|
+ <q-input dense outlined square v-model="elevator_form.ip" :label="$t('stock.elevator.ip')"
|
|
|
+ :readonly="onlyread" :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <q-input dense outlined square v-model="elevator_form.port" :label="$t('stock.elevator.port')"
|
|
|
+ type="number" :readonly="onlyread" :rules="[
|
|
|
+ val => val !== null || error1,
|
|
|
+ val => val >= 0 || error1,
|
|
|
+ ]" />
|
|
|
+ <q-input dense outlined square v-model="elevator_form.status" :label="$t('stock.conveyor.status')"
|
|
|
+ :readonly="onlyread" :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <!-- <q-input dense outlined square v-model="elevator_form.password"
|
|
|
+ :label="$t('stock.elevator.password')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" /> -->
|
|
|
+
|
|
|
+ <!-- <q-input dense outlined square v-model="elevator_form.username"
|
|
|
+ :label="$t('stock.elevator.username')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" /> -->
|
|
|
+ </q-card-section>
|
|
|
+ <div style="float: right; padding: 15px 15px 15px 0">
|
|
|
+ <q-btn color="white" text-color="black" style="margin-right: 25px"
|
|
|
+ @click="shelfLocal = 'undefined'; handleclick()">
|
|
|
+ {{ $t('stock.return') }}</q-btn>
|
|
|
+ <q-btn color="primary" text-color="white" style="margin-right: 25px" @click=handleEdit()>
|
|
|
+ {{ onlyread ? $t('stock.shelf.shelf_edit') : $t("stock.shelf.shelf_confirm") }}</q-btn>
|
|
|
+ </div>
|
|
|
+ </q-card>
|
|
|
+ </q-dialog>
|
|
|
+ <q-dialog v-model="conveyor_dialog" transition-show="jump-down" transition-hide="jump-up" @show=prepareDialog()>
|
|
|
+ <q-card style="min-width: 350px;">
|
|
|
+ <q-bar class="bg-light-blue-10 text-white rounded-borders" style="height: 50px">
|
|
|
+ <div>
|
|
|
+ {{ $t("stock.conveyor.conveyor") }}
|
|
|
+ </div>
|
|
|
+ <q-space></q-space>
|
|
|
+ <q-btn dense flat icon="close" v-close-popup>
|
|
|
+ <q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
|
|
|
+ content-style="font-size: 12px">
|
|
|
+ {{ $t("index.close") }}</q-tooltip>
|
|
|
+ </q-btn>
|
|
|
+ </q-bar>
|
|
|
+ <q-card-section class="q-pt-md">
|
|
|
+ <q-input dense outlined square v-model="conveyor_form.ip" :label="$t('stock.conveyor.ip')"
|
|
|
+ :readonly="onlyread" :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ <!-- <q-input dense outlined square v-model="conveyor_form.destination"
|
|
|
+ :label="$t('stock.conveyor.destination')" :readonly="onlyread"
|
|
|
+ :rules="[val => val?.length > 0 || error1]" /> -->
|
|
|
+ <q-input dense outlined square v-model="conveyor_form.port" :label="$t('stock.elevator.port')"
|
|
|
+ type="number" :readonly="onlyread" :rules="[
|
|
|
+ val => val !== null || error1,
|
|
|
+ val => val >= 0 || error1,
|
|
|
+ ]" />
|
|
|
+ <q-input dense outlined square v-model="conveyor_form.status" :label="$t('stock.conveyor.status')"
|
|
|
+ :readonly="onlyread" :rules="[val => val?.length > 0 || error1]" />
|
|
|
+ </q-card-section>
|
|
|
+ <div style="float: right; padding: 15px 15px 15px 0">
|
|
|
+ <q-btn color="white" text-color="black" style="margin-right: 25px"
|
|
|
+ @click="shelfLocal = 'undefined'; handleclick()">
|
|
|
+ {{ $t('stock.return') }}</q-btn>
|
|
|
+
|
|
|
+ <q-btn color="primary" text-color="white" style="margin-right: 25px" @click=handleEdit()>
|
|
|
+ {{ onlyread ? $t('stock.shelf.shelf_edit') : $t("stock.shelf.shelf_confirm") }}</q-btn>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </q-card>
|
|
|
+ </q-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+
|
|
|
+import { LocalStorage } from 'quasar'
|
|
|
+import { getauth, postauth, putauth, deleteauth, getfile } from 'boot/axios_request'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+
|
|
|
+ rowIndex: Number,
|
|
|
+ colIndex: Number,
|
|
|
+ layerIndex: Number,
|
|
|
+ selectedShelfType: String,
|
|
|
+ goodsData: Object,
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pathname: 'bin/',
|
|
|
+ pathnamecontainer: 'container/detail/',
|
|
|
+ container_id: 123456,
|
|
|
+ storage_form: {
|
|
|
+ shelf_name: '货架名称',
|
|
|
+ shelf_department: '货架部门',
|
|
|
+ shelf_warehouse: '仓库',
|
|
|
+ shelf_status: '未满',
|
|
|
+ goods_code: 'A010203',
|
|
|
+ goods_name: '存货货物',
|
|
|
+ goods_std: '规格型号',
|
|
|
+ goods_desc: '存货描述',
|
|
|
+ goods_qty: '123456',
|
|
|
+ goods_unit: 'kg',
|
|
|
+ goods_price: '123456',
|
|
|
+ goods_batch: '存货批号',
|
|
|
+ goods_notes: '备注',
|
|
|
+ goods_in: '123456',
|
|
|
+ goods_out: '123456',
|
|
|
+ },
|
|
|
+ elevator_form: {
|
|
|
+ ip: '192.168.1.100',
|
|
|
+ port: 8080,
|
|
|
+ // username: 'admin',
|
|
|
+ // password: '123456',
|
|
|
+ status: '未连接',
|
|
|
+ },
|
|
|
+ conveyor_form: {
|
|
|
+ ip: '192.168.1.100',
|
|
|
+ port: 8080,
|
|
|
+ // destination: 'A010203',
|
|
|
+ status: '未连接',
|
|
|
+ },
|
|
|
+ showInventoryDetails: false,
|
|
|
+ inventoryDetails: [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ batch: "20230701-001",
|
|
|
+ quantity: 100,
|
|
|
+ location: "A区-1号架",
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ batch: "20230815-002",
|
|
|
+ quantity: 200,
|
|
|
+ location: "B区-3号架",
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ ],
|
|
|
+ inventoryColumns: [
|
|
|
+ { name: 'batch', label: '批次', field: 'batch', align: 'left' },
|
|
|
+ { name: 'quantity', label: '数量', field: 'quantity', align: 'right' },
|
|
|
+ { name: 'location', label: '位置', field: 'location', align: 'left' },
|
|
|
+
|
|
|
+ ],
|
|
|
+ user_id: "",
|
|
|
+ auth_id: "",
|
|
|
+ onlyread: true,
|
|
|
+ clickedinput: false,
|
|
|
+ storage_dialog: false,
|
|
|
+ elevator_dialog: false,
|
|
|
+ conveyor_dialog: false,
|
|
|
+ bgColor: "transparent",
|
|
|
+ selected: { label: '请选择一个选项', value: 'undefined' },
|
|
|
+ shelf_type: { shelf_type: 'undefined' },
|
|
|
+ ip_change: { ip_address: '192.168.1.100', port: 8080, status: 'offline' },
|
|
|
+ goods_change: { shelf_status: '未满', goods_batch: '20230701-001', goods_code: 'A010203', goods_name: '存货货物', goods_std: '规格型号', goods_desc: '存货描述', goods_qty: 123456, goods_unit: 'kg', goods_price: 123456, goods_notes: '备注', goods_in: 123456, goods_out: 123456 },
|
|
|
+ options: [
|
|
|
+ { label: '未定义', value: 'undefined' },
|
|
|
+ { label: '库位', value: 'storage' },
|
|
|
+ { label: '提升机', value: 'elevator' },
|
|
|
+ { label: '输送机', value: 'conveyor' },],
|
|
|
+ error1: this.$t('stock.shelf.error1'),
|
|
|
+ shelfLocal: "",
|
|
|
+ activeTab: 'tab1'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.shelfLocal = this.selectedShelfType;
|
|
|
+ this.handleclick()
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ deleteInventoryDetail() {
|
|
|
+
|
|
|
+ this.inventoryDetails.pop()
|
|
|
+
|
|
|
+ },
|
|
|
+ addInventoryDetail() {
|
|
|
+ if (this.inventoryDetails.length >= 8) {
|
|
|
+ this.$q.notify({
|
|
|
+ message: '最多只能添加8条记录',
|
|
|
+ icon: 'done',
|
|
|
+ color: 'negative'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.inventoryDetails.push({
|
|
|
+ id: this.inventoryDetails.length + 1,
|
|
|
+ batch: "批次",
|
|
|
+ quantity: 0,
|
|
|
+ location: "位置",
|
|
|
+ })
|
|
|
+ },
|
|
|
+ prepareDialog() {
|
|
|
+ this.onlyread = true;
|
|
|
+ },
|
|
|
+ handleSelect(scope) {
|
|
|
+ // 更新选中值
|
|
|
+ this.selected.value = scope.opt.value;
|
|
|
+ this.selected.label = scope.opt.label;
|
|
|
+ // 关闭下拉菜单
|
|
|
+ this.$refs.select.hidePopup();
|
|
|
+ // 如果仍不关闭,尝试强制更新
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.select.hidePopup();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ newDataSubmit() {
|
|
|
+ console.log("newDataSubmit")
|
|
|
+ console.log(this.newFormData)
|
|
|
+
|
|
|
+ },
|
|
|
+ handleclick() {
|
|
|
+ this.shelfLocal = this.selectedShelfType;
|
|
|
+
|
|
|
+
|
|
|
+ if (this.shelfLocal == "undefined") { this.clickedinput = true, this.storage_dialog = false, this.elevator_dialog = false, this.conveyor_dialog = false }
|
|
|
+ if (this.shelfLocal == "storage") { this.getList(), this.clickedinput = false, this.storage_dialog = true, this.elevator_dialog = false, this.conveyor_dialog = false }
|
|
|
+ if (this.shelfLocal == "elevator") { this.getList(), this.clickedinput = false, this.storage_dialog = false, this.elevator_dialog = true, this.conveyor_dialog = false }
|
|
|
+ if (this.shelfLocal == "conveyor") { this.getList(), this.clickedinput = false, this.storage_dialog = false, this.elevator_dialog = false, this.conveyor_dialog = true }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ handleEdit() {
|
|
|
+
|
|
|
+ if (this.onlyread == false) {
|
|
|
+
|
|
|
+ if (this.shelfLocal == "elevator") {
|
|
|
+ this.ip_change.ip_address = this.elevator_form.ip
|
|
|
+ this.ip_change.port = this.elevator_form.port
|
|
|
+ this.ip_change.status = this.elevator_form.status
|
|
|
+ putauth(this.pathname + this.goodsData.id + '/', this.ip_change)
|
|
|
+ }
|
|
|
+ if (this.shelfLocal == "conveyor") {
|
|
|
+ this.ip_change.ip_address = this.conveyor_form.ip
|
|
|
+ this.ip_change.port = this.conveyor_form.port
|
|
|
+ this.ip_change.status = this.conveyor_form.status
|
|
|
+ putauth(this.pathname + this.goodsData.id + '/', this.ip_change)
|
|
|
+ }
|
|
|
+ if (this.shelfLocal == "storage") {
|
|
|
+ this.goods_change.goods_batch = this.storage_form.goods_batch
|
|
|
+ this.goods_change.goods_code = this.storage_form.goods_code
|
|
|
+ this.goods_change.goods_name = this.storage_form.goods_name
|
|
|
+ this.goods_change.goods_std = this.storage_form.goods_std
|
|
|
+ this.goods_change.goods_desc = this.storage_form.goods_desc
|
|
|
+ this.goods_change.goods_qty = this.storage_form.goods_qty
|
|
|
+ this.goods_change.goods_unit = this.storage_form.goods_unit
|
|
|
+ this.goods_change.goods_price = this.storage_form.goods_price
|
|
|
+
|
|
|
+ this.goods_change.goods_notes = this.storage_form.goods_notes
|
|
|
+ this.goods_change.goods_in = this.storage_form.goods_in
|
|
|
+ this.goods_change.goods_out = this.storage_form.goods_out
|
|
|
+ this.goods_change.shelf_status = this.storage_form.shelf_status
|
|
|
+ putauth(this.pathname + this.goodsData.id + '/', this.goods_change)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.user_id = LocalStorage.getItem('login_mode')
|
|
|
+ if (this.user_id == "Admin") {
|
|
|
+ this.onlyread = false
|
|
|
+ this.showInventoryDetails = true
|
|
|
+
|
|
|
+ }
|
|
|
+ if (this.user_id == "Manager") {
|
|
|
+ this.auth_id = LocalStorage.getItem('auth_edit')
|
|
|
+ // console.log(this.auth_id)
|
|
|
+ //这里添加权限判断
|
|
|
+ if (this.auth_id == "1") {
|
|
|
+ this.onlyread = false
|
|
|
+ this.showInventoryDetails = true
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.onlyread = true
|
|
|
+ this.$q.notify({
|
|
|
+ message: '权限不足,请联系管理员',
|
|
|
+ icon: 'close',
|
|
|
+ color: 'negative'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ this.shelfLocal = this.selected.value
|
|
|
+ this.shelf_type.shelf_type = this.selected.value
|
|
|
+ this.handleclick()
|
|
|
+ console.log(this.goodsData.id)
|
|
|
+ putauth(this.pathname + this.goodsData.id + '/', this.shelf_type)
|
|
|
+ this.getList()
|
|
|
+
|
|
|
+ },
|
|
|
+ // bgColorchanger() {
|
|
|
+ // if (this.shelfLocal == "undefined") {
|
|
|
+ // this.bgColor = "#808080" //灰色
|
|
|
+ // }
|
|
|
+ // if (this.shelfLocal == "elevator") {
|
|
|
+ // this.bgColor = "#4CAF50" //绿色
|
|
|
+ // }
|
|
|
+ // if (this.shelfLocal == "conveyor") {
|
|
|
+ // this.bgColor = "#FF9800" //橙色
|
|
|
+ // }
|
|
|
+ // if (this.shelfLocal == "storage") {
|
|
|
+ // this.bgColor = "#008CBA" //蓝色
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ getList() {
|
|
|
+ var _this = this;
|
|
|
+ getauth(_this.pathname + _this.goodsData.id + '/')
|
|
|
+ .then(res => {
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ _this.container_id = res.current_containers[0]
|
|
|
+ console.log("当前托盘ID",_this.container_id)
|
|
|
+ getauth(_this.pathnamecontainer + '?container='+_this.container_id)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.shelf_type == "storage") {
|
|
|
+ this.storage_form.goods_batch = res.goods_batch
|
|
|
+ this.storage_form.goods_code = res.goods_code
|
|
|
+ this.storage_form.goods_name = res.goods_name
|
|
|
+ this.storage_form.goods_std = res.goods_std
|
|
|
+ this.storage_form.goods_desc = res.goods_desc
|
|
|
+ this.storage_form.goods_qty = res.goods_qty
|
|
|
+ this.storage_form.goods_unit = res.goods_unit
|
|
|
+ this.storage_form.goods_price = res.goods_price
|
|
|
+ this.storage_form.goods_notes = res.goods_notes
|
|
|
+ this.storage_form.goods_in = res.goods_in
|
|
|
+ this.storage_form.goods_out = res.goods_out
|
|
|
+ this.storage_form.shelf_name = res.shelf_name
|
|
|
+ this.storage_form.shelf_department = res.shelf_department
|
|
|
+ this.storage_form.shelf_warehouse = res.warehouse_name
|
|
|
+ this.storage_form.shelf_status = res.shelf_status
|
|
|
+ }
|
|
|
+ else if (res.shelf_type == "elevator") {
|
|
|
+ this.elevator_form.ip = res.ip_address
|
|
|
+ this.elevator_form.port = res.port
|
|
|
+ this.elevator_form.status = res.status
|
|
|
+ }
|
|
|
+ else if (res.shelf_type == "conveyor") {
|
|
|
+ this.conveyor_form.ip = res.ip_address
|
|
|
+ this.conveyor_form.port = res.port
|
|
|
+ this.conveyor_form.status = res.status
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ _this.$q.notify({
|
|
|
+ message: err.detail,
|
|
|
+ icon: 'close',
|
|
|
+ color: 'negative'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+:deep(.q-field__label) {
|
|
|
+
|
|
|
+ margin-top: 8px;
|
|
|
+ align-self: center;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+:deep(.q-field__control-container) {
|
|
|
+
|
|
|
+ padding-left: 50px;
|
|
|
+ margin-top: -5px;
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|