From 6d44d9fd513442c9aff8c17cd8cce97ada1efc44 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 25 二月 2025 11:06:21 +0800
Subject: [PATCH] 成品抽样搬迁

---
 src/components/Table/lims-table.vue                                      |    6 
 src/views/business/finishedProductSampling/index.vue                     |  448 ++++++++++++++++++++++++++++++++
 src/views/business/finishedProductSampling/components/addQuarterItem.vue |  296 +++++++++++++++++++++
 src/api/business/finishedProductSampling.js                              |   35 ++
 4 files changed, 783 insertions(+), 2 deletions(-)

diff --git a/src/api/business/finishedProductSampling.js b/src/api/business/finishedProductSampling.js
new file mode 100644
index 0000000..e2de844
--- /dev/null
+++ b/src/api/business/finishedProductSampling.js
@@ -0,0 +1,35 @@
+// 鎴愬搧鎶芥牱璇︽儏椤甸潰鐩稿叧鎺ュ彛
+import request from '@/utils/request'
+
+// 鍘熸潗鏂欐牴鎹甶d鎶ユ
+export function getIfsStock(query) {
+  return request({
+    url: '/finishProductSpotCheck/getIfsStock',
+    method: 'post',
+    data: query
+  })
+}
+// 瀛e害鎶芥鏌ョ湅璇︽儏
+export function getQuarter(query) {
+  return request({
+    url: '/finishProductSpotCheck/getQuarter',
+    method: 'get',
+    params: query
+  })
+}
+// 鎻愪氦瀛e害鎶芥牱
+export function addQuarter(query) {
+  return request({
+    url: '/finishProductSpotCheck/addQuarter',
+    method: 'post',
+    data: query
+  })
+}
+// 缂栬緫瀛e害妫�楠�
+export function updateQuarterOnOrder(query) {
+  return request({
+    url: '/finishProductSpotCheck/updateQuarterOnOrder',
+    method: 'post',
+    data: query
+  })
+}
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 05e1d85..bd77bc9 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -64,7 +64,8 @@
           <!-- 鎸夐挳 -->
           <div v-else-if="item.dataType == 'action'">
             <template v-for="(o, key) in item.operation">
-              <el-button v-if="o.type != 'upload'" size="mini" v-show="o.showHide ? o.showHide(scope.row) : true"
+              <el-button v-show="o.type != 'upload'" size="mini"
+                         v-if="o.showHide ? o.showHide(scope.row) : true"
                 :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
                 :style="{ color: o.name === '鍒犻櫎' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)"
                 @click="o.clickFun(scope.row)" :key="key">
@@ -79,7 +80,8 @@
                 :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
                   ? o.accept
                   : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
-                  " v-if="o.type == 'upload'" style="display: inline-block; width: 50px"
+                  "
+                v-if="o.type == 'upload'" style="display: inline-block; width: 50px"
                 v-show="o.showHide ? o.showHide(scope.row) : true"
                 :headers="uploadHeader"
                 :on-error="onError"
diff --git a/src/views/business/finishedProductSampling/components/addQuarterItem.vue b/src/views/business/finishedProductSampling/components/addQuarterItem.vue
new file mode 100644
index 0000000..63e6888
--- /dev/null
+++ b/src/views/business/finishedProductSampling/components/addQuarterItem.vue
@@ -0,0 +1,296 @@
+<template>
+  <div>
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="quarterSampleDia" title="瀛e害鎶芥牱" width="90%" @close="quarterSampleDia = false">
+      <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
+        <div style="width: 30%;display: flex;align-items: center;" >
+          <span style="width: 50px">缂栧彿锛�</span>
+          <el-input v-model="quarterSampleForm.quarterNo" :disabled="operationType !== 'add'" size="small"></el-input>
+        </div>
+        <div v-if="operationType === 'add'">
+          <el-button size="small" type="primary" @click="addQuarter">娣诲姞</el-button>
+          <el-button size="small" type="danger" @click="clearTable">娓呯┖</el-button>
+        </div>
+      </div>
+      <div>
+        <el-table v-loading="tableLoading" :data="quarterItems" border height="420" style="width: 100%">
+          <el-table-column label="浜у搧绫诲瀷" prop="productType" width="200">
+            <template slot-scope="{row}">
+              <template>
+                <el-input v-model="row.productType" size="small"/>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column label="璐d换浜�" prop="dutyUser" width="100"></el-table-column>
+          <el-table-column label="鍨嬪彿" prop="productModel" width="120">
+            <template slot-scope="{row}">
+              <template>
+                <el-input v-model="row.productModel" size="small" :disabled="operationType === 'view'"/>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column label="鎶芥牱鏁伴噺" min-width="340" prop="spotCheckNumber">
+            <template slot-scope="{row}">
+              <template>
+                <el-input v-model="row.spotCheckNumber" size="small" :disabled="operationType === 'view'"/>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="operationType === 'add'" label="鏁伴噺" min-width="120" prop="number">
+            <template slot-scope="{row}">
+              <template>
+                <el-input v-model="row.number" size="small" :disabled="operationType === 'view'"/>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="operationType !== 'add'" label="鎶芥牱鏃堕棿" prop="spotCheckTime" width="160">
+            <template slot-scope="{row}">
+              <template>
+                <el-date-picker v-model="row.spotCheckTime"
+                                format="yyyy-MM-dd"
+                                :disabled="operationType === 'view'"
+                                placeholder="閫夋嫨鏃ユ湡"
+                                size="small"
+                                clearable
+                                style="width:100%"
+                                type="date"
+                                value-format="yyyy-MM-dd">
+                </el-date-picker>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="operationType !== 'add'" label="璇曟牱缁撹" prop="result" width="130">
+            <template v-slot="scope">
+              <el-select v-model="scope.row.result" placeholder="璇烽�夋嫨" size="small" clearable :disabled="operationType === 'view'">
+                <el-option label="鍚堟牸" value="鍚堟牸"></el-option>
+                <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�"></el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="operationType !== 'add'" label="鍙栨牱浜哄憳" prop="samplingUser" width="120">
+            <template slot-scope="{row}">
+              <template>
+                <el-input v-model="row.samplingUser" size="small" :disabled="operationType === 'view'"/>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column label="澶囨敞" prop="itemRemark" width="200">
+            <template slot-scope="{row}">
+              <template>
+                <el-input v-model="row.itemRemark" size="small" :disabled="operationType === 'view'"/>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="operationType !== 'view'" fixed="right" label="鎿嶄綔" width="100">
+            <template slot-scope="scope">
+              <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">鍒犻櫎</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div style="display: flex;align-items: center;margin: 10px 0">
+        <span style="width: 70px">澶囨敞锛�</span>
+        <el-input v-model="quarterSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 43%" type="textarea"></el-input>
+      </div>
+      <div v-if="operationType !== 'add'">
+        <el-form ref="form" :model="editForm" label-width="70px">
+          <el-col :span="12">
+            <el-form-item label="缂栧埗浜猴細">
+              <el-select v-model="editForm.writeUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+                <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="浼氱浜猴細">
+              <el-select v-model="editForm.countersignUser" :disabled="operationType !=='edit'" multiple placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+                <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="瀹℃牳浜猴細">
+              <el-select v-model="editForm.examineUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+                <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鎵瑰噯浜猴細">
+              <el-select v-model="editForm.ratifyUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+                <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </div>
+      <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer">
+        <el-button v-if="operationType !== 'add'" @click="quarterSampleDia = false">鍙� 娑�</el-button>
+        <el-button v-if="operationType === 'add'" @click="quarterSampleDia = false">淇� 瀛�</el-button>
+        <el-button type="primary" @click="handleSample">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {addQuarter, getQuarter, updateQuarterOnOrder} from "@/api/business/finishedProductSampling";
+import {selectUserCondition} from "@/api/business/inspectionTask";
+import {mapGetters} from "vuex";
+
+export default {
+  name: "addQuarterItem",
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      tableLoading: false,
+      quarterSampleDia: false, // 瀛e害鎶芥牱寮规
+      quarterSampleForm: {
+        quarterNo: '', // 缂栧彿
+      },
+      quarterItems: [],
+      quarterTemItems: [],
+      operationType: '',
+      editForm: {
+        quarterId: '',
+        writeUser: '', // 缂栧埗浜�
+        countersignUser: [], // 浼氱浜�
+        examineUser: '', // 瀹℃牳浜�
+        ratifyUser: '', // 鎵瑰噯浜�
+      },
+      userList: [],
+      quarterRow: {},
+    }
+  },
+  computed: {
+    ...mapGetters(["nickName"]),
+  },
+  mounted() {
+    this.getUserList()
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    openDia (quarterTemItems, type) {
+      this.quarterSampleDia = true
+      this.operationType = type
+      if (type === 'add') {
+        if (quarterTemItems.length > 0) {
+          this.quarterItems = quarterTemItems
+        }
+        this.quarterSampleForm.quarterNo = getCurrentMonthTwoDigits()
+      } else {
+        this.tableLoading = true
+        this.quarterRow = quarterTemItems
+        getQuarter({quarterId: quarterTemItems.quarterId}).then(res => {
+          this.tableLoading = false
+          if (res.code === 200) {
+            this.quarterItems = res.data.quarterItems
+            this.quarterSampleForm.quarterNo = res.data.quarterNo
+            this.quarterSampleForm.remark = res.data.remark
+            this.editForm.quarterId = res.data.quarterId
+            this.editForm.writeUser = res.data.writeUser
+            this.editForm.examineUser = res.data.examineUser
+            this.editForm.ratifyUser = res.data.ratifyUser
+            if (res.data.countersignUser) {
+              this.editForm.countersignUser = res.data.countersignUser.split(",").map(Number)
+            }
+          }
+        }).catch(err => {
+          this.tableLoading = false
+        })
+      }
+    },
+    // 鎵嬪姩娣诲姞
+    addQuarter () {
+      this.quarterItems.push({
+        productType: '',
+        dutyUser: this.nickName,
+        productModel: '',
+        spotCheckNumber: '',
+        number: '',
+        spotCheckTime: '',
+        result: '',
+        samplingUser: '',
+        itemRemark: '',
+      })
+    },
+    // 鎻愪氦瀛e害鎶芥牱
+    handleSample () {
+      this.$confirm('鏄惁鎻愪氦璇ユ暟鎹�', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        if (this.operationType === 'add') {
+          this.quarterSampleForm.quarterItems = JSON.parse(JSON.stringify(this.quarterItems))
+          this.quarterSampleForm.quarterItems.forEach(item => {
+            item.spotCheckNumber = item.spotCheckNumber + ' ' + (item.number == null ? "" : item.number)
+          })
+          addQuarter(this.quarterSampleForm).then(res => {
+            if (res.code == 200) {
+              this.$message.success('鎻愪氦鎴愬姛')
+              this.quarterItems = []
+              this.$parent.quarterTemItems = []
+              this.closeQuarterSampleDia()
+            }
+          })
+        } else {
+          const params = {...this.editForm}
+          if (params.countersignUser.length > 0) {
+            params.countersignUser = params.countersignUser.join(',')
+          } else {
+            params.countersignUser = ''
+          }
+          params.quarterItems = JSON.parse(JSON.stringify(this.quarterItems))
+          updateQuarterOnOrder(params).then(res => {
+            if (res.code == 200) {
+              this.$message.success('鎻愪氦鎴愬姛')
+              this.quarterItems = []
+              this.closeQuarterSampleDia()
+            }
+          })
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑�'
+        });
+      });
+
+    },
+    // 娓呯┖鎶芥牱璁″垝
+    clearTable () {
+      this.quarterItems = []
+      this.$parent.quarterTemItems = []
+    },
+    // 鎵嬪姩鍒犻櫎
+    deleteScope (index) {
+      this.quarterItems.splice(index, 1)
+    },
+    // 鍏抽棴瀛e害鎶芥牱寮规
+    closeQuarterSampleDia () {
+      this.quarterSampleDia = false
+      if (this.operationType === 'add') {
+        this.$parent.handleStockList()
+      } else {
+        this.$parent.refreshTable('page')
+      }
+    },
+    getUserList(){
+      selectUserCondition({ type: 0 }).then((res) => {
+        this.userList = res.data;
+      })
+    },
+  },
+}
+function getCurrentMonthTwoDigits() {
+  const currentDate = new Date();
+  const year = currentDate.getFullYear();
+  const currentMonth = currentDate.getMonth() + 1;
+  return year + currentMonth.toString().padStart(2, '0');
+}
+</script>
+
+<style scoped>
+</style>
diff --git a/src/views/business/finishedProductSampling/index.vue b/src/views/business/finishedProductSampling/index.vue
new file mode 100644
index 0000000..b4f9986
--- /dev/null
+++ b/src/views/business/finishedProductSampling/index.vue
@@ -0,0 +1,448 @@
+<!--鎴愬搧鎶芥牱椤甸潰-->
+<template>
+  <div style="padding: 10px 0">
+    <div class="card">
+      <div class="title">
+        <el-button size="small" type="primary" @click="addTemQuarter">鏂板</el-button>
+        <el-button size="small" type="primary" @click="quarterSample">瀛e害鎶芥牱</el-button>
+        <el-button size="small" type="primary" @click="handleStockList">鍒锋柊</el-button>
+      </div>
+      <el-table
+        ref="finishedproducttransferTable"
+        v-loading="tableLoading"
+        :data="stockList"
+        :header-cell-style="lineSideWarehouseTableHeaderCellStyle"
+        :row-class-name="lineSideWarehouseTableRowClassName"
+        class="finishedproducttransfer-table"
+        height="calc(100vh - 240px)"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="45"></el-table-column>
+        <el-table-column
+          :show-overflow-tooltip="true"
+          align="center"
+          label="瀹㈡埛璁㈠崟缂栧彿"
+          prop="customerOrderNo"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">瀹㈡埛璁㈠崟缂栧彿</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.customerOrderNo"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.customerOrderNo }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="鎴愬搧闆朵欢鍙�"
+          prop="partNo"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">鎴愬搧闆朵欢鍙�</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.partNo"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.partNo }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="闆朵欢鍚嶇О"
+          prop="partName"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">闆朵欢鍚嶇О</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.partName"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.partName }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :show-overflow-tooltip="true"
+          align="center"
+          label="浠撳簱"
+          prop="warehouseName"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">浠撳簱</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.warehouseName"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.warehouseName }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :show-overflow-tooltip="true"
+          align="center"
+          label="搴撲綅鍙�"
+          prop="locationNo"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">搴撲綅鍙�</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.locationNo"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.locationNo }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :show-overflow-tooltip="true"
+          align="center"
+          label="搴撲綅鍚嶇О"
+          prop="locationName"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">搴撲綅鍚嶇О</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.locationName"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.locationName }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="鎵规鍙�"
+          prop="partBatchNo"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">鎵规鍙�</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.partBatchNo"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.partBatchNo }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="鍏ュ簱鏉ユ簮"
+          prop="inSource"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">鍏ュ簱鏉ユ簮</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.inSource"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.inSource }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="澶栨姢棰滆壊"
+          prop="outerColor"
+          width="140"
+        >
+          <template slot="header" slot-scope="scope">
+            <div style="line-height: 14px;margin-bottom: 6px">澶栨姢棰滆壊</div>
+            <div class="th" @click.stop>
+              <el-input
+                v-model="queryParamOne.outerColor"
+                clearable
+                size="mini"
+                type="text"
+                @clear="handleStockList"
+                @keyup.enter.native="handleStockList"
+              ></el-input>
+            </div>
+          </template>
+          <template slot-scope="scope">
+            <span>{{ scope.row.outerColor }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="搴撳瓨鏁伴噺"
+          prop="stockQuantity"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="鍙敤搴撳瓨鏁伴噺"
+          prop="availableStockQuantity"
+          width="140"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.availableStockQuantity }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagin-page" style="margin-top: 0;margin-bottom: 0;">
+        <el-pagination
+          background
+          :current-page="queryReport.current"
+          :page-size="queryReport.size"
+          :page-sizes="[10, 15, 20, 50, 100]"
+          :total="queryReport.total"
+          layout="total, sizes, prev, pager, next, jumper"
+          style="text-align:right;padding: 20px 16px;"
+          @size-change="handleSizeChangeReport"
+          @current-change="handleCurrentChangeReport"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <add-quarter-item ref="addQuarterItem"></add-quarter-item>
+  </div>
+</template>
+
+<script>
+
+import AddQuarterItem from "./components/addQuarterItem.vue";
+import {getIfsStock} from "@/api/business/finishedProductSampling";
+import {mapGetters} from "vuex";
+
+export default {
+  data() {
+    return {
+      stockList: [],
+      queryParamOne: {
+        partNo: null,
+        partName: null,
+        warehouseName: null,
+        locationName: null,
+        locationNo: null,
+        partBatchNo: null,
+        stockQuantity: null,
+        availableStockQuantity: null,
+        outerColor: null,
+        customerOrderNo: null,
+        inSource: null,
+      },
+      queryReport: {
+        current: 1,
+        size: 20,
+        total: 0
+      },
+      tableLoading: false,
+      multipleSelection: [], // table鎵�閫変腑鐨勫璞�
+      showEditForm: false,
+      showMoveForm: false,
+      showMoveAllForm: false,
+      erpfinishstock: {},
+      isAvaliable: false,
+      isPackage: false,
+      quarterTemItems: [],
+      operationType: ''
+    }
+  },
+  components: {AddQuarterItem},
+  mounted() {
+    this.getIfsStock()
+  },
+  updated() {
+    this.$nextTick(() => {
+      this.$refs.finishedproducttransferTable.doLayout()
+    })
+  },
+  computed: {
+    ...mapGetters(["nickName"]),
+  },
+  methods: {
+    // 瀛e害鎶芥牱
+    quarterSample () {
+      this.$refs.addQuarterItem.openDia(this.quarterTemItems, 'add')
+    },
+    addTemQuarter () {
+      if (this.multipleSelection.length > 0) {
+        const multipleSelection = JSON.parse(JSON.stringify(this.multipleSelection))
+        if (multipleSelection.length > 0) {
+          multipleSelection.forEach(item => {
+            if (item.partName.includes(' ')) {
+              const list = item.partName.match(/^(\S+)\s(.*)/).slice(1)
+              console.log('list', list)
+              item.productType = list[0]
+              item.spotCheckNumber = list[1]
+            }
+            item.dutyUser = this.nickName
+            item.itemRemark = item.partBatchNo;
+            this.quarterTemItems.push(item)
+          })
+        }
+        this.$message.success('鏆傚瓨鎴愬姛')
+        this.$refs.finishedproducttransferTable.clearSelection()
+      } else {
+        this.$message.warning('璇烽�夋嫨鏁版嵁')
+      }
+    },
+    // 鑾峰彇鏁版嵁鍒楄〃
+    getIfsStock() {
+      this.tableLoading = true
+      this.stockList = []
+      const newReqParam = this.getFinalParam()
+      getIfsStock(newReqParam)
+        .then((response) => {
+          const resData = response.data
+          this.queryReport.total = resData.total
+          const resStockList = resData.data
+          resStockList.forEach((item) => {
+            this.stockList.push({
+              partNo: item.PART_NO,
+              partName: item.PART_DESC,
+              warehouseName: item.WAREHOUSE_ID,
+              locationName: item.LOCATION_DESC,
+              locationNo: item.LOCATION_NO,
+              partBatchNo: item.LOT_BATCH_NO,
+              stockQuantity: item.QTY_ONHAND,
+              availableStockQuantity: item.QTY_AVAILABLE,
+              outerColor: item.ATTR4,
+              customerOrderNo: item.ATTR6,
+              inSource: item.ATTR23,
+            })
+          })
+          this.tableLoading = false
+        })
+        .catch(() => {
+          this.tableLoading = false
+        })
+    },
+    getFinalParam() {
+      const newReqParam = {
+        partNo: this.queryParamOne.partNo,
+        partDescription: this.queryParamOne.partName,
+        warehouse: this.queryParamOne.warehouseName
+          ? this.queryParamOne.warehouseName + '%'
+          : null,
+        locDesc: this.queryParamOne.locationName,
+        locNo: this.queryParamOne.locationNo,
+        lotBatchNo: this.queryParamOne.partBatchNo,
+        quantityFlag: this.queryParamOne.stockQuantity,
+        outerColor: this.queryParamOne.outerColor,
+        otcOrderNo: this.queryParamOne.customerOrderNo,
+        availableStockQuantity: this.queryParamOne.availableStockQuantity,
+        inSource: this.queryParamOne.inSource,
+        page: this.queryReport.current,
+        limit: this.queryReport.size
+      }
+      return newReqParam
+    },
+    lineSideWarehouseTableHeaderCellStyle({row, column, rowIndex, columnIndex}) {
+      let headerStyle = 'background:#FAFAFA;color:#666;'
+      if (columnIndex === 0) {
+        headerStyle += 'border-radius: 6px 0px 0px 0px;'
+      } else if (columnIndex === 13) {
+        headerStyle += 'border-radius: 0px 6px 0px 0px;'
+      }
+      return headerStyle
+    },
+    lineSideWarehouseTableRowClassName({ row, rowIndex }) {
+      if (rowIndex % 2 === 1) {
+        return 'stripe-row'
+      } else {
+        return ''
+      }
+    },
+    handleSizeChangeReport(val) {
+      this.queryReport.size = val
+      this.queryReport.current = 1
+      this.getIfsStock()
+    },
+    handleCurrentChangeReport(val) {
+      this.queryReport.current = val
+      this.getIfsStock()
+    },
+    handleStockList() {
+      this.queryReport.current = 1
+      this.getIfsStock()
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    }
+  }
+}
+</script>
+
+<style scoped>
+>>>.el-table__header {
+  height: 70px;
+}
+.card {
+  height: calc(100% - 40px);
+  background: #ffffff;
+  padding: 10px;
+}
+.title {
+  text-align: right;
+  margin-bottom: 10px;
+}
+</style>

--
Gitblit v1.9.3