浏览代码

唯一码

chenrui 1 年之前
父节点
当前提交
1c33adf77a

+ 18 - 8
src/views/salesManagement/pushOrderManagement/detailForOut.vue

@@ -61,6 +61,7 @@
               </a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="唯一码"><span class="link-bule">查看</span></a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -97,7 +98,7 @@
             <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
             <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
           </template>
-           <!-- 销售价 -->
+          <!-- 销售价 -->
           <template slot="price" slot-scope="text, record">
             {{ toThousands(text) }}
             <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
@@ -117,6 +118,13 @@
     <export-excel-modal :openModal="openExcelModal" :itemData="detailData" @ok="handleExcelOk" @close="openExcelModal=false" />
     <!-- 打印 -->
     <div id="print"></div>
+    <!-- 唯一码 -->
+    <uniqueCodeModal
+      ref="uniqueCode"
+      modalTit="轮胎唯一码"
+      :openModal="showCodeModal"
+      @choose="getProductTotal"
+      @cancel="showCodeModal=false"></uniqueCodeModal>
   </div>
 </template>
 
@@ -125,12 +133,13 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import sendTypeModal from './sendTypeModal.vue'
 import exportExcelModal from './exportExcelModal.vue'
+import uniqueCodeModal from './uniqueCodeModal.vue'
 import { printBase64Fun, exportExcel } from '@/libs/JGPrint.js'
 import { dispatchDetaillListForOut, dispatchFindBySn, dispatchDetailPrint, dispatchDetailExcel } from '@/api/dispatch'
 export default {
-  name: 'detailForOut',
+  name: 'DetailForOut',
   mixins: [commonMixin],
-  components: { STable, VSelect, sendTypeModal, exportExcelModal },
+  components: { STable, VSelect, sendTypeModal, exportExcelModal, uniqueCodeModal },
   props: {
     outBizSubSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
@@ -184,7 +193,8 @@ export default {
       nowPrintType: '', //  当前打印类型
       openExcelModal: false,
       fromRouter: null,
-      nowType: 'print'
+      nowType: 'print',
+      showCodeModal: true
     }
   },
   computed: {
@@ -205,7 +215,7 @@ export default {
         // { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_dispatchDetail_salesPrice')) { //  售价权限
-        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' }, })
+        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       if (this.$hasPermissions('B_dispatchDetail_cityPrice')) { //  市级权限
@@ -281,11 +291,11 @@ export default {
           params.type = params.type + '_STACK_PLACE'
         }
         // 原厂编码
-        if(obj.origCode == 1){
+        if (obj.origCode == 1) {
           params.type = params.type + '_ORIG_CODE'
         }
         // 装箱号
-        if(obj.packNo == 1){
+        if (obj.packNo == 1) {
           params.type = params.type + '_PACK_NUM'
         }
         printBase64Fun(
@@ -293,7 +303,7 @@ export default {
           Object.assign(params, obj || {}),
           type,
           taskName,
-          () => { 
+          () => {
             _this.spinning = false
             _this.$store.state.app.curActionPermission = ''
           },

+ 210 - 0
src/views/salesManagement/pushOrderManagement/uniqueCodeModal.vue

@@ -0,0 +1,210 @@
+<template>
+  <a-modal
+    centered
+    class="unique-code-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    @cancel="isShow=false"
+    width="70%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row type="flex" :gutter="15">
+              <a-col flex="300px">
+                <a-form-item label="产品编码">
+                  <a-input v-model.trim="queryParam.outBizSubNo" allowClear placeholder="请输入产品编码"/>
+                </a-form-item>
+              </a-col>
+              <a-col flex="300px">
+                <a-form-item label="唯一码">
+                  <a-input v-model.trim="queryParam.demanderName" allowClear placeholder="请输入唯一码"/>
+                </a-form-item>
+              </a-col>
+              <a-col flex="300px">
+                <a-form-item label="产品名称">
+                  <a-input v-model.trim="queryParam.demanderName" allowClear placeholder="请输入产品名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col flex="auto">
+                <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>
+        <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData!=null">
+          <div slot="message">
+            <span v-if="$route.params.type!='stockOut'">
+              轮胎款数:<strong>{{ detailData&&(detailData.totalSalesQty || detailData.totalSalesQty==0) ? detailData.totalSalesQty : '--' }}</strong>;
+            </span>
+            轮胎总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
+          </div>
+        </a-alert>
+        <!-- 表格数据 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 400 }"
+          :pageSize="10"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div v-if="!(record.outBizType == 'SALES'&&record.financialStatus=='WAIT')&&record.sendFlag==0">
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="!record.checked"
+                @click="handleChoose(record)"
+              >选择</a-button>
+              <span style="color:#55aa00;" v-else>已选</span>
+            </div>
+            <span style="color:#55aa00;" v-else>
+              {{ record.checked?'已选':'--' }}
+            </span>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { stockOutList } from '@/api/stockOut'
+export default {
+  name: 'SelectGlOrderModal',
+  mixins: [commonMixin],
+  components: { STable },
+  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: '',
+        receiverSn: undefined,
+        warehouseSn: undefined,
+        outBizTypeList: ['SALES', 'ALLOCATE']
+      },
+      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', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'stockOutNo', width: '25%', align: 'center' },
+        { title: '唯一码', dataIndex: 'outBizSubNo', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'demanderName', width: '50%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+    }
+  },
+  methods: {
+    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: '',
+        receiverSn: undefined,
+        warehouseSn: undefined,
+        outBizTypeList: ['SALES', 'ALLOCATE']
+      }
+      this.orginData = []
+      this.$nextTick(() => {
+        this.$refs.dealerSubareaScopeList.resetForm()
+      })
+      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">
+
+</style>