Browse Source

Merge branch 'develop_yh29' of jianguan-web/qpls-md-html into pre-release

李磊 1 year ago
parent
commit
553a311229

+ 16 - 2
src/views/outboundOrderManagement/outboundOrder/list.vue

@@ -79,6 +79,13 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT'&&$hasPermissions('B_outboundOut')"
+            class="button-primary"
+            @click="openCodeModal(record)"
+            id="outboundOrderList-out-btn">唯一码</a-button>
           <a-button
             size="small"
             type="link"
@@ -120,6 +127,8 @@
         <replenishmentDetailModal v-if="outBizType=='SHELF_REPLENISH'" :outBizSn="orderSn"></replenishmentDetailModal>
       </div>
     </a-modal>
+    <!-- 抓取唯一码弹窗 -->
+    <uniqueCodeModal :openModal="showUniqueCode" @cancel="showUniqueCode=false"></uniqueCodeModal>
   </a-card>
 </template>
 
@@ -138,9 +147,10 @@ import replenishmentDetailModal from '@/views/numsGoodsShelves/replenishmentMana
 import stateIcon from '@/views/common/stateIcon'
 import { stockOutList, stockOutOut, stockOutBatchOut } from '@/api/stockOut'
 import getDate from '@/libs/getDate.js'
+import uniqueCodeModal from './uniqueCodeModal.vue'
 export default {
   name: 'OutboundOrderList',
-  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal, replenishmentDetailModal, stateIcon },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal, replenishmentDetailModal, stateIcon, uniqueCodeModal },
   mixins: [commonMixin],
   data () {
     const _this = this
@@ -200,10 +210,14 @@ export default {
       openModal: false,
       orderSn: undefined,
       outBizType: null, //  当前单子类型   SALES销售出库        ALLOCATE调拨出库
-      rowSelectionInfo: null
+      rowSelectionInfo: null,
+      showUniqueCode: false// 抓取唯一码弹窗
     }
   },
   methods: {
+    openCodeModal () {
+      this.showUniqueCode = true
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null

+ 110 - 0
src/views/outboundOrderManagement/outboundOrder/uniqueCodeListModal.vue

@@ -0,0 +1,110 @@
+<template>
+  <a-modal
+    centered
+    class="unique-code-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="codeInfo"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="38%">
+    <div class="uniqueCodeContent">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="15">
+            <a-col :md="8" :sm="24">
+              <a-form-item label="唯一码">
+                <a-input v-model.trim="queryParam.outBizSubNo" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="codebox">
+        <div class="btn">
+          <a-button type="primary" @click="handlePlAdd">批量添加</a-button>
+          <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
+          <span style="margin-left: 10px;">可选{{ selectTotal }}项</span>
+        </div>
+        <div class="codeList" v-if="plainOptions&&plainOptions.length>0">
+          <a-checkbox-group v-model="chooseList" :options="plainOptions" @change="onChange" />
+        </div>
+        <div v-else>
+          <a-empty />
+        </div>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  name: 'DetailModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    codeInfo: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      chooseList: [],
+      plainOptions: ['8217618375', '8217618376', '8217618377', '8217618378', '8217618379', '8217618380', '8217618381'],
+      queryParam: {
+        outBizSubNo: ''
+      }
+    }
+  },
+  computed: {
+    selectTotal () {
+      return this.chooseList && this.chooseList.length
+    }
+  },
+  methods: {
+    onChange (checkedList) {
+
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .unique-code-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .codebox{
+      .btn{
+        margin:10px 0 20px;
+      }
+      .ant-checkbox-wrapper.ant-checkbox-group-item{
+        padding:0 8px 12px;
+      }
+    }
+
+  }
+</style>

+ 211 - 0
src/views/outboundOrderManagement/outboundOrder/uniqueCodeModal.vue

@@ -0,0 +1,211 @@
+<template>
+  <a-modal
+    centered
+    class="unique-code-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    title="抓取唯一码"
+    @cancel="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form-model layout="inline" :model="queryParam">
+            <a-row :gutter="15">
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input v-model.trim="queryParam.outBizSubNo" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input v-model.trim="queryParam.demanderName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+        <!-- 表格数据 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 400 }"
+          :showPagination="false"
+          bordered>
+          <!-- 唯一码 -->
+          <template slot="code" slot-scope="text, record">
+            <div style="min-height:42px;max-height:64px;overflow-y:scroll;">
+              <a-row>
+                <a-col :span="20">
+                  <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="i in 10" :key="i">
+                    SYT158648594{{ i }}
+                  </a-tag>
+                </a-col>
+                <a-col :span="4" style="text-align:right;">
+                  <a-tag style="background: #fff; borderStyle: dashed;" @click="addCodeTag(index, record)" color="blue">
+                    <a-icon type="plus" /> 选择
+                  </a-tag>
+                </a-col>
+              </a-row>
+              <!-- <a-row>
+                <a-col :span="24" style="line-height:42px;">
+                  <a-tag style="background: #fff; borderStyle: dashed;" @click="addCodeTag" color="blue">
+                    <a-icon type="plus" /> 选择
+                  </a-tag>
+                </a-col>
+              </a-row> -->
+            </div>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+    <!-- 唯一码列表 -->
+    <uniqueCodeListModal codeInfo="ysds1241545454" :openModal="openCodeModal" @close="openCodeModal=false" @ok="handleCodeOk" ></uniqueCodeListModal>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { stockOutList } from '@/api/stockOut'
+import uniqueCodeListModal from './uniqueCodeListModal.vue'
+export default {
+  name: 'SelectGlOrderModal',
+  mixins: [commonMixin],
+  components: { STable, uniqueCodeListModal },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    chooseData: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      handlePlData: [],
+      queryParam: {
+        outBizSubNo: '',
+        demanderName: ''
+      },
+      orginData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return stockOutList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const index = this.chooseData.findIndex(item => data.list[i].stockOutSn == item.stockOutSn)
+              data.list[i].checked = index >= 0
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          this.orginData = data.list
+          return data
+        })
+      },
+      snList: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'stockOutNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'outBizSubNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'demanderName', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '唯一码', scopedSlots: { customRender: 'code' }, width: '41%', align: 'center' }
+      ],
+      detailData: null,
+      openCodeModal: false
+    }
+  },
+  methods: {
+    addCodeTag () {
+      this.openCodeModal = true
+    },
+    handleCodeOk () {
+
+    },
+    custChange (val) {
+      this.queryParam.receiverSn = val.key || ''
+    },
+    // 删除
+    handleDel (row) {
+      const i = this.chooseData.findIndex(item => row.stockOutSn == item.stockOutSn)
+      this.chooseData.splice(i, 1)
+      const oi = this.orginData.findIndex(item => row.stockOutSn == item.stockOutSn)
+      if (oi >= 0) {
+        this.orginData[oi].checked = false
+      }
+    },
+    // 选择
+    handleChoose (row) {
+      row.checked = true
+      this.chooseData.push(row)
+      this.$emit('choose')
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam = {
+        outBizSubNo: '',
+        demanderName: ''
+      }
+      if (this.$refs.table) {
+        this.$refs.table.refresh(true)
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.handleCommonCancel()
+      } else {
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .unique-code-modal{
+    .ant-modal-body {
+    	padding: 30px 40px 40px;
+    }
+  }
+</style>