Bladeren bron

一体机bug修改

asd26269546 2 jaren geleden
bovenliggende
commit
b81817bc6c

+ 2 - 0
src/api/account.js

@@ -53,3 +53,5 @@ export const FindByFace = (data = {}) => {
     method: 'post'
   })
 }
+
+

+ 28 - 0
src/api/integrated.js

@@ -207,3 +207,31 @@ export const GetV3PlanData2 = (data = {}) => {
     method: 'post'
   })
 }
+
+
+/* GetPurContractPageList */
+export const GetPurContractPageList = (data = {}) => {
+  return axios.request({
+    url: '/api/SupplierShip/GetPurContractPageList',
+    data,
+    method: 'post'
+  })
+}
+
+// 获取出货批次
+export const GetPurBatchShip = (data = {}) => {
+  return axios.request({
+    url: '/api/SupplierShip/GetPurBatchShip',
+    data,
+    method: 'post'
+  })
+}
+
+// 获取物料二维码标签列表
+export const GetSupplierQRCode = (data = {}) => {
+  return axios.request({
+    url: '/api/SupplierShip/GetSupplierQRCode',
+    data,
+    method: 'post'
+  })
+}

+ 9 - 0
src/components/my-modal-form/my-modal-material.vue

@@ -456,6 +456,15 @@ export default {
       this.params.jobNo = window.localStorage.getItem('jobNo')
       GetV3PlanData2(this.params).then(res => {
         if (res.code === 0) {
+          // for (let i = 0; i < res.result.allMaterialList.list.length; i++) {
+          //   const element = res.result.allMaterialList.list[i];
+          //   console.log(res.result.allMaterialList.list)
+          //   if(element.canTakeQty <= 0){
+          //     console.log(i)
+          //     res.result.allMaterialList.list.splice(i,1)
+          //     i--
+          //   }
+          // }
           this.data = res.result.allMaterialList.list
           this.params.total = res.result.allMaterialList.totalCount
           this.data2 = res.result.v3DataList

+ 407 - 0
src/views/my-manage-modal.vue

@@ -0,0 +1,407 @@
+<template>
+  <div>
+    <my-modal v-model="show" :data="formData" @getlist="getPurBatchShip" @approval-handle="approvalHandle" v-bind="$attrs"></my-modal>
+    <modal v-model="modal" class-name="vertical-center-modal" width="1000px">
+      <div class="content">
+        <div v-if="isSupplier">
+          <div class="title">出货管理</div>
+          <div class="row">
+            <div class="col">
+              <div class="label">件号:</div>
+              <div class="value">{{ data.materialCode }}</div>
+            </div>
+            <div class="col">
+              <div class="label">物料名称:</div>
+              <div class="value">{{ data.materialName }}</div>
+            </div>
+            <div class="col">
+              <div class="label">规格:</div>
+              <div class="value">{{ data.spec }}</div>
+            </div>
+          </div>
+          <div class="row">
+            <div class="col">
+              <div class="label">采购数量:</div>
+              <div class="value">{{ data.purchaseQty }}</div>
+            </div>
+            <div class="col">
+              <div class="label">单价:</div>
+              <div class="value">{{ data.price }}</div>
+            </div>
+            <div class="col">
+              <div class="label">合同金额:</div>
+              <div class="value">{{ data.totalAmount }}</div>
+            </div>
+          </div>
+          <div class="row">
+            <div class="col">
+              <div class="label">二维码个数:</div>
+              <div class="value">{{ tableData.tagCount  }}</div>
+            </div>
+            <div class="col">
+              <div class="label">生成总数量:</div>
+              <div class="value">{{ tableData.totalQty  }}</div>
+            </div>
+            <div class="col"></div>
+          </div>
+          <div class="row">
+            <div class="col">
+              <div class="label">已发货:</div>
+              <div class="value">{{ tableData.hadShipQty }}</div>
+            </div>
+            <div class="col">
+              <div class="label">未发货:</div>
+              <div class="value">{{ tableData.unShipQty }}</div>
+            </div>
+            <div class="col"></div>
+          </div>
+        </div>
+        <div v-else>
+          <div class="title">批次管理</div>
+          <div class="row">
+            <div class="col">
+              <div class="label">物料编码:</div>
+              <div class="value">{{ data.materialCode }}</div>
+            </div>
+            <div class="col">
+              <div class="label">物料名称:</div>
+              <div class="value">{{ data.materialName }}</div>
+            </div>
+            <div class="col">
+              <div class="label">规格:</div>
+              <div class="value">{{ data.spec }}</div>
+            </div>
+          </div>
+          <div class="row">
+            <div class="col">
+              <div class="label">采购数量:</div>
+              <div class="value">{{ data.purchaseQty }}</div>
+            </div>
+          </div>
+          <div class="row">
+            <div class="col">
+              <div class="label">二维码个数:</div>
+              <div class="value">{{ tableData.tagCount  }}</div>
+            </div>
+            <div class="col">
+              <div class="label">生成总数量:</div>
+              <div class="value">{{ tableData.totalQty  }}</div>
+            </div>
+            <div class="col"></div>
+          </div>
+        </div>
+        <div class="table">
+          <my-table
+            ref="table"
+            :data="tableData.batchItems"
+            :columns="columns"
+            :isShowFilter="false"
+            selectKey="id"
+            :is-show-page="false"
+            height="300"
+            @event-handle="eventHandle"
+            @on-select="getSelect"
+            @on-change="changePage"
+            >
+          </my-table>
+        </div>
+      </div>
+      <div class="footer" slot="footer">
+        <Button @click="cancel" class="btn" type="primary">关闭</Button>
+      </div>
+    </modal>
+  </div>
+
+</template>
+
+<script>
+import {
+  GetPurBatchShip
+} from '@/api/integrated'
+import MyModal from './my-modal'
+import MyTable from '@/components/my-table/my-table'
+export default {
+  name: 'my-manage-modal',
+  data () {
+    return {
+      isSupplier:false,
+      formData: {},
+      stockTagIds: [], // 表格勾选的id
+      printList: [], // 打印数据
+      tableData: [],
+      show: false, // 合同信息
+      modal: false,
+      columns: [
+        {
+          type: 'selection',
+          width: 60,
+          align: 'center'
+        },
+        {
+          title: '批次号',
+          key: 'batchNo',
+          width: 150,
+          align: 'center'
+        },
+        {
+          title: '创建日期',
+          key: 'createdTime',
+          minWidth: 150
+        },
+        {
+          title: '出货日期',
+          key: 'shipTime',
+          minWidth: 200
+        },
+        {
+          title: '件数',
+          key: 'tagCount',
+          minWidth: 150
+        },
+        {
+          title: '数量',
+          key: 'purchaseQty',
+          minWidth: 150
+        },
+        {
+          title: '操作',
+          minWidth: 120,
+          fixed: 'right',
+          align: 'center',
+          render: (h, params) => {
+            let _this = this
+            return h('div', [
+              h('Button', {
+                props: {
+                  type: 'primary'
+                },
+                style: {
+                  width: '80px'
+                },
+                on: {
+                  click (e) {
+                    e.stopPropagation()
+                    _this.show = true
+                    _this.formData = { ...params.row, ..._this.data }
+                    // _this.formData = { ..._this.data }
+                  }
+                }
+              }, '管理')
+            ])
+          }
+        }
+      ],
+      tableFilter: [],
+      params: {
+        pageIndex: 1,
+        pageSize: 20,
+        total: 0
+      }
+    }
+  },
+  components: {
+    MyTable,
+    MyModal
+  },
+  // inject: ['isSupplier'],
+  props: {
+    data: {
+      type: Object,
+      default () {
+        return {}
+      }
+    },
+    value: {
+      type: Boolean,
+      default: false,
+      require: true
+    }
+  },
+  watch: {
+    value: {
+      handler (n) {
+        this.modal = n
+      },
+      immediate: true
+    },
+    modal (n) {
+      this.$emit('input', n)
+      if (n) {
+        // this.tableFilter[0].disabled = !!this.data.hasApprovalingFlow
+        // this.tableFilter[1].disabled = !!this.data.hasApprovalingFlow
+        this.getPurBatchShip()
+      }
+    }
+  },
+  methods: {
+    approvalHandle () {
+      this.$emit('approval-handle')
+      this.cancel()
+    },
+    getSelect (data) {
+      console.log('table----data')
+      console.log(data)
+      this.printList = []
+      this.printList = [ ...data ]
+    },
+    changePage (pageIndex) {
+      this.params.pageIndex = pageIndex
+      this.getPurBatchShip()
+    },
+    // 检索条件事件处理
+    eventHandle (option) {
+      switch (option._evnet) {
+        case 'add':
+          this.addPurBatchShip()
+          break
+        case 'del':
+          if (this.printList.length === 0) {
+            return this.$Message.error('请选择数据!')
+          }
+          this.$MyModal.show({ text: '是否删除?' }).$on('confirm', () => {
+            DeletePurBatchShip({
+              batchItems: this.printList.map(item => item.id)
+            }).then(res => {
+              if (res.code === 0) {
+                this.$Message.info(res.msg)
+                this.printList = []
+                this.$refs.table.clearTempList()
+                this.getPurBatchShip()
+              }
+            })
+          })
+          break
+      }
+    },
+    /* 新增批次号 */
+    addPurBatchShip () {
+      AddPurBatchShip({
+        purchaseBillNo: this.data.purchaseBillNo
+      }).then(res => {
+        if (res.code === 0) {
+          this.getPurBatchShip()
+        }
+      })
+    },
+    // 获取物料列表
+    getPurBatchShip () {
+      GetPurBatchShip({
+        // ...this.params,
+        purchaseBillNo: this.data.purchaseBillNo
+      }).then(res => {
+        if (res.code === 0) {
+          this.tableData = []
+          this.$refs.table.tempList = []
+          this.tableData = res.result
+          this.params.total = res.result.tagCount
+        }
+      })
+    },
+    cancel () {
+      this.stockTagIds = []
+      this.modal = false
+    }
+  },
+  beforeUpdate () {
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.content {
+  overflow: hidden;
+  padding: 20px 40px;
+  font-size: 14px;
+  .title {
+    padding-bottom: 20px;
+    font-size: 20px;
+    font-weight: bold;
+    text-align: center;
+  }
+  .row {
+    padding-bottom: 10px;
+    display: flex;
+    justify-content: space-between;
+    align-items: flex-start;
+    .col {
+      flex: 1;
+      display: flex;
+      align-items: flex-start;
+      .label {
+      }
+      .value {
+        flex: 1;
+      }
+    }
+  }
+  .text {
+    padding: 10px 0;
+  }
+  .table {
+    //height: ~"calc(100% - 100px)";
+    overflow: auto;
+    margin: 10px 0;
+    padding: 10px;
+    border: 1px solid #dcdee2;
+  }
+}
+.sub-content {
+  padding: 0 20px;
+  .title {
+    padding: 10px;
+    text-align: center;
+    font-size: 20px;
+    font-weight: bold;
+  }
+  .wrap {
+    margin: 10px;
+    padding: 10px 20px;
+    border: 1px solid #dcdee2;
+    border-radius: 5px;
+  }
+  .row {
+    margin-bottom: 10px;
+    display: flex;
+    justify-content: space-between;
+    align-items: flex-start;
+    &:last-child {
+      margin-bottom: 0;
+    }
+    .col {
+      margin-right: 5px;
+      flex: 1;
+      display: flex;
+      align-items: flex-start;
+      .label {
+        width: 70px;
+      }
+      .value {
+        width:calc(100% - 70px);
+      }
+    }
+  }
+}
+.print-wrap {
+  width: 100vw;
+  height: 100vh;
+  display: none;
+  img {
+    width: 50%;
+  }
+}
+/deep/ .ivu-modal-body {
+  padding: 0;
+  max-height: 80vh;
+  overflow: auto;
+  border-radius: 20px 20px 0 0;
+}
+/deep/ .ivu-upload-list {
+  display: none;
+}
+/deep/ .tip-item {
+  &:hover {
+    background: #eeeeee;
+  }
+}
+</style>

+ 581 - 0
src/views/my-modal.vue

@@ -0,0 +1,581 @@
+<template>
+	<modal v-model="modal" class-name="vertical-center-modal" width="1000px">
+		<div class="content">
+			<div class="title">批次管理</div>
+			<div class="row">
+				<div class="col">
+					<div class="label">批次号:</div>
+					<div class="value">{{ data.batchNo }}</div>
+				</div>
+				<div class="col">
+					<div class="label">件数:</div>
+					<div class="value">{{ tableData.tagCount }}</div>
+				</div>
+				<div class="col">
+					<div class="label">数量:</div>
+					<div class="value">{{ tableData.totalQty }}</div>
+				</div>
+			</div>
+			<div class="row">
+				<div class="col">
+					<div class="label">出货状态:</div>
+					<div class="value">{{ tableData.purBatchShipStatus }}</div>
+				</div>
+				<div class="col"></div>
+				<div class="col"></div>
+			</div>
+			<div class="table">
+				<my-table
+					ref="table"
+					:data="tableData.qrCodeItems"
+					:columns="isSupplier ? columns : columns2"
+					:table-filter="tableFilter"
+					selectKey="id"
+					:table-page="params"
+					height="300"
+					@event-handle="eventHandle"
+					@on-select="getSelect"
+					@on-change="changePage"
+				>
+				</my-table>
+			</div>
+		</div>
+		<div class="footer" slot="footer">
+			<Button @click="cancel" class="btn" type="primary">关闭</Button>
+		</div>
+	</modal>
+</template>
+
+<script>
+import { GetSupplierQRCode,PlcStorageIn } from '@/api/integrated'
+import MyTable from '@/components/my-table/my-table'
+import { logOut } from '@/libs/util'
+export default {
+	name: 'my-modal',
+	data() {
+		return {
+			isSupplier: false,
+			rfid: '',
+			connection: null,
+			sourceExpressList: [],
+			expressList: [],
+			tipShow: false,
+			importFileName: '',
+			importData: [],
+			uploadFile: null,
+			stockTagIds: [], // 表格勾选的id
+			printList: [], // 打印数据
+			tableData: {},
+			formData: {},
+			shipmentCarNo: '',
+			shipmentPhone: '',
+			shipmentName: '',
+			shipmentType: '0',
+			shipmentExpress: '',
+			shipmentOrderNo: '',
+			shipmentRemark: '',
+			addQrInputNum: '',
+			addQrInputWidth: '',
+			addQrType: '', // add单个添加 dispatch批量添加
+			show: false, // 合同信息
+			addShow: false, // 添加二维码
+			importShow: false, // 导入码单
+			shipmentShow: false, // 出货
+			bindShow: false,
+			modal: false,
+			columns: [
+				{
+					type: 'selection',
+					width: 60,
+					align: 'center',
+				},
+				{
+					title: '二维码编码',
+					key: 'number',
+					width: 100,
+					align: 'center',
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 200,
+				},
+				{
+					title: '物料数量',
+					key: 'quantity',
+					minWidth: 150,
+				},
+				{
+					title: '生成时间',
+					key: 'createdTime',
+					minWidth: 150,
+				},
+				{
+					title: '打印状态',
+					key: 'hadPrinter',
+					minWidth: 120,
+					align: 'center',
+					fixed: 'right',
+					render: (h, params) => {
+						return h(
+							'span',
+							params.row.hadPrinter ? '已打印' : '未打印'
+						)
+					},
+					renderHeader: (h, params) => {
+						let _this = this
+						return h('div', [
+							h('span', '打印状态'),
+							_this.$createElement(
+								'Poptip',
+								{
+									ref: 'filter-tip',
+									props: {
+										transfer: true,
+									},
+								},
+								[
+									h('Icon', {
+										props: {
+											type: 'ios-funnel',
+										},
+										style: {
+											padding: '0 2px',
+										},
+									}),
+									_this.$createElement(
+										'div',
+										{
+											slot: 'content',
+										},
+										[
+											h(
+												'div',
+												{
+													class: 'tip-item',
+													style: {
+														padding: '10px',
+														textAlign: 'center',
+														cursor: 'pointer',
+														borderBottom:
+															'1px solid #eee',
+													},
+													on: {
+														click() {
+															_this.$refs[
+																'filter-tip'
+															].cancel()
+															_this.params.hadPrinter =
+																''
+															_this.getSupplierQRCode()
+														},
+													},
+												},
+												'全部'
+											),
+											h(
+												'div',
+												{
+													class: 'tip-item',
+													style: {
+														padding: '10px',
+														textAlign: 'center',
+														cursor: 'pointer',
+														borderBottom:
+															'1px solid #eee',
+													},
+													on: {
+														click() {
+															_this.$refs[
+																'filter-tip'
+															].cancel()
+															_this.params.hadPrinter = false
+															_this.getSupplierQRCode()
+														},
+													},
+												},
+												'未打印'
+											),
+											h(
+												'div',
+												{
+													class: 'tip-item',
+													style: {
+														textAlign: 'center',
+														cursor: 'pointer',
+														padding: '10px',
+													},
+													on: {
+														click() {
+															_this.$refs[
+																'filter-tip'
+															].cancel()
+															_this.params.hadPrinter = true
+															_this.getSupplierQRCode()
+														},
+													},
+												},
+												'已打印'
+											),
+										]
+									),
+								]
+							),
+						])
+					},
+				},
+			],
+			columns2: [
+				{
+					title: '二维码编码',
+					key: 'number',
+					width: 100,
+					align: 'center',
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '数量',
+					key: 'quantity',
+					minWidth: 100,
+				},
+				{
+					title: 'RFID标签值',
+					key: 'rfidCode',
+					minWidth: 150,
+				},
+				{
+					title: '生成时间',
+					key: 'createdTime',
+					minWidth: 150,
+				},
+				{
+					title: '操作',
+					minWidth: 120,
+					fixed: 'right',
+					align: 'center',
+					render: (h, params) => {
+						let _this = this
+						if (!params.row.rfidCode) {
+							return h('div', [
+								h(
+									'Button',
+									{
+										props: {
+											type: 'primary',
+										},
+										style: {
+											width: '80px',
+										},
+										on: {
+											click(e) {
+												e.stopPropagation()
+												if (
+													localStorage.getItem('ip')
+												) {
+													_this.formData = {
+														..._this.data,
+														...params.row,
+													}
+													_this.bindShow = true
+													_this.connection.invoke(
+														'BindTagBeginScanf',
+														localStorage.getItem(
+															'ip'
+														)
+													)
+												} else {
+													_this.$Message.error(
+														'请先配置ip地址'
+													)
+												}
+											},
+										},
+									},
+									'绑定RFID'
+								),
+							])
+						} else {
+							return h('span', '已绑定')
+						}
+					},
+				},
+			],
+			tableFilter: [
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '一键入库',
+					e: 'shipment',
+					align: 'right',
+				},
+			],
+			params: {
+				pageIndex: 1,
+				pageSize: 20,
+				total: 0,
+			},
+		}
+	},
+	components: {
+		MyTable,
+	},
+	props: {
+		data: {
+			type: Object,
+			default() {
+				return {}
+			},
+		},
+		value: {
+			type: Boolean,
+			default: false,
+			require: true,
+		},
+	},
+	watch: {
+		value: {
+			handler(n) {
+				this.modal = n
+			},
+			immediate: true,
+		},
+		modal(n) {
+			this.$emit('input', n)
+			if (n) {
+				this.getSupplierQRCode()
+			} else {
+			}
+		},
+	},
+	methods: {
+		/* 移出文件 */
+		importCancel() {
+			this.importFileName = ''
+			this.importData = []
+			this.importShow = false
+		},
+		getSelect(data) {
+			console.log('table----data')
+			console.log(data)
+			this.printList = []
+			this.printList = [...data]
+			// this.stockTagIds = data.filter(item => !item.hadPrinter).map(item => item.id)
+			// this.stockTagIds = data.map(item => item.id)
+		},
+		changePage(pageIndex) {
+			this.params.pageIndex = pageIndex
+			this.getSupplierQRCode()
+		},
+		// 获取物料列表
+		getSupplierQRCode() {
+			this.rfid = ''
+			GetSupplierQRCode({
+				...this.params,
+				batchNo: this.data.batchNo,
+				purchaseBillNo: this.data.purchaseBillNo,
+			}).then((res) => {
+				if (res.code === 0) {
+					this.printList = []
+					this.tableData = {}
+					this.$refs.table.tempList = []
+					this.tableData = res.result
+					this.params.total = res.result.tagCount
+				}
+			})
+		},
+		// 检索条件事件处理
+		eventHandle(option) {
+			switch (option._evnet) {
+				case 'addQr':
+					this.addQrType = 'add'
+					this.addShow = true
+					break
+				case 'addDispath':
+					this.addQrType = 'dispatch'
+					this.addShow = true
+					break
+				case 'shipment':
+					GetSupplierQRCode({
+						pageIndex: 1,
+						pageSize: 200000,
+						batchNo: this.data.batchNo,
+						purchaseBillNo: this.data.purchaseBillNo,
+					}).then((res) => {
+						if (res.code === 0) {
+							console.log(res.result.qrCodeItems)
+							PlcStorageIn({
+								storageDoor: sessionStorage.getItem('door'),
+								plcStationCode:
+									sessionStorage.getItem('plcCode'),
+								rfidList: res.result.qrCodeItems.map(
+									(item) => item.rfidCode
+								),
+								remark: '一键入库',
+							}).then((res) => {
+								if (res.code === 0) {
+									this.$Message.info('入库成功!')
+									logOut()
+								}
+							})
+						}
+					})
+					break
+				case 'del':
+					if (this.printList.length === 0) {
+						return this.$Message.error('请选择数据!')
+					}
+					this.$MyModal
+						.show({ text: '是否删除?' })
+						.$on('confirm', () => {
+							DeleteSupplierQRCode({
+								stockTagIds: this.printList.map(
+									(item) => item.id
+								),
+							}).then((res) => {
+								if (res.code === 0) {
+									this.$Message.info(
+										'申请已提交,待客户确认后生效'
+									)
+									this.printList = []
+									this.$refs.table.clearTempList()
+									this.getSupplierQRCode()
+									this.approvalHandle()
+								}
+							})
+						})
+					break
+				case 'print':
+					this.print()
+					break
+				case 'importExcel':
+					this.importShow = true
+					break
+				case 'over':
+					if (this.printList.length === 0) {
+						return this.$Message.error('请选择数据!')
+					}
+					CompletePurchase()
+					break
+			}
+		},
+		cancel() {
+			this.stockTagIds = []
+			this.printList = []
+			this.modal = false
+		},
+		beforeUpdate() {},
+	},
+}
+</script>
+
+<style lang="scss" scoped>
+.content {
+	overflow: hidden;
+	padding: 20px 40px;
+	font-size: 14px;
+	.title {
+		padding-bottom: 20px;
+		font-size: 20px;
+		font-weight: bold;
+		text-align: center;
+	}
+	.row {
+		padding-bottom: 10px;
+		display: flex;
+		justify-content: space-between;
+		align-items: flex-start;
+		.col {
+			flex: 1;
+			display: flex;
+			align-items: flex-start;
+			.label {
+			}
+			.value {
+				flex: 1;
+			}
+		}
+	}
+	.text {
+		padding: 10px 0;
+	}
+	.table {
+		//height: ~"calc(100% - 100px)";
+		overflow: auto;
+		margin: 10px 0;
+		padding: 10px;
+		border: 1px solid #dcdee2;
+	}
+}
+.sub-content {
+	padding: 0 20px;
+	.title {
+		padding: 10px;
+		text-align: center;
+		font-size: 20px;
+		font-weight: bold;
+	}
+	.wrap {
+		margin: 10px;
+		padding: 10px 20px;
+		border: 1px solid #dcdee2;
+		border-radius: 5px;
+	}
+	.row {
+		margin-bottom: 10px;
+		display: flex;
+		justify-content: space-between;
+		align-items: flex-start;
+		&:last-child {
+			margin-bottom: 0;
+		}
+		.col {
+			margin-right: 5px;
+			flex: 1;
+			display: flex;
+			align-items: flex-start;
+			.label {
+				width: 70px;
+			}
+			.value {
+				width: calc(100% - 70px);
+			}
+		}
+	}
+}
+.print-wrap {
+	width: 100vw;
+	height: 100vh;
+	display: none;
+	img {
+		width: 50%;
+	}
+}
+/deep/ .ivu-modal-body {
+	padding: 0;
+	max-height: 80vh;
+	overflow: auto;
+	border-radius: 20px 20px 0 0;
+}
+/deep/ .ivu-upload-list {
+	display: none;
+}
+/deep/ .tip-item {
+	&:hover {
+		background: #eeeeee;
+	}
+}
+</style>

+ 560 - 0
src/views/store-in - 副本 (2).vue

@@ -0,0 +1,560 @@
+<template>
+<div class="container">
+  <my-nav @listener-in="inHandle" @listener-helper="helperHandle"></my-nav>
+  <div class="content">
+    <div class="reading" v-if="reading">
+      入库扫描中<br/>
+      请将需要入库的物料推入感应门
+    </div>
+    <div v-else style="height: 100%">
+      <div style="display: flex;justify-content: space-between;align-items: center">
+        <div style="width: 108px"></div>
+        <div class="title">入库扫描</div>
+        <div style="padding: 0 10px">
+          <Button type="primary" @click="scanShow=true">辅助扫描</Button>
+        </div>
+      </div>
+      <div class="main">
+        <div class="list-wrap">
+          <div class="list" style="margin-right: 20px;">
+            <div class="sub-title">已贴标物料</div>
+            <div style="height: calc(100% - 46px);overflow: auto">
+              <div class="row" v-for="(item, index) in data" :key="index">
+                <div class="col" style="width: 50px;align-items: center;">
+                  <Icon type="ios-checkmark-circle" color="red" size="18" v-if="item.checked"/>
+                </div>
+                <div class="col" style="flex: 1">
+                  <div>{{ item.materialName }}</div>
+                  <div>物料长度:{{ item.quantity }}米</div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="list">
+            <div class="sub-title">本次入库</div>
+            <div style="height: calc(100% - 46px);overflow: auto">
+              <div class="row" v-for="(item, index) in scanData.rfidTagItems" :key="index">
+                <div class="col" style="width: 50px;align-items: center;"></div>
+                <div class="col" style="flex: 1"  :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                  <div>{{ item.materialName }}</div>
+                  <div>物料长度:{{ item.quantity || 0 }}米</div>
+                </div>
+                <div class="col" style="flex: 1"  :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                  <div>标签值:{{ item.rfidCode }}</div>
+                </div>
+                <div class="col" style="width: 50px;">
+                  <Icon type="ios-trash" size="20" color="red" @click="del(item, index)" style="cursor: pointer"/>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="list-wrap bottom">
+          <div class="list">
+            <div class="sub-title">
+              本次统计
+              <a class="remark" href="#" @click="show = true">填写备注</a>
+            </div>
+            <div style="height: calc(100% - 46px);overflow: auto">
+              <div class="row"
+                   v-for="(item, index) in materialItemsCopy"
+                   :key="index">
+                <div class="col" style="flex: 3;" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                  <div>{{ item.materialName }}</div>
+                </div>
+                <div class="col" style="flex: 2" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                  <div>入库件数:{{ item.tagCount }}</div>
+                </div>
+                <div class="col" style="flex: 2" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                  <div>入库数量:{{ item.quantity }}米</div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="footer">
+        <Button type="error" size="large" style="margin-right: 20px" @click="pass(0)">重新扫描</Button>
+        <Button type="success" size="large" @click="pass(1)">确认无误</Button>
+      </div>
+    </div>
+  </div>
+  <div class="remark-content">
+    <Modal
+        v-model="modal"
+        :mask-closable="false"
+        :closable="false"
+        :fullscreen="true"
+        :footer-hide="true"
+        >
+      <Progress :percent="percent" :stroke-color="['#108ee9', '#87d068']" :hide-info="true" style="width: 400px"/>
+    </Modal>
+  </div>
+  <!-- 填写备注 -->
+  <Modal
+      v-model="show"
+      :closable="false"
+      :footer-hide="true"
+      class-name="vertical-center-modal"
+      @on-cancel="cancel"
+     >
+    <div class="remark-content">
+      <div class="title">填写备注</div>
+      <Input v-model="remark" type="textarea" :rows="10"/>
+      <div class="btn">
+        <Button @click="cfm" type="success" style="width: 120px">确定</Button>
+      </div>
+    </div>
+  </Modal>
+  <!-- 辅助扫描 -->
+  <Modal
+      v-model="scanShow"
+      class-name="vertical-center-modal"
+      @on-cancel="cancel"
+  >
+    <div class="scan-title" slot="header">辅助扫描</div>
+    <div class="scan-btn" slot="footer">
+      <Button type="primary" style="width: 80px" @click="scanShow = false">关闭</Button>
+    </div>
+    <div class="scan-content" v-if="otherData.length > 0">
+      <div class="item" v-for="(item, index) in otherData" :key="index">
+        <div class="left">
+          <div class="row">RFID标签:{{ item.rfidCode }}</div>
+          <div class="row">物料编码:{{ item.materialCode }}</div>
+          <div class="row">物料名称:{{ item.materialName }}</div>
+          <div class="row">最近操作:{{ item.lastOpera }}</div>
+        </div>
+        <div class="right">
+          <Button type="primary" ghost @click="add(item)" v-if="item.lastOpera.indexOf('入库') === -1">入库</Button>
+        </div>
+      </div>
+    </div>
+    <div v-else style="padding: 10px 0;color: #FFFFFF">暂无数据</div>
+
+  </Modal>
+</div>
+</template>
+
+<script>
+import MyNav from '@/components/my-nav'
+import * as signalR from '@microsoft/signalr'
+import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'
+import withUrl from '@/config/withUrl'
+import {GetHasTagMaterialList, PlcStorageIn, ReScan, GetScanRfidStocInOut, DelScanRfid} from '@/api/integrated'
+import store from "@/store";
+import {logOut} from "@/libs/util";
+export default {
+  name: "store-in",
+  data() {
+    return {
+      scanShow: false,
+      show: false,
+      modal: false,
+      percent: 0,
+      addTimer: null,
+      overTimer: null,
+      reading: false,
+      connection: null,
+      data: [], // 左侧数据列表
+      scanData: {}, // 扫描数据
+      otherData: [], // 扫描辅助数据
+      tempDelData: [], // 临时删除列表
+      remark: '',
+      materialItemsCopy:[],
+    }
+  },
+  components: {
+    MyNav
+  },
+  methods: {
+    add (item) {
+      item.totalQuantity = item.qty
+      item.quantity = item.qty
+      // 辅助扫描的添加一个isTemp 标识以供删除区分
+      if (this.scanData.rfidTagItems.find(scan => scan.materialCode === item.materialCode)) {
+        this.$Message.error('物料已添加')
+      } else {
+        this.scanData.rfidTagItems.push({...item, isTemp: true})
+        this.scanData.materialItems.push({...item, isTemp: true})
+        this.$Message.info('添加成功')
+      }
+    },
+    cancel () {
+      this.remark = ''
+    },
+    cfm () {
+      this.show = false
+    },
+    /* 临时删除 */
+    del (item, index) {
+      if (item.isTemp) {
+        this.scanData.rfidTagItems.splice(index, 1)
+        this.scanData.materialItems.splice(index, 1)
+        /* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
+        this.tempDelData.push(item)
+      } else {
+        DelScanRfid({
+          rfid: item.rfidCode,
+          plcStationCode: sessionStorage.getItem('plcCode')
+        }).then(res => {
+          if (res.code === 0) {
+            this.$Message.info('删除成功!')
+            this.tempDelData.push(item)
+            this.getScanList()
+          }
+        })
+      }
+    },
+    /* 辅助扫描通知 */
+    helperHandle (data) {
+      this.otherData = data
+    },
+    /* 入库通知 */
+    inHandle() {
+      this.getScanList()
+      clearTimeout(this.overTimer)
+      this.overTimer = setTimeout(() => {
+        clearInterval(this.addTimer)
+        this.percent = 100
+        setTimeout(() => {
+          this.modal = false
+        }, 500)
+      }, 3000)
+    },
+    /* 是否通过 0否 1是 */
+    pass(type) {
+      if (type === 0) {
+        this.$Message.info('请重新扫描入库!')
+        this.scanData.rfidTagItems = []
+        this.scanData.materialItems = []
+        this.materialItemsCopy = []
+        ReScan({
+          reScanType: 0,
+          storageType: sessionStorage.getItem('plcCode'),
+          storageDoor: sessionStorage.getItem('door')
+        })
+      } else if (type === 1) {
+        // 入库
+        PlcStorageIn({
+          storageDoor: sessionStorage.getItem('door'),
+          plcStationCode: sessionStorage.getItem('plcCode'),
+          rfidList: this.scanData.rfidTagItems.map(item => item.rfidCode),
+          remark: this.remark
+        }).then(res => {
+          if (res.code === 0) {
+            this.$Message.info('入库成功!')
+            logOut()
+            // this.$store.commit('setHasGetInfo', false)
+            // this.$store.commit('setToken', '')
+            // setTimeout(() => {
+            //   this.$router.push({
+            //     name: 'Home',
+            //     query: {
+            //       plcCode: sessionStorage.getItem('plcCode'),
+            //       door: sessionStorage.getItem('door')
+            //     }
+            //   })
+            // }, 500)
+          }
+        })
+      }
+    },
+    getList() {
+      /* 获取已贴标数据 */
+      GetHasTagMaterialList().then(res => {
+        if (res.code === 0) {
+          this.data = res.result
+        }
+      })
+    },
+    unique(arr, val) {
+      const res = new Map()
+      return arr.filter((item) => !res.has(item[val]) && res.set(item[val], 1))
+    },
+    getScanList () {
+      GetScanRfidStocInOut({
+        storagePlcCode: sessionStorage.getItem('plcCode'),
+        stockInOutScanType: 0
+      }).then(scanRes => {
+        if (scanRes.code === 0) {
+          this.reading = false
+          this.scanData = scanRes.result
+          /* 临时删除的数据不可再添加到出入库列表中 */
+          this.tempDelData.forEach(temp => {
+
+            for (const index in this.scanData.rfidTagItems) {
+              
+              if (temp.materialCode === this.scanData.rfidTagItems[index].materialCode) {
+                this.scanData.rfidTagItems.splice(index, 1)
+              }
+            }
+            for (const index in this.scanData.materialItems) {
+              if (temp.materialCode === this.scanData.materialItems[index].materialCode) {
+                this.scanData.materialItems.splice(index, 1)
+              }
+            }
+          })
+          this.materialItemsCopy = []
+					for (let i = 0; i < this.scanData.rfidTagItems.length; i++) {
+						const element = this.scanData.rfidTagItems[i];
+						console.log(this.materialItemsCopy,12312312)
+						if(this.materialItemsCopy.length == 0){
+							this.materialItemsCopy.push({...element,tagCount:1})
+						}else{
+							var isTotal = false
+							
+							for (let j = 0; j < this.materialItemsCopy.length; j++) {
+								const jelement = this.materialItemsCopy[j];
+								if(element.materialCode === jelement.materialCode){
+									isTotal = true
+									jelement.tagCount++
+									jelement.quantity += element.quantity
+									
+								}
+							}
+							if(!isTotal) this.materialItemsCopy.push({...element,tagCount:1})
+						}
+						
+					}
+          this.data.forEach(item => {
+            this.scanData.rfidTagItems.forEach(scan => {
+              if (item.rfidCode === scan.rfidCode) {
+                item.checked = true
+              }
+            })
+          })
+        }
+      })
+    }
+  },
+  mounted() {
+    this.tempDelData = []
+    this.getList()
+    this.getScanList()
+    this.addTimer = setInterval(() => {
+      this.percent += 1
+      if (this.percent === 100) {
+        clearInterval(this.addTimer)
+        clearTimeout(this.overTimer)
+        this.modal = false
+      }
+    }, 100)
+    this.overTimer = setTimeout(() => {
+      clearInterval(this.addTimer)
+      this.percent = 100
+      setTimeout(() => {
+        this.modal = false
+      }, 500)
+    }, 3000)
+  },
+  destroyed() {
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .container {
+    width: 100vw;
+    height: 100vh;
+    overflow: auto;
+    //background: rgba(2, 125, 180, 1);
+    background-image: linear-gradient(270deg,
+        #2c3034 0%,
+        #50575e 49%,
+        #2c3034 100%);
+    .content {
+      margin: 10px;
+      height: calc(100% - 121.6px);
+      overflow: hidden;
+      box-sizing: border-box;
+      //background: rgba(1, 84, 120, 1);
+      border-radius: 10px;
+      .reading {
+        height: 100%;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-size: 36px;
+        font-weight: bold;
+        color: #00FFFF;
+      }
+      .title {
+        padding-bottom: 10px;
+        text-align: center;
+        font-size: 36px;
+        font-weight: bold;
+        color: #2dc57c;
+      }
+      .main {
+        height: calc(100% - 113.6px);
+        display: flex;
+        flex-direction: column;
+        .list-wrap {
+          flex: 2;
+          overflow: hidden;
+          padding: 0 10px;
+          width: 100%;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          .list {
+            position: relative;
+            //padding: 0 10px;
+            flex: 1;
+            height: 100%;
+            overflow: hidden;
+            //background: rgba(2, 125, 180, 0.486274509803922);
+            background: #2c3034;
+            border-radius: 4px;
+            border: solid 1px #3879e7;
+            .sub-title {
+              position: relative;
+              padding: 5px 0;
+              font-size: 24px;
+              color: #0077ff;
+              font-weight: bold;
+              .remark {
+                position: absolute;
+                right: 10px;
+                top: 50%;
+                transform: translateY(-50%);
+                font-size: 16px;
+                font-weight: normal;
+                color: #0077ff;
+              }
+            }
+            .row {
+              padding: 5px 0;
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+              //background: rgba(2, 167, 240, 1);
+              border-top: 1px solid #2655ad;
+              //border-radius: 5px;
+              &:last-child {
+                border-bottom: 1px solid #2655ad;
+              }
+              .col {
+                padding: 0 5px;
+                display: flex;
+                flex-direction: column;
+                align-items: flex-start;
+                justify-content: center;
+                text-align: left;
+                color: #ffffff;
+              }
+            }
+            .total {
+              padding: 5px 10px;
+              //position: absolute;
+              left: 0;
+              bottom: 0;
+              text-align: left;
+              font-size: 20px;
+              font-weight: bold;
+              color: #F59A23;
+              .top {
+                font-size: 24px;
+              }
+              .label {
+                margin-left: 40px  ;
+                display: inline-block;
+                width: 100px;
+              }
+            }
+          }
+        }
+        .bottom {
+          margin-top: 20px;
+          flex: 1;
+          .row {
+            border: none !important;
+          }
+          .col {
+            padding: 0 20px !important;
+          }
+        }
+      }
+      .footer {
+        padding: 10px 0;
+        padding-bottom: 0;
+        /deep/ .ivu-btn-large {
+          border-radius: 20px;
+          font-weight: bold;
+          width: 150px;
+        }
+      }
+    }
+  }
+  /deep/.ivu-modal-content {
+    background: #2c3034;
+  }
+  /deep/.ivu-modal-body {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 0;
+  }
+  /deep/.remark-content {
+    padding: 16px;
+    width: 100%;
+    .title {
+      font-size: 24px;
+      font-weight: bold;
+      text-align: center;
+      color: #FFFFFF;
+      padding-bottom: 10px;
+    }
+    .btn {
+      text-align: center;
+      padding-top: 10px;
+    }
+  }
+  /deep/ .ivu-modal-header {
+    border-bottom: none;
+  }
+  /deep/ .ivu-modal-footer {
+    border-top: none;
+  }
+  .scan-title {
+    font-size: 18px;
+    font-weight: bold;
+    color: #FFFFFF;
+  }
+  .scan-btn {
+    text-align: center;
+  }
+  .scan-content {
+    padding: 10px 16px;
+    width: 100%;
+    max-height: 40vh;
+    overflow: auto;
+    background-color: #3D3D3D;
+    color: #FFFFFF;
+    .item {
+      margin-bottom: 5px;
+      border-bottom: 1px solid #FFFFFF;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      &:last-child {
+        margin-bottom: 0;
+        border-bottom: none;
+      }
+      .left {
+        flex: 1;
+        overflow: hidden;
+      }
+      .right {
+        width: 60px;
+        /deep/ .ivu-btn-primary {
+          background-color: rgb(204, 228, 255);
+        }
+      }
+      .row {
+        margin-bottom: 5px;
+        word-break: break-all;
+      }
+    }
+  }
+</style>

+ 534 - 0
src/views/store-in - 副本.vue

@@ -0,0 +1,534 @@
+<template>
+  <div class="container">
+    <my-nav @listener-in="inHandle" @listener-helper="helperHandle"></my-nav>
+    <div class="content">
+      <div class="reading" v-if="reading">
+        入库扫描中<br/>
+        请将需要入库的物料推入感应门
+      </div>
+      <div v-else style="height: 100%">
+        <div style="display: flex;justify-content: space-between;align-items: center">
+          <div style="width: 108px"></div>
+          <div class="title">入库扫描</div>
+          <div style="padding: 0 10px">
+            <Button type="primary" @click="scanShow=true">辅助扫描</Button>
+          </div>
+        </div>
+        <div class="main">
+          <div class="list-wrap">
+            <div class="list" style="margin-right: 20px;">
+              <div class="sub-title">已贴标物料</div>
+              <div style="height: calc(100% - 46px);overflow: auto">
+                <div class="row" v-for="(item, index) in data" :key="index">
+                  <div class="col" style="width: 50px;align-items: center;">
+                    <Icon type="ios-checkmark-circle" color="red" size="18" v-if="item.checked"/>
+                  </div>
+                  <div class="col" style="flex: 1">
+                    <div>{{ item.materialName }}</div>
+                    <div>物料长度:{{ item.quantity }}米</div>
+                  </div>
+                </div>
+              </div>
+            </div>
+            <div class="list">
+              <div class="sub-title">本次入库</div>
+              <div style="height: calc(100% - 46px);overflow: auto">
+                <div class="row" v-for="(item, index) in scanData.rfidTagItems" :key="index">
+                  <div class="col" style="width: 50px;align-items: center;"></div>
+                  <div class="col" style="flex: 1"  :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                    <div>{{ item.materialName }}</div>
+                    <div>物料长度:{{ item.quantity || 0 }}米</div>
+                  </div>
+                  <div class="col" style="flex: 1"  :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                    <div>标签值:{{ item.rfidCode }}</div>
+                  </div>
+                  <div class="col" style="width: 50px;">
+                    <Icon type="ios-trash" size="20" color="red" @click="del(item, index)" style="cursor: pointer"/>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="list-wrap bottom">
+            <div class="list">
+              <div class="sub-title">
+                本次统计
+                <a class="remark" href="#" @click="show = true">填写备注</a>
+              </div>
+              <div style="height: calc(100% - 46px);overflow: auto">
+                <div class="row"
+                     v-for="(item, index) in scanData.materialItems"
+                     :key="index">
+                  <div class="col" style="flex: 3;" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                    <div>{{ item.materialName }}</div>
+                  </div>
+                  <div class="col" style="flex: 2" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                    <div>入库件数:{{ item.tagCount }}</div>
+                  </div>
+                  <div class="col" style="flex: 2" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
+                    <div>入库数量:{{ item.totalQuantity }}米</div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="footer">
+          <Button type="error" size="large" style="margin-right: 20px" @click="pass(0)">重新扫描</Button>
+          <Button type="success" size="large" @click="pass(1)">确认无误</Button>
+        </div>
+      </div>
+    </div>
+    <div class="remark-content">
+      <Modal
+          v-model="modal"
+          :mask-closable="false"
+          :closable="false"
+          :fullscreen="true"
+          :footer-hide="true"
+          >
+        <Progress :percent="percent" :stroke-color="['#108ee9', '#87d068']" :hide-info="true" style="width: 400px"/>
+      </Modal>
+    </div>
+    <!-- 填写备注 -->
+    <Modal
+        v-model="show"
+        :closable="false"
+        :footer-hide="true"
+        class-name="vertical-center-modal"
+        @on-cancel="cancel"
+       >
+      <div class="remark-content">
+        <div class="title">填写备注</div>
+        <Input v-model="remark" type="textarea" :rows="10"/>
+        <div class="btn">
+          <Button @click="cfm" type="success" style="width: 120px">确定</Button>
+        </div>
+      </div>
+    </Modal>
+    <!-- 辅助扫描 -->
+    <Modal
+        v-model="scanShow"
+        class-name="vertical-center-modal"
+        @on-cancel="cancel"
+    >
+      <div class="scan-title" slot="header">辅助扫描</div>
+      <div class="scan-btn" slot="footer">
+        <Button type="primary" style="width: 80px" @click="scanShow = false">关闭</Button>
+      </div>
+      <div class="scan-content" v-if="otherData.length > 0">
+        <div class="item" v-for="(item, index) in otherData" :key="index">
+          <div class="left">
+            <div class="row">RFID标签:{{ item.rfidCode }}</div>
+            <div class="row">物料编码:{{ item.materialCode }}</div>
+            <div class="row">物料名称:{{ item.materialName }}</div>
+            <div class="row">最近操作:{{ item.lastOpera }}</div>
+          </div>
+          <div class="right">
+            <Button type="primary" ghost @click="add(item)" v-if="item.lastOpera.indexOf('入库') === -1">入库</Button>
+          </div>
+        </div>
+      </div>
+      <div v-else style="padding: 10px 0;color: #FFFFFF">暂无数据</div>
+  
+    </Modal>
+  </div>
+  </template>
+  
+  <script>
+  import MyNav from '@/components/my-nav'
+  import * as signalR from '@microsoft/signalr'
+  import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'
+  import withUrl from '@/config/withUrl'
+  import {GetHasTagMaterialList, PlcStorageIn, ReScan, GetScanRfidStocInOut, DelScanRfid} from '@/api/integrated'
+  import store from "@/store";
+  import {logOut} from "@/libs/util";
+  export default {
+    name: "store-in",
+    data() {
+      return {
+        scanShow: false,
+        show: false,
+        modal: false,
+        percent: 0,
+        addTimer: null,
+        overTimer: null,
+        reading: false,
+        connection: null,
+        data: [], // 左侧数据列表
+        scanData: {
+          rfidTagItems:[],
+          materialItems:[],
+        }, // 扫描数据
+        otherData: [], // 扫描辅助数据
+        tempDelData: [], // 临时删除列表
+        remark: ''
+      }
+    },
+    components: {
+      MyNav
+    },
+    methods: {
+      add (item) {
+        item.totalQuantity = item.qty
+        item.quantity = item.qty
+        // 辅助扫描的添加一个isTemp 标识以供删除区分
+        if (this.scanData.rfidTagItems.find(scan => scan.materialCode === item.materialCode)) {
+          this.$Message.error('物料已添加')
+        } else {
+          this.scanData.rfidTagItems.push({...item, isTemp: true})
+          this.scanData.materialItems.push({...item, isTemp: true})
+          this.$Message.info('添加成功')
+        }
+      },
+      cancel () {
+        this.remark = ''
+      },
+      cfm () {
+        this.show = false
+      },
+      /* 临时删除 */
+      del (item, index) {
+        if (item.isTemp) {
+          this.scanData.rfidTagItems.splice(index, 1)
+          this.scanData.materialItems.splice(index, 1)
+          /* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
+          this.tempDelData.push(item)
+        } else {
+          DelScanRfid({
+            rfid: item.rfidCode,
+            plcStationCode: sessionStorage.getItem('plcCode')
+          }).then(res => {
+            if (res.code === 0) {
+              this.$Message.info('删除成功!')
+              this.tempDelData.push(item)
+              this.getScanList()
+            }
+          })
+        }
+      },
+      /* 辅助扫描通知 */
+      helperHandle (data) {
+        this.otherData = data
+      },
+      /* 入库通知 */
+      inHandle() {
+        this.getScanList()
+        clearTimeout(this.overTimer)
+        this.overTimer = setTimeout(() => {
+          clearInterval(this.addTimer)
+          this.percent = 100
+          setTimeout(() => {
+            this.modal = false
+          }, 500)
+        }, 3000)
+      },
+      /* 是否通过 0否 1是 */
+      pass(type) {
+        if (type === 0) {
+          this.$Message.info('请重新扫描入库!')
+          this.scanData.rfidTagItems = []
+          this.scanData.materialItems = []
+          ReScan({
+            reScanType: 0,
+            storageType: sessionStorage.getItem('plcCode'),
+            storageDoor: sessionStorage.getItem('door')
+          })
+        } else if (type === 1) {
+          // 入库
+          PlcStorageIn({
+            storageDoor: sessionStorage.getItem('door'),
+            plcStationCode: sessionStorage.getItem('plcCode'),
+            rfidList: this.scanData.rfidTagItems.map(item => item.rfidCode),
+            remark: this.remark
+          }).then(res => {
+            if (res.code === 0) {
+              this.$Message.info('入库成功!')
+              logOut()
+              // this.$store.commit('setHasGetInfo', false)
+              // this.$store.commit('setToken', '')
+              // setTimeout(() => {
+              //   this.$router.push({
+              //     name: 'Home',
+              //     query: {
+              //       plcCode: sessionStorage.getItem('plcCode'),
+              //       door: sessionStorage.getItem('door')
+              //     }
+              //   })
+              // }, 500)
+            }
+          })
+        }
+      },
+      getList() {
+        /* 获取已贴标数据 */
+        GetHasTagMaterialList().then(res => {
+          if (res.code === 0) {
+            this.data = res.result
+          }
+        })
+      },
+      getScanList () {
+        GetScanRfidStocInOut({
+          storagePlcCode: sessionStorage.getItem('plcCode'),
+          stockInOutScanType: 0
+        }).then(scanRes => {
+          if (scanRes.code === 0) {
+            this.reading = false
+            this.scanData = scanRes.result
+            /* 临时删除的数据不可再添加到出入库列表中 */
+            this.tempDelData.forEach(temp => {
+              for (const index in this.scanData.rfidTagItems) {
+                if (temp.materialCode === this.scanData.rfidTagItems[index].materialCode) {
+                  this.scanData.rfidTagItems.splice(index, 1)
+                }
+              }
+              for (const index in this.scanData.materialItems) {
+                if (temp.materialCode === this.scanData.materialItems[index].materialCode) {
+                  this.scanData.materialItems.splice(index, 1)
+                }
+              }
+            })
+            this.data.forEach(item => {
+              this.scanData.rfidTagItems.forEach(scan => {
+                if (item.rfidCode === scan.rfidCode) {
+                  item.checked = true
+                }
+              })
+            })
+          }
+        })
+      }
+    },
+    mounted() {
+      this.tempDelData = []
+      this.getList()
+      this.getScanList()
+      this.addTimer = setInterval(() => {
+        this.percent += 1
+        if (this.percent === 100) {
+          clearInterval(this.addTimer)
+          clearTimeout(this.overTimer)
+          this.modal = false
+        }
+      }, 100)
+      this.overTimer = setTimeout(() => {
+        clearInterval(this.addTimer)
+        this.percent = 100
+        setTimeout(() => {
+          this.modal = false
+        }, 500)
+      }, 3000)
+    },
+    destroyed() {
+    }
+  }
+  </script>
+  
+  <style lang="scss" scoped>
+    .container {
+      width: 100vw;
+      height: 100vh;
+      overflow: auto;
+      //background: rgba(2, 125, 180, 1);
+      background-image: linear-gradient(270deg,
+          #2c3034 0%,
+          #50575e 49%,
+          #2c3034 100%);
+      .content {
+        margin: 10px;
+        height: calc(100% - 121.6px);
+        overflow: hidden;
+        box-sizing: border-box;
+        //background: rgba(1, 84, 120, 1);
+        border-radius: 10px;
+        .reading {
+          height: 100%;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          font-size: 36px;
+          font-weight: bold;
+          color: #00FFFF;
+        }
+        .title {
+          padding-bottom: 10px;
+          text-align: center;
+          font-size: 36px;
+          font-weight: bold;
+          color: #2dc57c;
+        }
+        .main {
+          height: calc(100% - 113.6px);
+          display: flex;
+          flex-direction: column;
+          .list-wrap {
+            flex: 2;
+            overflow: hidden;
+            padding: 0 10px;
+            width: 100%;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            .list {
+              position: relative;
+              //padding: 0 10px;
+              flex: 1;
+              height: 100%;
+              overflow: hidden;
+              //background: rgba(2, 125, 180, 0.486274509803922);
+              background: #2c3034;
+              border-radius: 4px;
+              border: solid 1px #3879e7;
+              .sub-title {
+                position: relative;
+                padding: 5px 0;
+                font-size: 24px;
+                color: #0077ff;
+                font-weight: bold;
+                .remark {
+                  position: absolute;
+                  right: 10px;
+                  top: 50%;
+                  transform: translateY(-50%);
+                  font-size: 16px;
+                  font-weight: normal;
+                  color: #0077ff;
+                }
+              }
+              .row {
+                padding: 5px 0;
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+                //background: rgba(2, 167, 240, 1);
+                border-top: 1px solid #2655ad;
+                //border-radius: 5px;
+                &:last-child {
+                  border-bottom: 1px solid #2655ad;
+                }
+                .col {
+                  padding: 0 5px;
+                  display: flex;
+                  flex-direction: column;
+                  align-items: flex-start;
+                  justify-content: center;
+                  text-align: left;
+                  color: #ffffff;
+                }
+              }
+              .total {
+                padding: 5px 10px;
+                //position: absolute;
+                left: 0;
+                bottom: 0;
+                text-align: left;
+                font-size: 20px;
+                font-weight: bold;
+                color: #F59A23;
+                .top {
+                  font-size: 24px;
+                }
+                .label {
+                  margin-left: 40px  ;
+                  display: inline-block;
+                  width: 100px;
+                }
+              }
+            }
+          }
+          .bottom {
+            margin-top: 20px;
+            flex: 1;
+            .row {
+              border: none !important;
+            }
+            .col {
+              padding: 0 20px !important;
+            }
+          }
+        }
+        .footer {
+          padding: 10px 0;
+          padding-bottom: 0;
+          /deep/ .ivu-btn-large {
+            border-radius: 20px;
+            font-weight: bold;
+            width: 150px;
+          }
+        }
+      }
+    }
+    /deep/.ivu-modal-content {
+      background: #2c3034;
+    }
+    /deep/.ivu-modal-body {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      padding: 0;
+    }
+    /deep/.remark-content {
+      padding: 16px;
+      width: 100%;
+      .title {
+        font-size: 24px;
+        font-weight: bold;
+        text-align: center;
+        color: #FFFFFF;
+        padding-bottom: 10px;
+      }
+      .btn {
+        text-align: center;
+        padding-top: 10px;
+      }
+    }
+    /deep/ .ivu-modal-header {
+      border-bottom: none;
+    }
+    /deep/ .ivu-modal-footer {
+      border-top: none;
+    }
+    .scan-title {
+      font-size: 18px;
+      font-weight: bold;
+      color: #FFFFFF;
+    }
+    .scan-btn {
+      text-align: center;
+    }
+    .scan-content {
+      padding: 10px 16px;
+      width: 100%;
+      max-height: 40vh;
+      overflow: auto;
+      background-color: #3D3D3D;
+      color: #FFFFFF;
+      .item {
+        margin-bottom: 5px;
+        border-bottom: 1px solid #FFFFFF;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        &:last-child {
+          margin-bottom: 0;
+          border-bottom: none;
+        }
+        .left {
+          flex: 1;
+          overflow: hidden;
+        }
+        .right {
+          width: 60px;
+          /deep/ .ivu-btn-primary {
+            background-color: rgb(204, 228, 255);
+          }
+        }
+        .row {
+          margin-bottom: 5px;
+          word-break: break-all;
+        }
+      }
+    }
+  </style>
+  

+ 978 - 519
src/views/store-in.vue

@@ -1,530 +1,989 @@
 <template>
-<div class="container">
-  <my-nav @listener-in="inHandle" @listener-helper="helperHandle"></my-nav>
-  <div class="content">
-    <div class="reading" v-if="reading">
-      入库扫描中<br/>
-      请将需要入库的物料推入感应门
-    </div>
-    <div v-else style="height: 100%">
-      <div style="display: flex;justify-content: space-between;align-items: center">
-        <div style="width: 108px"></div>
-        <div class="title">入库扫描</div>
-        <div style="padding: 0 10px">
-          <Button type="primary" @click="scanShow=true">辅助扫描</Button>
-        </div>
-      </div>
-      <div class="main">
-        <div class="list-wrap">
-          <div class="list" style="margin-right: 20px;">
-            <div class="sub-title">已贴标物料</div>
-            <div style="height: calc(100% - 46px);overflow: auto">
-              <div class="row" v-for="(item, index) in data" :key="index">
-                <div class="col" style="width: 50px;align-items: center;">
-                  <Icon type="ios-checkmark-circle" color="red" size="18" v-if="item.checked"/>
-                </div>
-                <div class="col" style="flex: 1">
-                  <div>{{ item.materialName }}</div>
-                  <div>物料长度:{{ item.quantity }}米</div>
-                </div>
-              </div>
-            </div>
-          </div>
-          <div class="list">
-            <div class="sub-title">本次入库</div>
-            <div style="height: calc(100% - 46px);overflow: auto">
-              <div class="row" v-for="(item, index) in scanData.rfidTagItems" :key="index">
-                <div class="col" style="width: 50px;align-items: center;"></div>
-                <div class="col" style="flex: 1"  :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
-                  <div>{{ item.materialName }}</div>
-                  <div>物料长度:{{ item.quantity || 0 }}米</div>
-                </div>
-                <div class="col" style="flex: 1"  :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
-                  <div>标签值:{{ item.rfidCode }}</div>
-                </div>
-                <div class="col" style="width: 50px;">
-                  <Icon type="ios-trash" size="20" color="red" @click="del(item, index)" style="cursor: pointer"/>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-        <div class="list-wrap bottom">
-          <div class="list">
-            <div class="sub-title">
-              本次统计
-              <a class="remark" href="#" @click="show = true">填写备注</a>
-            </div>
-            <div style="height: calc(100% - 46px);overflow: auto">
-              <div class="row"
-                   v-for="(item, index) in scanData.materialItems"
-                   :key="index">
-                <div class="col" style="flex: 3;" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
-                  <div>{{ item.materialName }}</div>
-                </div>
-                <div class="col" style="flex: 2" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
-                  <div>入库件数:{{ item.tagCount }}</div>
-                </div>
-                <div class="col" style="flex: 2" :style="{ color: item.scanRfidStatus === 1 ? 'orange' : item.scanRfidStatus === 2? 'red': '#fff'}">
-                  <div>入库数量:{{ item.totalQuantity }}米</div>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="footer">
-        <Button type="error" size="large" style="margin-right: 20px" @click="pass(0)">重新扫描</Button>
-        <Button type="success" size="large" @click="pass(1)">确认无误</Button>
-      </div>
-    </div>
-  </div>
-  <div class="remark-content">
-    <Modal
-        v-model="modal"
-        :mask-closable="false"
-        :closable="false"
-        :fullscreen="true"
-        :footer-hide="true"
-        >
-      <Progress :percent="percent" :stroke-color="['#108ee9', '#87d068']" :hide-info="true" style="width: 400px"/>
-    </Modal>
-  </div>
-  <!-- 填写备注 -->
-  <Modal
-      v-model="show"
-      :closable="false"
-      :footer-hide="true"
-      class-name="vertical-center-modal"
-      @on-cancel="cancel"
-     >
-    <div class="remark-content">
-      <div class="title">填写备注</div>
-      <Input v-model="remark" type="textarea" :rows="10"/>
-      <div class="btn">
-        <Button @click="cfm" type="success" style="width: 120px">确定</Button>
-      </div>
-    </div>
-  </Modal>
-  <!-- 辅助扫描 -->
-  <Modal
-      v-model="scanShow"
-      class-name="vertical-center-modal"
-      @on-cancel="cancel"
-  >
-    <div class="scan-title" slot="header">辅助扫描</div>
-    <div class="scan-btn" slot="footer">
-      <Button type="primary" style="width: 80px" @click="scanShow = false">关闭</Button>
-    </div>
-    <div class="scan-content" v-if="otherData.length > 0">
-      <div class="item" v-for="(item, index) in otherData" :key="index">
-        <div class="left">
-          <div class="row">RFID标签:{{ item.rfidCode }}</div>
-          <div class="row">物料编码:{{ item.materialCode }}</div>
-          <div class="row">物料名称:{{ item.materialName }}</div>
-          <div class="row">最近操作:{{ item.lastOpera }}</div>
-        </div>
-        <div class="right">
-          <Button type="primary" ghost @click="add(item)" v-if="item.lastOpera.indexOf('入库') === -1">入库</Button>
-        </div>
-      </div>
-    </div>
-    <div v-else style="padding: 10px 0;color: #FFFFFF">暂无数据</div>
-
-  </Modal>
-</div>
+	<div class="container">
+		<my-nav
+			@listener-in="inHandle"
+			@listener-helper="helperHandle"
+		></my-nav>
+		<div class="content">
+			<div class="reading" v-if="reading">
+				入库扫描中<br />
+				请将需要入库的物料推入感应门
+			</div>
+			<div v-else style="height: 100%">
+				<div
+					style="
+						display: flex;
+						justify-content: space-between;
+						align-items: center;
+					"
+				>
+					<div style="width: 108px"></div>
+					<div class="title">入库扫描</div>
+					<div style="padding: 0 10px">
+						<Button
+							type="primary"
+							style="margin-right: 10px"
+							@click="purContractPageListModal = true"
+							>手动入库</Button
+						>
+						<Button type="primary" @click="scanShow = true"
+							>辅助扫描</Button
+						>
+					</div>
+				</div>
+				<div class="main">
+					<div class="list-wrap">
+						<div class="list" style="margin-right: 20px">
+							<div class="sub-title">已贴标物料</div>
+							<div
+								style="
+									height: calc(100% - 46px);
+									overflow: auto;
+								"
+							>
+								<div
+									class="row"
+									v-for="(item, index) in data"
+									:key="index"
+								>
+									<div
+										class="col"
+										style="width: 50px; align-items: center"
+									>
+										<Icon
+											type="ios-checkmark-circle"
+											color="red"
+											size="18"
+											v-if="item.checked"
+										/>
+									</div>
+									<div class="col" style="flex: 1">
+										<div>{{ item.materialName }}</div>
+										<div>
+											物料长度:{{ item.quantity }}米
+										</div>
+									</div>
+								</div>
+							</div>
+						</div>
+						<div class="list">
+							<div class="sub-title">本次入库</div>
+							<div
+								style="
+									height: calc(100% - 46px);
+									overflow: auto;
+								"
+							>
+								<div
+									class="row"
+									v-for="(
+										item, index
+									) in scanData.rfidTagItems"
+									:key="index"
+								>
+									<div
+										class="col"
+										style="width: 50px; align-items: center"
+									></div>
+									<div
+										class="col"
+										style="flex: 1"
+										:style="{
+											color:
+												item.scanRfidStatus === 1
+													? 'orange'
+													: item.scanRfidStatus === 2
+													? 'red'
+													: '#fff',
+										}"
+									>
+										<div>{{ item.materialName }}</div>
+										<div>
+											物料长度:{{ item.quantity || 0 }}米
+										</div>
+									</div>
+									<div
+										class="col"
+										style="flex: 1"
+										:style="{
+											color:
+												item.scanRfidStatus === 1
+													? 'orange'
+													: item.scanRfidStatus === 2
+													? 'red'
+													: '#fff',
+										}"
+									>
+										<div>标签值:{{ item.rfidCode }}</div>
+									</div>
+									<div class="col" style="width: 50px">
+										<Icon
+											type="ios-trash"
+											size="20"
+											color="red"
+											@click="del(item, index)"
+											style="cursor: pointer"
+										/>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="list-wrap bottom">
+						<div class="list">
+							<div class="sub-title">
+								本次统计
+								<a class="remark" href="#" @click="show = true"
+									>填写备注</a
+								>
+							</div>
+							<div
+								style="
+									height: calc(100% - 46px);
+									overflow: auto;
+								"
+							>
+								<div
+									class="row"
+									v-for="(item, index) in materialItemsCopy"
+									:key="index"
+								>
+									<div
+										class="col"
+										style="flex: 3"
+										:style="{
+											color:
+												item.scanRfidStatus === 1
+													? 'orange'
+													: item.scanRfidStatus === 2
+													? 'red'
+													: '#fff',
+										}"
+									>
+										<div>{{ item.materialName }}</div>
+									</div>
+									<div
+										class="col"
+										style="flex: 2"
+										:style="{
+											color:
+												item.scanRfidStatus === 1
+													? 'orange'
+													: item.scanRfidStatus === 2
+													? 'red'
+													: '#fff',
+										}"
+									>
+										<div>入库件数:{{ item.tagCount }}</div>
+									</div>
+									<div
+										class="col"
+										style="flex: 2"
+										:style="{
+											color:
+												item.scanRfidStatus === 1
+													? 'orange'
+													: item.scanRfidStatus === 2
+													? 'red'
+													: '#fff',
+										}"
+									>
+										<div>
+											入库数量:{{ item.quantity }}米
+										</div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="footer">
+					<Button
+						type="error"
+						size="large"
+						style="margin-right: 20px"
+						@click="pass(0)"
+						>重新扫描</Button
+					>
+					<Button type="success" size="large" @click="pass(1)"
+						>确认无误</Button
+					>
+				</div>
+			</div>
+		</div>
+		<div class="remark-content">
+			<Modal
+				v-model="modal"
+				:mask-closable="false"
+				:closable="false"
+				:fullscreen="true"
+				:footer-hide="true"
+			>
+				<Progress
+					:percent="percent"
+					:stroke-color="['#108ee9', '#87d068']"
+					:hide-info="true"
+					style="width: 400px"
+				/>
+			</Modal>
+		</div>
+		<!-- 填写备注 -->
+		<Modal
+			v-model="show"
+			:closable="false"
+			:footer-hide="true"
+			class-name="vertical-center-modal"
+			@on-cancel="cancel"
+		>
+			<div class="remark-content">
+				<div class="title">填写备注</div>
+				<Input v-model="remark" type="textarea" :rows="10" />
+				<div class="btn">
+					<Button @click="cfm" type="success" style="width: 120px"
+						>确定</Button
+					>
+				</div>
+			</div>
+		</Modal>
+		<!-- 手动入库 -->
+		<Modal
+			v-model="purContractPageListModal"
+			title="手动入库"
+			okText="关闭"
+			class-name="purContractPageList"
+			@on-cancel="purContractPageListModal = false"
+			width="90%"
+		>
+			<my-table
+				:data="purContractPageListData"
+				:columns="purContractPageListColumns"
+				:table-filter="tableFilter"
+				:table-page="params"
+				@event-handle="eventHandle"
+				@on-change="changePage"
+			></my-table>
+		</Modal>
+		<my-manege-modal
+			v-model="showInfo"
+			:data="formData"
+			@approval-handle="approvalHandle"
+			
+		>
+		</my-manege-modal>
+		<!-- 辅助扫描 -->
+		<Modal
+			v-model="scanShow"
+			class-name="vertical-center-modal"
+			@on-cancel="cancel"
+		>
+			<div class="scan-title" slot="header">辅助扫描</div>
+			<div class="scan-btn" slot="footer">
+				<Button
+					type="primary"
+					style="width: 80px"
+					@click="scanShow = false"
+					>关闭</Button
+				>
+			</div>
+			<div class="scan-content" v-if="otherData.length > 0">
+				<div
+					class="item"
+					v-for="(item, index) in otherData"
+					:key="index"
+				>
+					<div class="left">
+						<div class="row">RFID标签:{{ item.rfidCode }}</div>
+						<div class="row">物料编码:{{ item.materialCode }}</div>
+						<div class="row">物料名称:{{ item.materialName }}</div>
+						<div class="row">最近操作:{{ item.lastOpera }}</div>
+					</div>
+					<div class="right">
+						<Button
+							type="primary"
+							ghost
+							@click="add(item)"
+							v-if="item.lastOpera.indexOf('入库') === -1"
+							>入库</Button
+						>
+					</div>
+				</div>
+			</div>
+			<div v-else style="padding: 10px 0; color: #ffffff">暂无数据</div>
+		</Modal>
+	</div>
 </template>
-
-<script>
+  
+  <script>
 import MyNav from '@/components/my-nav'
 import * as signalR from '@microsoft/signalr'
 import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'
 import withUrl from '@/config/withUrl'
-import {GetHasTagMaterialList, PlcStorageIn, ReScan, GetScanRfidStocInOut, DelScanRfid} from '@/api/integrated'
-import store from "@/store";
-import {logOut} from "@/libs/util";
+import MyTable from '@/components/my-table/my-table'
+import {
+	GetHasTagMaterialList,
+	PlcStorageIn,
+	ReScan,
+	GetScanRfidStocInOut,
+	DelScanRfid,
+	GetPurContractPageList,
+	
+} from '@/api/integrated'
+import store from '@/store'
+import { logOut } from '@/libs/util'
+import MyManegeModal from './my-manage-modal'
 export default {
-  name: "store-in",
-  data() {
-    return {
-      scanShow: false,
-      show: false,
-      modal: false,
-      percent: 0,
-      addTimer: null,
-      overTimer: null,
-      reading: false,
-      connection: null,
-      data: [], // 左侧数据列表
-      scanData: {}, // 扫描数据
-      otherData: [], // 扫描辅助数据
-      tempDelData: [], // 临时删除列表
-      remark: ''
-    }
-  },
-  components: {
-    MyNav
-  },
-  methods: {
-    add (item) {
-      item.totalQuantity = item.qty
-      item.quantity = item.qty
-      // 辅助扫描的添加一个isTemp 标识以供删除区分
-      if (this.scanData.rfidTagItems.find(scan => scan.materialCode === item.materialCode)) {
-        this.$Message.error('物料已添加')
-      } else {
-        this.scanData.rfidTagItems.push({...item, isTemp: true})
-        this.scanData.materialItems.push({...item, isTemp: true})
-        this.$Message.info('添加成功')
-      }
-    },
-    cancel () {
-      this.remark = ''
-    },
-    cfm () {
-      this.show = false
-    },
-    /* 临时删除 */
-    del (item, index) {
-      if (item.isTemp) {
-        this.scanData.rfidTagItems.splice(index, 1)
-        this.scanData.materialItems.splice(index, 1)
-        /* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
-        this.tempDelData.push(item)
-      } else {
-        DelScanRfid({
-          rfid: item.rfidCode,
-          plcStationCode: sessionStorage.getItem('plcCode')
-        }).then(res => {
-          if (res.code === 0) {
-            this.$Message.info('删除成功!')
-            this.tempDelData.push(item)
-            this.getScanList()
-          }
-        })
-      }
-    },
-    /* 辅助扫描通知 */
-    helperHandle (data) {
-      this.otherData = data
-    },
-    /* 入库通知 */
-    inHandle() {
-      this.getScanList()
-      clearTimeout(this.overTimer)
-      this.overTimer = setTimeout(() => {
-        clearInterval(this.addTimer)
-        this.percent = 100
-        setTimeout(() => {
-          this.modal = false
-        }, 500)
-      }, 3000)
-    },
-    /* 是否通过 0否 1是 */
-    pass(type) {
-      if (type === 0) {
-        this.$Message.info('请重新扫描入库!')
-        this.scanData.rfidTagItems = []
-        this.scanData.materialItems = []
-        ReScan({
-          reScanType: 0,
-          storageType: sessionStorage.getItem('plcCode'),
-          storageDoor: sessionStorage.getItem('door')
-        })
-      } else if (type === 1) {
-        // 入库
-        PlcStorageIn({
-          storageDoor: sessionStorage.getItem('door'),
-          plcStationCode: sessionStorage.getItem('plcCode'),
-          rfidList: this.scanData.rfidTagItems.map(item => item.rfidCode),
-          remark: this.remark
-        }).then(res => {
-          if (res.code === 0) {
-            this.$Message.info('入库成功!')
-            logOut()
-            // this.$store.commit('setHasGetInfo', false)
-            // this.$store.commit('setToken', '')
-            // setTimeout(() => {
-            //   this.$router.push({
-            //     name: 'Home',
-            //     query: {
-            //       plcCode: sessionStorage.getItem('plcCode'),
-            //       door: sessionStorage.getItem('door')
-            //     }
-            //   })
-            // }, 500)
-          }
-        })
-      }
-    },
-    getList() {
-      /* 获取已贴标数据 */
-      GetHasTagMaterialList().then(res => {
-        if (res.code === 0) {
-          this.data = res.result
-        }
-      })
-    },
-    getScanList () {
-      GetScanRfidStocInOut({
-        storagePlcCode: sessionStorage.getItem('plcCode'),
-        stockInOutScanType: 0
-      }).then(scanRes => {
-        if (scanRes.code === 0) {
-          this.reading = false
-          this.scanData = scanRes.result
-          /* 临时删除的数据不可再添加到出入库列表中 */
-          this.tempDelData.forEach(temp => {
-            for (const index in this.scanData.rfidTagItems) {
-              if (temp.materialCode === this.scanData.rfidTagItems[index].materialCode) {
-                this.scanData.rfidTagItems.splice(index, 1)
-              }
-            }
-            for (const index in this.scanData.materialItems) {
-              if (temp.materialCode === this.scanData.materialItems[index].materialCode) {
-                this.scanData.materialItems.splice(index, 1)
-              }
-            }
-          })
-          this.data.forEach(item => {
-            this.scanData.rfidTagItems.forEach(scan => {
-              if (item.rfidCode === scan.rfidCode) {
-                item.checked = true
-              }
-            })
-          })
-        }
-      })
-    }
-  },
-  mounted() {
-    this.tempDelData = []
-    this.getList()
-    this.getScanList()
-    this.addTimer = setInterval(() => {
-      this.percent += 1
-      if (this.percent === 100) {
-        clearInterval(this.addTimer)
-        clearTimeout(this.overTimer)
-        this.modal = false
-      }
-    }, 100)
-    this.overTimer = setTimeout(() => {
-      clearInterval(this.addTimer)
-      this.percent = 100
-      setTimeout(() => {
-        this.modal = false
-      }, 500)
-    }, 3000)
-  },
-  destroyed() {
-  }
+	name: 'store-in',
+	components:{
+		MyTable,
+		MyNav,
+		MyManegeModal
+	},
+	data() {
+		return {
+			scanShow: false,
+			show: false,
+			modal: false,
+			percent: 0,
+			addTimer: null,
+			overTimer: null,
+			reading: false,
+			connection: null,
+			data: [], // 左侧数据列表
+			scanData: {
+				rfidTagItems: [],
+				materialItems: [],
+			}, // 扫描数据
+			otherData: [], // 扫描辅助数据
+			tempDelData: [], // 临时删除列表
+			remark: '',
+			materialItemsCopy: [],
+			// 手动入库
+			showInfo:false,
+			formData:{},
+			purContractPageListModal: false,
+			purContractPageListData: [],
+			purContractPageListColumns: [
+				{
+					title: '序号',
+					type: 'index',
+					width: 60,
+					align: 'center',
+				},
+				{
+					title: '合同编号',
+					key: 'purchaseBillNo',
+					minWidth: 200,
+					render: (h, params) => {
+						let _this = this
+						return h(
+							'a',
+							{
+								on: {
+									click() {
+										
+									},
+								},
+							},
+							params.row.purchaseBillNo
+						)
+					},
+				},
+				{
+					title: '合同状态',
+					key: 'supplierShipState',
+					minWidth: 150,
+				},
+				{
+					title: '交货日期',
+					key: 'deliverTime',
+					minWidth: 150,
+				},
+				{
+					title: '件号',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '规格',
+					key: 'spec',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'unitName',
+					minWidth: 150,
+				},
+				{
+					title: '采购数量',
+					key: 'purchaseQty',
+					minWidth: 150,
+				},
+				{
+					title: '单价',
+					key: 'price',
+					minWidth: 150,
+				},
+				{
+					title: '小计',
+					key: 'totalAmount',
+					minWidth: 150,
+				},
+				{
+					title: '已出货',
+					key: 'shipQuantity',
+					minWidth: 150,
+				},
+				{
+					title: '已出货金额',
+					key: 'shipAmount',
+					minWidth: 150,
+				},
+				{
+					title: '操作',
+					key: 'takeState',
+					minWidth: 180,
+					align: 'center',
+					fixed: 'right',
+					render: (h, params) => {
+						let _this = this
+						return h('div', [
+							h(
+								'Button',
+								{
+									props: {
+										type: 'primary',
+										size: 'small',
+									},
+									style: {
+										marginRight: '10px',
+									},
+									on: {
+										click: () => {
+											_this.formData = {
+												...params.row,
+											}
+											_this.showInfo = true
+										},
+									},
+								},
+								'查看批次'
+							),
+						])
+					},
+				},
+			],
+			tableFilter: [
+				{
+					name: 'Input',
+					value: 'key',
+					placeholder: '请输入关键字',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+			],
+			params: {
+				pageIndex: 1,
+				pageSize: 10,
+				total: 0,
+				supplierShipState: 0,
+			},
+		}
+	},
+	methods: {
+		add(item) {
+			item.totalQuantity = item.qty
+			item.quantity = item.qty
+			// 辅助扫描的添加一个isTemp 标识以供删除区分
+			if (
+				this.scanData.rfidTagItems.find(
+					(scan) => scan.materialCode === item.materialCode
+				)
+			) {
+				this.$Message.error('物料已添加')
+			} else {
+				this.scanData.rfidTagItems.push({ ...item, isTemp: true })
+				this.scanData.materialItems.push({ ...item, isTemp: true })
+				this.$Message.info('添加成功')
+			}
+		},
+		cancel() {
+			this.remark = ''
+		},
+		cfm() {
+			this.show = false
+		},
+		/* 临时删除 */
+		del(item, index) {
+			// if (item.isTemp) {
+			this.scanData.rfidTagItems.splice(index, 1)
+			this.scanData.materialItems.splice(index, 1)
+			/* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
+			this.tempDelData.push(item)
+			this.getScanList()
+			// } else {
+			// 	DelScanRfid({
+			// 		rfid: item.rfidCode,
+			// 		plcStationCode: sessionStorage.getItem('plcCode'),
+			// 	}).then((res) => {
+			// 		if (res.code === 0) {
+			// 			this.$Message.info('删除成功!')
+			// 			this.tempDelData.push(item)
+			// 			this.getScanList()
+			// 		}
+			// 	})
+			// }
+		},
+		/* 辅助扫描通知 */
+		helperHandle(data) {
+			this.otherData = data
+		},
+		/* 入库通知 */
+		inHandle() {
+			this.getScanList()
+			clearTimeout(this.overTimer)
+			this.overTimer = setTimeout(() => {
+				clearInterval(this.addTimer)
+				this.percent = 100
+				setTimeout(() => {
+					this.modal = false
+				}, 500)
+			}, 3000)
+		},
+		/* 是否通过 0否 1是 */
+		pass(type) {
+			if (type === 0) {
+				this.$Message.info('请重新扫描入库!')
+				this.scanData.rfidTagItems = []
+				this.scanData.materialItems = []
+				this.materialItemsCopy = []
+				this.tempDelData = []
+				ReScan({
+					reScanType: 0,
+					storageType: sessionStorage.getItem('plcCode'),
+					storageDoor: sessionStorage.getItem('door'),
+				})
+			} else if (type === 1) {
+				// 入库
+				PlcStorageIn({
+					storageDoor: sessionStorage.getItem('door'),
+					plcStationCode: sessionStorage.getItem('plcCode'),
+					rfidList: this.scanData.rfidTagItems.map(
+						(item) => item.rfidCode
+					),
+					remark: this.remark,
+				}).then((res) => {
+					if (res.code === 0) {
+						this.$Message.info('入库成功!')
+						logOut()
+						// this.$store.commit('setHasGetInfo', false)
+						// this.$store.commit('setToken', '')
+						// setTimeout(() => {
+						//   this.$router.push({
+						//     name: 'Home',
+						//     query: {
+						//       plcCode: sessionStorage.getItem('plcCode'),
+						//       door: sessionStorage.getItem('door')
+						//     }
+						//   })
+						// }, 500)
+					}
+				})
+			}
+		},
+		getList() {
+			/* 获取已贴标数据 */
+			GetHasTagMaterialList().then((res) => {
+				if (res.code === 0) {
+					this.data = res.result
+				}
+			})
+		},
+		// 检索条件事件处理
+		eventHandle(option) {
+			switch (option._evnet) {
+				case 'search':
+					this.params.pageIndex = 1
+					this.params.purchaseBillNo = option.key
+					this.params.supplierShipState = option.supplierShipState
+					this.gePurContractPage()
+					break
+				case 'add':
+					this.formType = 'add'
+					this.show = true
+					break
+				case 'back':
+					this.$router.go(-1)
+					break
+				case 'download':
+					window.open(
+						'https://fzjx.oss-cn-hangzhou.aliyuncs.com/order/20211014/211014041759903892.xlsx'
+					)
+					break
+				case 'ip':
+					this.ipShow = true
+					break
+			}
+		},
+		/* 点击删除 出货后触发审批流操作 */
+		approvalHandle () {
+			this.getList()
+		},
+		changePage(pageIndex) {
+			this.params.pageIndex = pageIndex
+			this.gePurContractPage()
+		},
+		gePurContractPage() {
+			GetPurContractPageList(this.params).then((res) => {
+				if (res.code === 0) {
+					this.purContractPageListData = res.result.list
+					this.params.total = res.result.totalCount
+				}
+			})
+		},
+		unique(arr, val) {
+			const res = new Map()
+			return arr.filter(
+				(item) => !res.has(item[val]) && res.set(item[val], 1)
+			)
+		},
+		getScanList() {
+			GetScanRfidStocInOut({
+				storagePlcCode: sessionStorage.getItem('plcCode'),
+				stockInOutScanType: 0,
+			}).then((scanRes) => {
+				if (scanRes.code === 0) {
+					this.reading = false
+					this.scanData.rfidTagItems = [
+						...this.scanData.rfidTagItems,
+						...scanRes.result.rfidTagItems,
+					]
+					this.scanData.materialItems = [
+						...this.scanData.materialItems,
+						...scanRes.result.materialItems,
+					]
+					this.scanData.rfidTagItems = this.unique(
+						this.scanData.rfidTagItems,
+						'rfidCode'
+					)
+					/* 临时删除的数据不可再添加到出入库列表中 */
+					this.tempDelData.forEach((temp) => {
+						for (const index in this.scanData.rfidTagItems) {
+							if (
+								temp.rfidCode ===
+								this.scanData.rfidTagItems[index].rfidCode
+							) {
+								this.scanData.rfidTagItems.splice(index, 1)
+							}
+						}
+
+						for (const index in this.scanData.materialItems) {
+							if (
+								temp.materialCode ===
+								this.scanData.materialItems[index].materialCode
+							) {
+								this.scanData.materialItems.splice(index, 1)
+							}
+						}
+					})
+					this.materialItemsCopy = []
+					for (
+						let i = 0;
+						i < this.scanData.rfidTagItems.length;
+						i++
+					) {
+						const element = this.scanData.rfidTagItems[i]
+						console.log(this.materialItemsCopy, 12312312)
+						if (this.materialItemsCopy.length == 0) {
+							this.materialItemsCopy.push({
+								...element,
+								tagCount: 1,
+							})
+						} else {
+							var isTotal = false
+
+							for (
+								let j = 0;
+								j < this.materialItemsCopy.length;
+								j++
+							) {
+								const jelement = this.materialItemsCopy[j]
+								if (
+									element.materialCode ===
+									jelement.materialCode
+								) {
+									isTotal = true
+									jelement.tagCount++
+									jelement.quantity += element.quantity
+								}
+							}
+							if (!isTotal)
+								this.materialItemsCopy.push({
+									...element,
+									tagCount: 1,
+								})
+						}
+					}
+					this.data.forEach((item) => {
+						this.scanData.rfidTagItems.forEach((scan) => {
+							if (item.rfidCode === scan.rfidCode) {
+								item.checked = true
+							}
+						})
+					})
+				}
+			})
+		},
+	},
+	mounted() {
+		this.gePurContractPage()
+		this.tempDelData = []
+		this.getList()
+		this.getScanList()
+		this.addTimer = setInterval(() => {
+			this.percent += 1
+			if (this.percent === 100) {
+				clearInterval(this.addTimer)
+				clearTimeout(this.overTimer)
+				this.modal = false
+			}
+		}, 100)
+		this.overTimer = setTimeout(() => {
+			clearInterval(this.addTimer)
+			this.percent = 100
+			setTimeout(() => {
+				this.modal = false
+			}, 500)
+		}, 3000)
+	},
+	destroyed() {},
 }
 </script>
+<style>
+.purContractPageList .table-filter,.purContractPageList .table-page ,.purContractPageList .ivu-modal-footer ,.purContractPageList .ivu-modal-header{
+	background: #fff;
+}
 
-<style lang="scss" scoped>
-  .container {
-    width: 100vw;
-    height: 100vh;
-    overflow: auto;
-    //background: rgba(2, 125, 180, 1);
-    background-image: linear-gradient(270deg,
-        #2c3034 0%,
-        #50575e 49%,
-        #2c3034 100%);
-    .content {
-      margin: 10px;
-      height: calc(100% - 121.6px);
-      overflow: hidden;
-      box-sizing: border-box;
-      //background: rgba(1, 84, 120, 1);
-      border-radius: 10px;
-      .reading {
-        height: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        font-size: 36px;
-        font-weight: bold;
-        color: #00FFFF;
-      }
-      .title {
-        padding-bottom: 10px;
-        text-align: center;
-        font-size: 36px;
-        font-weight: bold;
-        color: #2dc57c;
-      }
-      .main {
-        height: calc(100% - 113.6px);
-        display: flex;
-        flex-direction: column;
-        .list-wrap {
-          flex: 2;
-          overflow: hidden;
-          padding: 0 10px;
-          width: 100%;
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-          .list {
-            position: relative;
-            //padding: 0 10px;
-            flex: 1;
-            height: 100%;
-            overflow: hidden;
-            //background: rgba(2, 125, 180, 0.486274509803922);
-            background: #2c3034;
-            border-radius: 4px;
-            border: solid 1px #3879e7;
-            .sub-title {
-              position: relative;
-              padding: 5px 0;
-              font-size: 24px;
-              color: #0077ff;
-              font-weight: bold;
-              .remark {
-                position: absolute;
-                right: 10px;
-                top: 50%;
-                transform: translateY(-50%);
-                font-size: 16px;
-                font-weight: normal;
-                color: #0077ff;
-              }
-            }
-            .row {
-              padding: 5px 0;
-              display: flex;
-              justify-content: space-between;
-              align-items: center;
-              //background: rgba(2, 167, 240, 1);
-              border-top: 1px solid #2655ad;
-              //border-radius: 5px;
-              &:last-child {
-                border-bottom: 1px solid #2655ad;
-              }
-              .col {
-                padding: 0 5px;
-                display: flex;
-                flex-direction: column;
-                align-items: flex-start;
-                justify-content: center;
-                text-align: left;
-                color: #ffffff;
-              }
-            }
-            .total {
-              padding: 5px 10px;
-              //position: absolute;
-              left: 0;
-              bottom: 0;
-              text-align: left;
-              font-size: 20px;
-              font-weight: bold;
-              color: #F59A23;
-              .top {
-                font-size: 24px;
-              }
-              .label {
-                margin-left: 40px  ;
-                display: inline-block;
-                width: 100px;
-              }
-            }
-          }
-        }
-        .bottom {
-          margin-top: 20px;
-          flex: 1;
-          .row {
-            border: none !important;
-          }
-          .col {
-            padding: 0 20px !important;
-          }
-        }
-      }
-      .footer {
-        padding: 10px 0;
-        padding-bottom: 0;
-        /deep/ .ivu-btn-large {
-          border-radius: 20px;
-          font-weight: bold;
-          width: 150px;
-        }
-      }
-    }
-  }
-  /deep/.ivu-modal-content {
-    background: #2c3034;
-  }
-  /deep/.ivu-modal-body {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    padding: 0;
-  }
-  /deep/.remark-content {
-    padding: 16px;
-    width: 100%;
-    .title {
-      font-size: 24px;
-      font-weight: bold;
-      text-align: center;
-      color: #FFFFFF;
-      padding-bottom: 10px;
-    }
-    .btn {
-      text-align: center;
-      padding-top: 10px;
-    }
-  }
-  /deep/ .ivu-modal-header {
-    border-bottom: none;
-  }
-  /deep/ .ivu-modal-footer {
-    border-top: none;
-  }
-  .scan-title {
-    font-size: 18px;
-    font-weight: bold;
-    color: #FFFFFF;
-  }
-  .scan-btn {
-    text-align: center;
-  }
-  .scan-content {
-    padding: 10px 16px;
-    width: 100%;
-    max-height: 40vh;
-    overflow: auto;
-    background-color: #3D3D3D;
-    color: #FFFFFF;
-    .item {
-      margin-bottom: 5px;
-      border-bottom: 1px solid #FFFFFF;
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      &:last-child {
-        margin-bottom: 0;
-        border-bottom: none;
-      }
-      .left {
-        flex: 1;
-        overflow: hidden;
-      }
-      .right {
-        width: 60px;
-        /deep/ .ivu-btn-primary {
-          background-color: rgb(204, 228, 255);
-        }
-      }
-      .row {
-        margin-bottom: 5px;
-        word-break: break-all;
-      }
-    }
-  }
+
+
+.purContractPageList .table-content,.purContractPageList .container{
+	height: auto!important;
+}
+</style>
+  <style lang="scss" scoped>
+.container {
+	width: 100vw;
+	height: 100vh;
+	overflow: auto;
+	//background: rgba(2, 125, 180, 1);
+	background-image: linear-gradient(
+		270deg,
+		#2c3034 0%,
+		#50575e 49%,
+		#2c3034 100%
+	);
+	.content {
+		margin: 10px;
+		height: calc(100% - 121.6px);
+		overflow: hidden;
+		box-sizing: border-box;
+		//background: rgba(1, 84, 120, 1);
+		border-radius: 10px;
+		.reading {
+			height: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 36px;
+			font-weight: bold;
+			color: #00ffff;
+		}
+		.title {
+			padding-bottom: 10px;
+			text-align: center;
+			font-size: 36px;
+			font-weight: bold;
+			color: #2dc57c;
+		}
+		.main {
+			height: calc(100% - 113.6px);
+			display: flex;
+			flex-direction: column;
+			.list-wrap {
+				flex: 2;
+				overflow: hidden;
+				padding: 0 10px;
+				width: 100%;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				.list {
+					position: relative;
+					//padding: 0 10px;
+					flex: 1;
+					height: 100%;
+					overflow: hidden;
+					//background: rgba(2, 125, 180, 0.486274509803922);
+					background: #2c3034;
+					border-radius: 4px;
+					border: solid 1px #3879e7;
+					.sub-title {
+						position: relative;
+						padding: 5px 0;
+						font-size: 24px;
+						color: #0077ff;
+						font-weight: bold;
+						.remark {
+							position: absolute;
+							right: 10px;
+							top: 50%;
+							transform: translateY(-50%);
+							font-size: 16px;
+							font-weight: normal;
+							color: #0077ff;
+						}
+					}
+					.row {
+						padding: 5px 0;
+						display: flex;
+						justify-content: space-between;
+						align-items: center;
+						//background: rgba(2, 167, 240, 1);
+						border-top: 1px solid #2655ad;
+						//border-radius: 5px;
+						&:last-child {
+							border-bottom: 1px solid #2655ad;
+						}
+						.col {
+							padding: 0 5px;
+							display: flex;
+							flex-direction: column;
+							align-items: flex-start;
+							justify-content: center;
+							text-align: left;
+							color: #ffffff;
+						}
+					}
+					.total {
+						padding: 5px 10px;
+						//position: absolute;
+						left: 0;
+						bottom: 0;
+						text-align: left;
+						font-size: 20px;
+						font-weight: bold;
+						color: #f59a23;
+						.top {
+							font-size: 24px;
+						}
+						.label {
+							margin-left: 40px;
+							display: inline-block;
+							width: 100px;
+						}
+					}
+				}
+			}
+			.bottom {
+				margin-top: 20px;
+				flex: 1;
+				.row {
+					border: none !important;
+				}
+				.col {
+					padding: 0 20px !important;
+				}
+			}
+		}
+		.footer {
+			padding: 10px 0;
+			padding-bottom: 0;
+			/deep/ .ivu-btn-large {
+				border-radius: 20px;
+				font-weight: bold;
+				width: 150px;
+			}
+		}
+	}
+}
+/deep/.ivu-modal-content {
+	background: #2c3034;
+}
+/deep/.ivu-modal-body {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	padding: 0;
+}
+/deep/.remark-content {
+	padding: 16px;
+	width: 100%;
+	.title {
+		font-size: 24px;
+		font-weight: bold;
+		text-align: center;
+		color: #ffffff;
+		padding-bottom: 10px;
+	}
+	.btn {
+		text-align: center;
+		padding-top: 10px;
+	}
+}
+/deep/ .ivu-modal-header {
+	border-bottom: none;
+}
+/deep/ .ivu-modal-footer {
+	border-top: none;
+}
+.scan-title {
+	font-size: 18px;
+	font-weight: bold;
+	color: #ffffff;
+}
+.scan-btn {
+	text-align: center;
+}
+.scan-content {
+	padding: 10px 16px;
+	width: 100%;
+	max-height: 40vh;
+	overflow: auto;
+	background-color: #3d3d3d;
+	color: #ffffff;
+	.item {
+		margin-bottom: 5px;
+		border-bottom: 1px solid #ffffff;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		&:last-child {
+			margin-bottom: 0;
+			border-bottom: none;
+		}
+		.left {
+			flex: 1;
+			overflow: hidden;
+		}
+		.right {
+			width: 60px;
+			/deep/ .ivu-btn-primary {
+				background-color: rgb(204, 228, 255);
+			}
+		}
+		.row {
+			margin-bottom: 5px;
+			word-break: break-all;
+		}
+	}
+}
 </style>
+  

+ 229 - 75
src/views/store-out.vue

@@ -161,9 +161,7 @@
 							>
 								<div
 									class="row"
-									v-for="(
-										item, index
-									) in materialItemsCopy"
+									v-for="(item, index) in materialItemsCopy"
 									:key="index"
 								>
 									<div
@@ -225,7 +223,10 @@
 						@click="pass(0)"
 						>重新扫描</Button
 					>
-					<Button type="success" size="large" @click.native="copyData()"
+					<Button
+						type="success"
+						size="large"
+						@click.native="copyData()"
 						>仓管校验</Button
 					>
 				</div>
@@ -295,7 +296,7 @@
 							ghost
 							@click="add(item)"
 							v-if="item.lastOpera.indexOf('入库') !== -1"
-							>出库</Button
+							>{{item.check ? '已添加' : '添加'}}</Button
 						>
 					</div>
 				</div>
@@ -309,9 +310,8 @@
 			class-name="vertical-center-modal"
 			:footer-hide="true"
 		>
-			<check-modal  @face-check="faceCheck"></check-modal>
+			<check-modal @face-check="faceCheck"></check-modal>
 		</Modal>
-		
 	</div>
 </template>
 
@@ -342,17 +342,20 @@ export default {
 			addTimer: null,
 			overTimer: null,
 			data: [], // 左侧数据列表
-			scanData: {}, // 扫描数据
+			scanData: {
+				rfidTagItems: [],
+				materialItems: [],
+			}, // 扫描数据
 			otherData: [], // 扫描辅助数据
 			tempDelData: [], // 临时删除列表
 			connection: null,
 			reading: false,
 			remarkShow: false,
 			remark: '',
-			rfidTagItemsCopy:[],
-			newData:[],
+			rfidTagItemsCopy: [],
+			newData: [],
 			//后台有bug 前端新建数据自己计算
-			materialItemsCopy:[],
+			materialItemsCopy: [],
 		}
 	},
 	components: {
@@ -360,23 +363,64 @@ export default {
 		CheckModal,
 	},
 	methods: {
-		copyData(){
+		copyData() {
 			this.show = true
-			this.rfidTagItemsCopy = JSON.parse(JSON.stringify(this.scanData.rfidTagItems))
+			this.rfidTagItemsCopy = JSON.parse(
+				JSON.stringify(this.scanData.rfidTagItems)
+			)
 		},
 		add(item) {
 			item.totalQuantity = item.qty
 			item.quantity = item.qty
+			item.check = true
 			// 辅助扫描的添加一个isTemp 标识以供删除区分
 			if (
 				this.scanData.rfidTagItems.find(
-					(scan) => scan.materialCode === item.materialCode
+					(scan) => scan.rfidCode === item.rfidCode
 				)
 			) {
 				this.$Message.error('物料已添加')
 			} else {
 				this.scanData.rfidTagItems.push({ ...item, isTemp: true })
 				this.scanData.materialItems.push({ ...item, isTemp: true })
+				this.materialItemsCopy = []
+					for (
+						let i = 0;
+						i < this.scanData.rfidTagItems.length;
+						i++
+					) {
+						const element = this.scanData.rfidTagItems[i]
+						console.log(this.materialItemsCopy, 12312312)
+						if (this.materialItemsCopy.length == 0) {
+							this.materialItemsCopy.push({
+								...element,
+								tagCount: 1,
+							})
+						} else {
+							var isTotal = false
+
+							for (
+								let j = 0;
+								j < this.materialItemsCopy.length;
+								j++
+							) {
+								const jelement = this.materialItemsCopy[j]
+								if (
+									element.materialCode ===
+									jelement.materialCode
+								) {
+									isTotal = true
+									jelement.tagCount++
+									jelement.quantity += element.quantity
+								}
+							}
+							if (!isTotal)
+								this.materialItemsCopy.push({
+									...element,
+									tagCount: 1,
+								})
+						}
+					}
 				this.$Message.info('添加成功')
 			}
 		},
@@ -385,64 +429,101 @@ export default {
 		},
 		cfm() {
 			this.remarkShow = false
-		}, 
+		},
 		faceCheck(val) {
 			const v = this
 			PlcStorageOut({
 				inOutStorageNo: '',
 				storageDoor: sessionStorage.getItem('door'),
 				plcStationCode: sessionStorage.getItem('plcCode'),
-				rfidList: this.rfidTagItemsCopy.map(
-					(item) => item.rfidCode
-				),
+				rfidList: this.rfidTagItemsCopy.map((item) => item.rfidCode),
 				remark: this.remark,
-			}).then((res) => {
-				if (res.code === 0) {
-					this.$Message.info('出库成功!')
-					const actual = []
-					for (let i = 0; i < v.scanData.rfidTagItems.length; i++) {
-						const element = v.scanData.rfidTagItems[i];
-						actual.push({
-							materialCode:element.materialCode,
-							materialRfid:element.rfidCode,
-							quantity:element.quantity
-						})
+			}).then(
+				(res) => {
+					if (res.code === 0) {
+						this.$Message.info('出库成功!')
+						const actual = []
+						for (
+							let i = 0;
+							i < v.scanData.rfidTagItems.length;
+							i++
+						) {
+							const element = v.scanData.rfidTagItems[i]
+							actual.push({
+								materialCode: element.materialCode,
+								materialRfid: element.rfidCode,
+								quantity: element.quantity,
+							})
+						}
+						axios
+							.post(
+								'/cloudApi/stockDetail/submitRestrictedPicking',
+								{
+									appointInfo: v.newData,
+									actual: actual,
+									jobNo: window.localStorage.getItem('jobNo'),
+								}
+							)
+							.then((res) => {})
+						logOut()
+					} else {
+						this.saveErr()
 					}
-					axios.post('/cloudApi/stockDetail/submitRestrictedPicking',{
-						appointInfo:v.newData,
-						actual:actual,
-						jobNo:window.localStorage.getItem('jobNo')
-					}).then(res=>{
-						
-					})
-					logOut()
+				},
+				(err) => {
+					this.saveErr()
 				}
-			})
-			
+			)
 		},
-		/* 临时删除 */
-		del(item, index) {
-			if (item.isTemp) {
-				this.scanData.rfidTagItems.splice(index, 1)
-				this.scanData.materialItems.splice(index, 1)
-				/* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
-				this.tempDelData.push(item)
+		saveErr() {
+			const v = this
+			const errListJson = window.localStorage.getItem('errList')
+			if (errListJson) {
+				var errList = JSON.parse(errListJson)
 			} else {
-				DelScanRfid({
-					rfid: item.rfidCode,
-					plcStationCode: sessionStorage.getItem('plcCode'),
-				}).then((res) => {
-					if (res.code === 0) {
-						this.$Message.info('删除成功!')
-						this.tempDelData.push(item)
-						this.getList()
-					}
-				})
+				var errList = []
+			}
+			var msg = []
+			for (let i = 0; i < v.scanData.rfidTagItems.length; i++) {
+				const element = v.scanData.rfidTagItems[i]
+				msg.push(element.rfidCode)
 			}
+			msg.push(window.localStorage.getItem('jobNo'))
+			errList.push(msg)
+			window.localStorage.setItem('errList', JSON.stringify(errList))
+		},
+		/* 临时删除 */
+		del(item, index) {
+			//if (item.isTemp) {
+			this.scanData.rfidTagItems.splice(index, 1)
+			this.scanData.materialItems.splice(index, 1)
+			/* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
+			this.tempDelData.push(item)
+			this.getList()
+			// } else {
+			// 	DelScanRfid({
+			// 		rfid: item.rfidCode,
+			// 		plcStationCode: sessionStorage.getItem('plcCode'),
+			// 	}).then((res) => {
+			// 		if (res.code === 0) {
+			// 			this.$Message.info('删除成功!')
+			// 			this.tempDelData.push(item)
+			// 			this.getList()
+			// 		}
+			// 	})
+			// }
 		},
 		/* 辅助扫描通知 */
 		helperHandle(data) {
-			this.otherData = data
+			console.log(data)
+			data.map(item=>{
+				item.check = false
+			})
+			this.otherData = [...this.otherData, ...data]
+			this.otherData = this.unique(
+				this.otherData,
+				'rfidCode'
+			)
 		},
 		/* 出库通知 */
 		outHandle() {
@@ -463,6 +544,7 @@ export default {
 				this.scanData.rfidTagItems = []
 				this.scanData.materialItems = []
 				this.materialItemsCopy = []
+				this.tempDelData = []
 				ReScan({
 					reScanType: 1,
 					storageType: sessionStorage.getItem('plcCode'),
@@ -487,6 +569,12 @@ export default {
 				})
 			}
 		},
+		unique(arr, val) {
+			const res = new Map()
+			return arr.filter(
+				(item) => !res.has(item[val]) && res.set(item[val], 1)
+			)
+		},
 		getList() {
 			GetScanRfidStocInOut({
 				storagePlcCode: sessionStorage.getItem('plcCode'),
@@ -494,7 +582,15 @@ export default {
 			}).then((scanRes) => {
 				if (scanRes.code === 0) {
 					this.reading = false
-					this.scanData = { ...scanRes.result }
+					this.scanData.rfidTagItems = [
+						...this.scanData.rfidTagItems,
+						...scanRes.result.rfidTagItems,
+					]
+					this.scanData.materialItems = [
+						...this.scanData.materialItems,
+						...scanRes.result.materialItems,
+					]
+
 					// this.scanData.rfidTagItems = [{
 					// 	"materialCode": "123123123",
 					// 	"materialName": "123123123123",
@@ -504,7 +600,7 @@ export default {
 					// },{
 					// 	"materialCode": "234234",
 					// 	"materialName": "234234234323",
-					// 	"rfidCode": "234234242",
+					// 	"rfidCode": "12312",
 					// 	"quantity": 1323,
 					// 	"scanRfidStatus": 0
 					// },{
@@ -520,7 +616,12 @@ export default {
 					// 	"quantity": 1123,
 					// 	"scanRfidStatus": 0
 					// }]
-					
+
+					this.scanData.rfidTagItems = this.unique(
+						this.scanData.rfidTagItems,
+						'rfidCode'
+					)
+
 					/* 临时删除的数据不可再添加到出入库列表中 */
 					this.tempDelData.forEach((temp) => {
 						for (const index in this.scanData.rfidTagItems) {
@@ -531,7 +632,7 @@ export default {
 								this.scanData.rfidTagItems.splice(index, 1)
 							}
 						}
-						
+
 						for (const index in this.scanData.materialItems) {
 							if (
 								temp.materialCode ===
@@ -542,26 +643,42 @@ export default {
 						}
 					})
 					this.materialItemsCopy = []
-					for (let i = 0; i < this.scanData.rfidTagItems.length; i++) {
-						const element = this.scanData.rfidTagItems[i];
-						console.log(this.materialItemsCopy,12312312)
-						if(this.materialItemsCopy.length == 0){
-							this.materialItemsCopy.push({...element,tagCount:1})
-						}else{
+					for (
+						let i = 0;
+						i < this.scanData.rfidTagItems.length;
+						i++
+					) {
+						const element = this.scanData.rfidTagItems[i]
+						console.log(this.materialItemsCopy, 12312312)
+						if (this.materialItemsCopy.length == 0) {
+							this.materialItemsCopy.push({
+								...element,
+								tagCount: 1,
+							})
+						} else {
 							var isTotal = false
-							
-							for (let j = 0; j < this.materialItemsCopy.length; j++) {
-								const jelement = this.materialItemsCopy[j];
-								if(element.materialCode === jelement.materialCode){
+
+							for (
+								let j = 0;
+								j < this.materialItemsCopy.length;
+								j++
+							) {
+								const jelement = this.materialItemsCopy[j]
+								if (
+									element.materialCode ===
+									jelement.materialCode
+								) {
 									isTotal = true
 									jelement.tagCount++
 									jelement.quantity += element.quantity
-									
 								}
 							}
-							if(!isTotal) this.materialItemsCopy.push({...element,tagCount:1})
+							if (!isTotal)
+								this.materialItemsCopy.push({
+									...element,
+									tagCount: 1,
+								})
 						}
-						
 					}
 					/* 勾选左侧列表通过扫描到的数据 */
 					this.data.forEach((item) => {
@@ -572,7 +689,6 @@ export default {
 						})
 					})
 				}
-				
 			})
 		},
 		/* 左侧列表 */
@@ -583,6 +699,36 @@ export default {
 				}
 			})
 		},
+		socketInit() {
+			var ws = new WebSocket(
+				'ws://36.134.91.96:10001/api/storage-restructure/webStock/123123'
+			)
+			//申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
+			ws.onopen = function () {
+				//当WebSocket创建成功时,触发onopen事件
+				console.log('open')
+				ws.send('hello') //将消息发送到服务端
+			}
+			ws.onmessage = function (e) {
+				//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
+				console.log(e.data, '1111111111111111111111111111')
+				var msg = JSON.parse(e.data)
+				if (msg.type == 1) {
+					msg.data.instructions = 'test'
+					msg.data.type = '2'
+					msg.type = '2'
+					ws.send(JSON.stringify(msg))
+				}
+			}
+			ws.onclose = function (e) {
+				//当客户端收到服务端发送的关闭连接请求时,触发onclose事件
+				console.log('close')
+			}
+			ws.onerror = function (e) {
+				//如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
+				console.log(error)
+			}
+		},
 	},
 	mounted() {
 		this.otherData = JSON.parse(this.$route.query.otherData)
@@ -610,6 +756,14 @@ export default {
 				this.modal = false
 			}, 500)
 		}, 3000)
+		this.scanData.rfidTagItems = []
+		this.scanData.materialItems = []
+		this.materialItemsCopy = []
+		// ReScan({
+		// 	reScanType: 1,
+		// 	storageType: sessionStorage.getItem('plcCode'),
+		// 	storageDoor: sessionStorage.getItem('door'),
+		// })
 	},
 	destroyed() {
 		clearInterval(this.timer)