Browse Source

完善商品刊登及库存刊登

yangg 11 months ago
parent
commit
23da2efd82
5 changed files with 846 additions and 214 deletions
  1. 1 1
      .env
  2. 1 1
      src/components/TableLayout/index.vue
  3. 1 1
      src/locales/zh.json
  4. 807 175
      src/views/goods/SKUList.vue
  5. 36 36
      src/views/stock/addOutbound.vue

+ 1 - 1
.env

@@ -1,4 +1,4 @@
-VITE_API_URL=http://192.168.1.178:9998
+VITE_API_URL=https://api.raycos.net
 #线下地址
 #http://192.168.1.178:9998
 #http://192.168.1.141:9998

+ 1 - 1
src/components/TableLayout/index.vue

@@ -88,7 +88,7 @@ export default {
   },
   data() {
     return {
-      height: `${document.body.clientHeight - 260}`,
+      height: `${document.body.clientHeight - 460}`,
     };
   },
   methods: {

+ 1 - 1
src/locales/zh.json

@@ -71,7 +71,7 @@
     "down":"驳 回",
     "print":"打 印",
     "preview":"预 览",
-    "search":"搜 索",
+    "search":"搜索",
     "operate":"操 作",
     "submit":"确 定",
     "cancel":"取 消",

File diff suppressed because it is too large
+ 807 - 175
src/views/goods/SKUList.vue


+ 36 - 36
src/views/stock/addOutbound.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="bg-in-stock bg-white">
     <el-form ref="goodsExchangeAddFormRef" :model="goodsExchangeAddForm" :rules="goodsExchangeAddFormRule" label-width="160px" inline class="change-form">
-      <el-form-item prop="warehouse_id" :label="$t('outBound')+$t('warechouse')" class="change-form-item">
+      <el-form-item prop="warehouse_id" :label="$t('outBound') + $t('warechouse')" class="change-form-item">
         <el-select v-model="goodsExchangeAddForm.warehouse_id" :disabled="type === 'view' || type === 'audit'">
           <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
         </el-select>
@@ -29,11 +29,11 @@
         ></el-input>
       </el-form-item>
       <div class="mx">
-        <h3>{{$t('goods_inventory')}}</h3>
-        <el-button class="button" size="small" type="primary" v-if="type !== 'view' && type !== 'audit'" @click="scanCode">{{$t('scan_code')}}</el-button>
-        <el-button class="button" size="small" type="primary" v-if="type !== 'view' && type !== 'audit'" @click="handleSelectWarehouseEntryBatch"
-          >{{$t('select')}}</el-button
-        >
+        <h3>{{ $t('goods_inventory') }}</h3>
+        <el-button class="button" size="small" type="primary" v-if="type !== 'view' && type !== 'audit'" @click="scanCode">{{ $t('scan_code') }}</el-button>
+        <el-button class="button" size="small" type="primary" v-if="type !== 'view' && type !== 'audit'" @click="handleSelectWarehouseEntryBatch">{{
+          $t('select')
+        }}</el-button>
       </div>
       <div style="width: 100%; display: block">
         <el-form-item style="width: 100%">
@@ -50,7 +50,9 @@
                   <div>
                     <p v-for="item in scope.row.area_stock_list" :key="item.id">{{ item.warehouse_area_name }}</p>
                   </div>
-                  <span slot="reference" v-if="scope.row.area_stock_list.length !== 0">{{ scope.row.area_stock_list[0].warehouse_area_name }}</span>
+                  <template #reference>
+                    <span v-if="scope.row.area_stock_list.length !== 0">{{ scope.row.area_stock_list[0].warehouse_area_name }}</span>
+                  </template>
                 </el-popover>
               </template>
             </el-table-column>
@@ -112,22 +114,20 @@
             </el-table-column>
             <el-table-column width="200" :label="$t('operate')" v-if="type !== 'view' && type !== 'audit'">
               <template #default="scope">
-                <el-button size="small" type="danger" @click="goodsExchangeAddForm.product_list.splice(scope.$index, 1)">{{$t('delete')}}</el-button>
+                <el-button size="small" type="danger" @click="goodsExchangeAddForm.product_list.splice(scope.$index, 1)">{{ $t('delete') }}</el-button>
               </template>
             </el-table-column>
           </el-table>
         </el-form-item>
       </div>
     </el-form>
-    <div class="footer"><!-- && checkPermission(['warehouseOut2:add']) -->
-      <el-button v-if="type !== 'audit' && type !== 'view' " type="primary" @click="saveGoodsExchangeAddForm"
-        >{{$t('save')}}
-      </el-button><!--  && checkPermission(['warehouseOut:update']) -->
-      <el-button v-if="type !== 'audit' && type !== 'view'" type="primary" @click="submitGoodsExchangeAddForm"
-        >{{$t('outBound')}}
-      </el-button>
-      <el-button @click="printIng" v-if="type == 'audit'">{{$t('print')}}</el-button>
-      <el-button @click="toBack()">{{$t('return')}}</el-button>
+    <div class="footer">
+      <!-- && checkPermission(['warehouseOut2:add']) -->
+      <el-button v-if="type !== 'audit' && type !== 'view'" type="primary" @click="saveGoodsExchangeAddForm">{{ $t('save') }} </el-button
+      ><!--  && checkPermission(['warehouseOut:update']) -->
+      <el-button v-if="type !== 'audit' && type !== 'view'" type="primary" @click="submitGoodsExchangeAddForm">{{ $t('outBound') }} </el-button>
+      <el-button @click="printIng" v-if="type == 'audit'">{{ $t('print') }}</el-button>
+      <el-button @click="toBack()">{{ $t('return') }}</el-button>
     </div>
 
     <el-dialog :title="$t('prompt')" v-model:visible="dialogVisible" width="30%" class="!rounded-lg">
@@ -137,8 +137,8 @@
         </el-form-item>
       </el-form>
       <template #footer>
-        <el-button @click="dialogVisible = false">{{$t('cancel')}}</el-button>
-        <el-button type="primary" @click="handleRejectGoodsExchange()">{{$t('submit')}}</el-button>
+        <el-button @click="dialogVisible = false">{{ $t('cancel') }}</el-button>
+        <el-button type="primary" @click="handleRejectGoodsExchange()">{{ $t('submit') }}</el-button>
       </template>
     </el-dialog>
     <el-dialog :title="$t('out_code')" v-model:visible="scanDialogVisible" width="30%" :close-on-click-modal="false" class="!rounded-lg">
@@ -151,10 +151,10 @@
         </el-form-item>
       </el-form>
     </el-dialog>
-    <el-dialog :title="$t('outBound')+$t('goods_info')" v-model="goodsVisible" width="1000px" @close="closeGoosData" class="!rounded-lg">
+    <el-dialog :title="$t('outBound') + $t('goods_info')" v-model="goodsVisible" width="1000px" @close="closeGoosData" class="!rounded-lg">
       <div style="display: flex; align-items: center; justify-content: flex-end; padding: 10px 0">
-        <span>{{$t('search')+$t('goods_info')}}:</span><el-input v-model="params.keyWord" style="width: 200px; margin-right: 5px"></el-input>
-        <el-button @click="searchGoodEvent"> {{$t('search')}} </el-button>
+        <span>{{ $t('search') + $t('goods_info') }}:</span><el-input v-model="params.keyWord" style="width: 200px; margin-right: 5px"></el-input>
+        <el-button @click="searchGoodEvent"> {{ $t('search') }} </el-button>
       </div>
       <el-table :data="goodsData.records" border style="width: 100%" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" />
@@ -179,15 +179,15 @@
       >
       </el-pagination>
       <template #footer>
-        <el-button @click="closeGoosData">{{$t('cancel')}}</el-button>
-        <el-button type="primary" @click="submitGoosData()">{{$t('submit')}}</el-button>
+        <el-button @click="closeGoosData">{{ $t('cancel') }}</el-button>
+        <el-button type="primary" @click="submitGoosData()">{{ $t('submit') }}</el-button>
       </template>
     </el-dialog>
   </div>
 </template>
   
   <script setup>
-import { ref, onMounted, computed, watch, reactive,nextTick } from 'vue';
+import { ref, onMounted, computed, watch, reactive, nextTick } from 'vue';
 import { useStore, mapGetters } from 'vuex';
 import * as API_GoodsExchange from '@/api/goodsExchange';
 import * as API_Setting from '@/api/setting';
@@ -235,8 +235,8 @@ const goodsExchangeAddForm = ref({
   type: '',
 });
 const goodsExchangeAddFormRule = ref({
-  warehouse_id: [{ required: true, message: t('change')+t('outBound')+t('warechouse'), trigger: 'change' }],
-  type: [{ required: true, message: t('change')+t('outBound')+t('type'), trigger: 'change' }],
+  warehouse_id: [{ required: true, message: t('change') + t('outBound') + t('warechouse'), trigger: 'change' }],
+  type: [{ required: true, message: t('change') + t('outBound') + t('type'), trigger: 'change' }],
 });
 const typeList = ref([]);
 const adminList = ref([]);
@@ -345,7 +345,7 @@ const toSearch = () => {
 
 const scanCode = () => {
   if (!goodsExchangeAddForm.value.warehouse_id) {
-    ElMessage.error(t('change')+t('warechouse')+'!');
+    ElMessage.error(t('change') + t('warechouse') + '!');
     return;
   }
   scanDialogVisible.value = true;
@@ -405,7 +405,7 @@ const saveGoodsExchangeAddForm = () => {
       }
       if (type.value == 'edit') {
         API_GoodsExchange.editWarehouseOut(id, params).then((response) => {
-          ElMessage.success(t('edit_success')+'!');
+          ElMessage.success(t('edit_success') + '!');
           /* const { callback } = this.$route.params;
           if (typeof callback === 'function') callback();
           store.dispatch('delCurrentViews', {
@@ -421,7 +421,7 @@ const saveGoodsExchangeAddForm = () => {
           el.id = '';
         });
         API_GoodsExchange.warehouseOut(params).then(() => {
-          ElMessage.success(t('add_success')+'!');
+          ElMessage.success(t('add_success') + '!');
           /* const { callback } = this.$route.params;
           if (typeof callback === 'function') callback();
           store.dispatch('delCurrentViews', {
@@ -452,7 +452,7 @@ const submitGoodsExchangeAddForm = () => {
       }
       params.change_time = Math.floor(params.change_time / 1000);
       if (!goodsExchangeAddForm.value.product_list.length) {
-        ElMessage.error(t('change')+t('goods_info')+'!');
+        ElMessage.error(t('change') + t('goods_info') + '!');
         return;
       }
       if (params.type == 'OTHER_OUT' || params.type == 'BORROW_OUT') {
@@ -469,14 +469,14 @@ const submitGoodsExchangeAddForm = () => {
       }
       if (type.value == 'edit') {
         API_GoodsExchange.editWarehouseOut(id, params).then((response) => {
-          ElMessage.success(t('edit_success')+'!');
+          ElMessage.success(t('edit_success') + '!');
           /* const { callback } = this.$route.params;
           if (typeof callback === 'function') callback();
           store.dispatch('delCurrentViews', {
             view: this.$route,
             $router: this.$router,
           }); */
-         router.push({ name: 'goodsOutBound' });
+          router.push({ name: 'goodsOutBound' });
         });
       } else {
         params.product_list.map((el) => {
@@ -484,7 +484,7 @@ const submitGoodsExchangeAddForm = () => {
           el.id = '';
         });
         API_GoodsExchange.warehouseOut(params).then(() => {
-          ElMessage.success(t('add_success')+'!');
+          ElMessage.success(t('add_success') + '!');
           /* const { callback } = this.$route.params;
           if (typeof callback === 'function') callback();
           store.dispatch('delCurrentViews', {
@@ -511,7 +511,7 @@ const params = reactive({
 });
 const handleSelectWarehouseEntryBatch = async () => {
   if (!goodsExchangeAddForm.value.warehouse_id) {
-    ElMessage.error(t('change')+t('warechouse')+'!');
+    ElMessage.error(t('change') + t('warechouse') + '!');
     return;
   }
   API_GoodsExchange.getGoodsInfo(params, goodsExchangeAddForm.value.warehouse_id, 'gt').then((res) => {
@@ -533,7 +533,7 @@ const submitGoosData = () => {
     });
     goodsVisible.value = false;
   } else {
-    ElMessage.error(t('change')+t('goods_info')+'!');
+    ElMessage.error(t('change') + t('goods_info') + '!');
   }
 };
 const goodsPageSizeChange = (size) => {

Some files were not shown because too many files changed in this diff