Browse Source

出入库添加条码

caojunjie 3 years ago
parent
commit
6e3d73d07c

+ 19 - 3
src/api/warehouseBusiness/warehouseInStock.js

@@ -16,10 +16,26 @@ export function getWarehousebills(fId) {
     method: 'get'
   })
 }
-
-export function listElabelByfGPid(fGPid) {
+//查询条形码
+export function listElabelByfGPid(params) {
+  return request({
+    url: '/warehouseBusiness/label/list',
+    method: 'get',
+    params
+  })
+}
+//保存条形码
+export function saveCode(data) {
+  return request({
+    url: '/warehouseBusiness/label/save',
+    method: 'post',
+    data
+  })
+}
+//删除条形码
+export function deleteCode(fId) {
   return request({
-    url: '/warehouseBusiness/inStock/selectElabelList/' + fGPid,
+    url: '/warehouseBusiness/label/remove/'+fId,
     method: 'get'
   })
 }

+ 57 - 16
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -1285,13 +1285,6 @@
             </el-col>
             <el-col style="display: flex; justify-content: flex-end">
               <el-button
-                type="primary"
-                size="small"
-                @click="showElabel"
-                v-show="showDataElabel == '0'"
-              >查看电子标签
-              </el-button>
-              <el-button
                 size="small"
                 type="info"
                 prop="打印"
@@ -1464,6 +1457,14 @@
                 >移除
                 </el-button
                 >
+                <el-button
+                    type="text"
+                    size="small"
+                    @click="showElabel(scope)"
+                    :disabled="browseStatus"
+                    v-if="showDataElabel == '0'"
+                >条码
+                </el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -6278,6 +6279,11 @@
                width="40%"
     >
     <span>
+      <el-button type="primary" @click="elabelList.push({
+        fGPid:form.fId,
+        fPid:eId,
+        fType:'1',
+      })">录入明细</el-button>
       <el-table :data="elabelList" element-loading-text="努力加载中">
       <el-table-column
         label="序号"
@@ -6289,11 +6295,24 @@
       <el-table-column
         prop="fContent"
         align="center"
-        label="电子标签"
-      />
+        label="条码"
+      >
+        <template slot-scope="scope">
+          <el-input v-model="scope.row.fContent" placeholder="请输入条码"></el-input>
+        </template>
+      </el-table-column>
+        <el-table-column
+            fixed="right"
+            label="操作"
+            width="100">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" icon="el-icon-delete" @click="deleteBarcode(scope)">删除</el-button>
+        </template>
+      </el-table-column>
     </el-table>
     </span>
       <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="saveBarcode">保 存</el-button>
         <el-button @click="showElabelDialog = false">取 消</el-button>
       </span>
     </el-dialog>
@@ -6406,7 +6425,7 @@ import {
   checkCode,
   queryClerkRoleList,
   pleaseCheck,
-  feesCheck, downloadTemplate, listElabelByfGPid
+  feesCheck, downloadTemplate, listElabelByfGPid, saveCode, deleteCode
 } from '@/api/warehouseBusiness/warehouseInStock'
 import { operationAgreement } from '@/api/agreement/agreement'
 import { listCorps, getCorps } from '@/api/basicdata/corps'
@@ -6879,7 +6898,8 @@ export default {
       signature: null, //打印时候的电子签章
       showDataElabel: null,
       showElabelDialog: false,
-      elabelList: []
+      elabelList: [],
+      eId:''
     }
   },
   async created() {
@@ -9230,12 +9250,33 @@ export default {
       }
     },
     // 查看电子标签
-    showElabel() {
-      this.showElabelDialog = true
-      if (this.form.fId) {
-        listElabelByfGPid(this.form.fId).then((response) => {
-          this.elabelList = response.data.elabelList
+    showElabel(scope) {
+      this.eId = scope.row.fId
+      if (scope.row.fId){
+        listElabelByfGPid({fPid:scope.row.fId}).then(res=>{
+          this.elabelList = res.data
+          this.showElabelDialog = true
+        })
+      }else {
+        this.$message.error('该单据未保存');
+      }
+    },
+    //条码保存
+    saveBarcode(){
+      saveCode(this.elabelList).then(res=>{
+        listElabelByfGPid({fPid:this.eId}).then(res=>{
+          this.elabelList = res.data
+        })
+      })
+    },
+    //条码删除
+    deleteBarcode(scope){
+      if (scope.row.fId){
+        deleteCode(scope.row.fId).then(res=>{
+          this.elabelList.splice(scope.$index, 1);
         })
+      }else {
+        this.elabelList.splice(scope.$index, 1);
       }
     },
     //打印

+ 66 - 24
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -886,13 +886,6 @@
               >
             </el-col>
             <el-col style="display: flex; justify-content: flex-end">
-              <el-button
-                type="primary"
-                size="small"
-                @click="showElabel"
-                v-show="showDataElabel == '0'"
-              >查看电子标签
-              </el-button>
               <el-button size="small" type="info" prop="打印" @click="printZyd" v-if="entryPrinting == 0"
               >作业单
               </el-button>
@@ -1230,6 +1223,14 @@
                 >移除
                 </el-button
                 >
+                <el-button
+                    type="text"
+                    size="small"
+                    @click="showElabel(scope)"
+                    :disabled="browseStatus"
+                    v-if="showDataElabel == '0'"
+                >条码
+                </el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -5257,24 +5258,43 @@
     <el-dialog title="电子标签"
                :visible.sync="showElabelDialog"
                :close-on-click-modal="false"
-               width="40%">
+               width="40%"
+    >
     <span>
+      <el-button type="primary" @click="elabelList.push({
+        fGPid:form.fId,
+        fPid:eId,
+        fType:'2',
+      })">录入明细</el-button>
       <el-table :data="elabelList" element-loading-text="努力加载中">
       <el-table-column
-        label="序号"
-        type="index"
-        width="50"
-        fixed
-        align="center"
+          label="序号"
+          type="index"
+          width="50"
+          fixed
+          align="center"
       />
       <el-table-column
-        prop="fContent"
-        align="center"
-        label="电子标签"
-      />
+          prop="fContent"
+          align="center"
+          label="条码"
+      >
+        <template slot-scope="scope">
+          <el-input v-model="scope.row.fContent" placeholder="请输入条码"></el-input>
+        </template>
+      </el-table-column>
+        <el-table-column
+            fixed="right"
+            label="操作"
+            width="100">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" icon="el-icon-delete" @click="deleteBarcode(scope)">删除</el-button>
+        </template>
+      </el-table-column>
     </el-table>
     </span>
       <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="saveBarcode">保 存</el-button>
         <el-button @click="showElabelDialog = false">取 消</el-button>
       </span>
     </el-dialog>
@@ -5333,7 +5353,7 @@ import { getToken } from '@/utils/auth'
 import { addSet, select, resetModule } from '@/api/system/set'
 import upLoad from '../components/upLoad'
 import draggable from 'vuedraggable'
-import { listElabelByfGPid, queryClerkRoleList } from '@/api/warehouseBusiness/warehouseInStock'
+import {deleteCode, listElabelByfGPid, queryClerkRoleList, saveCode} from '@/api/warehouseBusiness/warehouseInStock'
 import { listCharge } from '@/api/system/viewApproval'
 import { getDept } from '@/api/basicdata/dept'
 
@@ -6264,6 +6284,7 @@ export default {
       showDataElabel: null,
       showElabelDialog: false,
       elabelList: [],
+      eId:''
     }
   },
   computed: {
@@ -7226,12 +7247,33 @@ export default {
       this.addOrUpdateVisible = false
     },
     // 查看电子标签
-    showElabel() {
-      this.showElabelDialog = true;
-      if (this.form.fId) {
-        listElabelByfGPid(this.form.fId).then((response) => {
-          this.elabelList = response.data.elabelList;
-        });
+    showElabel(scope) {
+      this.eId = scope.row.fId
+      if (scope.row.fId){
+        listElabelByfGPid({fPid:scope.row.fId}).then(res=>{
+          this.elabelList = res.data
+          this.showElabelDialog = true
+        })
+      }else {
+        this.$message.error('该单据未保存');
+      }
+    },
+    //条码保存
+    saveBarcode(){
+      saveCode(this.elabelList).then(res=>{
+        listElabelByfGPid({fPid:this.eId}).then(res=>{
+          this.elabelList = res.data
+        })
+      })
+    },
+    //条码删除
+    deleteBarcode(scope){
+      if (scope.row.fId){
+        deleteCode(scope.row.fId).then(res=>{
+          this.elabelList.splice(scope.$index, 1);
+        })
+      }else {
+        this.elabelList.splice(scope.$index, 1);
       }
     },
     returnData() {

+ 1 - 1
src/views/kaihe/containerNews/boxInformation/index.vue

@@ -1363,7 +1363,7 @@ export default {
           { required: true, message: ' ', trigger: 'blur' }
         ],
         fMblno: [
-          { required: true, message: ' ', trigger: 'blur' }
+          { required: false, message: ' ', trigger: 'blur' }
         ],
       },
       // 是否启用 true启用 FALSE停用