From 0f102473c642142976d537af4c505b8a7161d6c5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 31 十月 2025 15:30:17 +0800
Subject: [PATCH] 原材料报检拆分功能V1
---
src/views/business/rawMaterialInspection/index.vue | 244 ++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 222 insertions(+), 22 deletions(-)
diff --git a/src/views/business/rawMaterialInspection/index.vue b/src/views/business/rawMaterialInspection/index.vue
index d3fa7e4..934c918 100644
--- a/src/views/business/rawMaterialInspection/index.vue
+++ b/src/views/business/rawMaterialInspection/index.vue
@@ -25,8 +25,8 @@
<el-form-item>
<el-button v-if="tabIndex === 3 || tabIndex === 4" :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
style="color: #3A7BFA;" type="text" @click="more = !more">{{ !more ? '鏇村' : '鏀惰捣' }}</el-button>
- <el-button size="mini" icon="el-icon-search" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
- <el-button size="mini" @click="refresh()" icon="el-icon-refresh">閲� 缃�</el-button>
+ <el-button size="mini" type="primary" @click="refreshTable()">鏌ヨ</el-button>
+ <el-button size="mini" @click="refresh()" >閲嶇疆</el-button>
</el-form-item>
</el-row>
<el-row>
@@ -38,7 +38,7 @@
</el-form-item>
<el-form-item label="涓嬪彂鏃堕棿" prop="date" v-if="(tabIndex === 3 || tabIndex === 4) && more">
<el-date-picker v-model="componentData.date" end-placeholder="缁撴潫鏃ユ湡" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡"
- range-separator="鑷�" size="small" start-placeholder="寮�濮嬫棩鏈�" style="width: 100%;" type="daterange"
+ range-separator="鑷�" size="small" start-placeholder="寮�濮嬫棩鏈�" style="width: 100%;" type="daterange" @change="refreshTable()"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
@@ -109,8 +109,8 @@
<el-input v-model="declareObj.partDesc" :disabled="declareType !== 'add'" class="addObj-info" clearable
placeholder="" size="small"></el-input>
</el-form-item>
- <el-form-item class="declareObj-form-item" label="鎶佃揪鐨勯噰璐暟閲�:" prop="qtyArrived">
- <el-input v-model="declareObj.qtyArrived" :disabled="declareType !== 'add'" class="addObj-info" clearable
+ <el-form-item class="declareObj-form-item" label="鎶佃揪鐨勯噰璐暟閲�:" prop="purQtyInStore">
+ <el-input v-model="declareObj.purQtyInStore" :disabled="declareType !== 'add'" class="addObj-info" clearable
placeholder="" size="small"></el-input>
</el-form-item>
<el-form-item v-if="declareType !== 'add'" class="declareObj-form-item" label="渚涘簲鍟嗙紪鍙�:" prop="supplierId">
@@ -173,6 +173,83 @@
<!--鏁版嵁鏌ョ湅寮规-->
<data-look-visible v-if="dataDialogVisible" ref="dataDialogVisible" :dataDialogVisible="dataDialogVisible"
:dataLookInfo="dataLookInfo" @closeDataLook="closeDataLook"></data-look-visible>
+ <el-dialog
+ title="璁㈠崟鎷嗗垎"
+ :visible.sync="orderSplitDialogVisible"
+ :before-close="resetOrderSplitData"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="!confirmSplitOrderLoading"
+ width="60%">
+ <div>
+ <el-divider content-position="left">璁㈠崟涓讳綋</el-divider>
+ <el-table
+ :data="orderSplitBasicData"
+ border
+ :header-cell-style="{textAlign:'center'}"
+ :cell-style="{textAlign:'center'}"
+ >
+ <el-table-column label="璁㈠崟缂栧彿" prop="orderNo" :min-width="100" width="100"></el-table-column>
+ <el-table-column label="闆朵欢缂栧彿" prop="partNo" :min-width="150" width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column label="闆朵欢鎻忚堪" prop="partDesc" :min-width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鎶佃揪鐨勯噰璐暟閲�" prop="purQtyInStore" :min-width="120" width="120"></el-table-column>
+ <el-table-column label="渚涘簲鍟嗙紪鍙�" prop="supplierId" :min-width="100" width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" :min-width="100" width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鎵瑰彿" prop="lotBatchNo" :min-width="100" width="100"></el-table-column>
+ <el-table-column label="鍗曚綅" prop="buyUnitMeas" :min-width="100" width="100"></el-table-column>
+ </el-table>
+ <el-divider content-position="left">鎷嗗垎璇︽儏</el-divider>
+ <el-row>
+ <el-col :span="12">
+ <el-checkbox v-model="pushToMes"><span style="font-weight: bold">鍚屾鍒癕ES</span></el-checkbox>
+ </el-col>
+ <el-col :span="12">
+ <div style="width:100%;text-align: right;margin-bottom:5px">
+ <el-upload
+ style="display:inline-block;margin: 0 8px;"
+ ref="upload"
+ class="upload-demo"
+ :headers="uploadHeader"
+ :action="splitOrderAction"
+ :data="{ifsId:declareObj.id}"
+ :on-change="beforeUpload"
+ :on-error="onError"
+ :on-success="handleSuccess"
+ accept=".xls,.xlsx"
+ :show-file-list="false"
+ :multiple="false">
+ <el-button size="mini" type="primary" :loading="upLoading">瀵煎叆</el-button>
+ </el-upload>
+ <el-button size="mini" type="primary" @click="downloadTemplate">涓嬭浇妯℃澘</el-button>
+ </div>
+ </el-col>
+ </el-row>
+ <el-table
+ :data="orderSplitDetailData"
+ v-loading="detailDataLoading"
+ :header-cell-style="{textAlign:'center'}"
+ :cell-style="{textAlign:'center'}"
+ border>
+ <el-table-column label="闆朵欢缂栧彿" prop="partNo" :min-width="150" width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column label="绯荤粺缂栧彿" prop="systemNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="瑙勬牸" prop="model" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="闆朵欢鎵瑰彿" prop="lotBatchNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="搴撳瓨鏁伴噺1" prop="length" :min-width="100" width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column label="搴撳瓨鏁伴噺2" prop="qtyStock" :min-width="100" width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column label="缁濈紭棰滆壊" prop="insulationColor" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="澶栨姢棰滆壊" prop="outerColor" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鍗板瓧淇℃伅" prop="letteringInfo" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鐩樺彿" prop="drumNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="搴撲綅缂栧彿" prop="locationNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="搴撲綅鏉ユ簮" prop="stockSource" :min-width="90" width="90" show-overflow-tooltip></el-table-column>
+ <el-table-column label="澶囨敞" prop="remark" :min-width="90" show-overflow-tooltip></el-table-column>
+ </el-table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="resetOrderSplitData()" :disabled="confirmSplitOrderLoading">鍙� 娑�</el-button>
+ <el-button type="primary" @click="confirmSplitOrder()" :loading="confirmSplitOrderLoading">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
@@ -186,17 +263,29 @@
getIfsByFinish,
getIfsOrder,
getWarehouseSubmit, inspectionReport, inspectionReportOne, rawAllExport,
- revokeInspectionReport
+ revokeInspectionReport,downloadTemplate,confirmSplitOrder
} from '@/api/business/materialInspection'
import limsTable from "@/components/Table/lims-table.vue";
+import {transformExcel} from '@/utils/file'
export default {
name: 'RawMaterialInspection',
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
components: { limsTable, DataLookVisible },
+ computed:{
+ splitOrderAction(){
+ return this.javaApi + '/rawMaterialOrder/importSplitOrderData'
+ }
+ },
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
+ confirmSplitOrderLoading: false,
+ detailDataLoading: false,
+ pushToMes:false,//鏄惁鍚屾鍒癿es
+ orderSplitDialogVisible: false,
+ orderSplitBasicData:[],//璁㈠崟鎷嗗垎涓讳綋琛ㄦ牸鏁版嵁
+ orderSplitDetailData:[],//璁㈠崟鎷嗗垎璇︽儏琛ㄦ牸鏁版嵁
tableData: [],
tableLoading: false,
column: [
@@ -236,7 +325,7 @@
}
},
{ label: '璁㈠崟鍙�', prop: 'orderNo' },
- { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived', width: '140px', },
+ { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'purQtyInStore', width: '140px', },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
{ label: '闆朵欢鍙�', prop: 'partNo' },
{ label: '闆朵欢鎻忚堪', prop: 'partDesc' },
@@ -265,6 +354,7 @@
{ label: '鎶ユ鏃堕棿', prop: 'declareDate' },
{
dataType: 'action',
+ fixed: 'right',
label: '鎿嶄綔',
operation: [
{
@@ -302,13 +392,12 @@
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableData1: [],
tableLoading1: false,
column1: [
- { label: '濮旀墭缂栧彿', prop: 'entrustCode', width: '160px' },
{
dataType: 'tag',
label: '妫�楠岀姸鎬�',
@@ -345,14 +434,33 @@
}
},
{ label: '璁㈠崟鍙�', prop: 'orderNo' },
- { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' },
- { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
+ { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'purQtyInStore' },
+ { label: '鎶ユ鏃堕棿', prop: 'declareDate' },
{ label: '鎵瑰彿', prop: 'updateBatchNo' },
{ label: '闆朵欢鍙�', prop: 'partNo' },
{ label: '闆朵欢鎻忚堪', prop: 'partDesc' },
{ label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
{ label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
- { label: '鍏嶆', prop: 'isExemption' },
+ {
+ dataType: 'tag',
+ label: '鍏嶆',
+ prop: 'isExemption',
+ formatData: (params) => {
+ if (params == 1) {
+ return '鍏嶆'
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 1) {
+ return 'success'
+ } else {
+ return null
+ }
+ }
+ },
+ { label: '濮旀墭缂栧彿', prop: 'entrustCode', width: '160px' },
{ label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
{ label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
{ label: '妫�楠屼汉', prop: 'userName' },
@@ -377,7 +485,7 @@
},
{ label: '鍗曚綅', prop: 'buyUnitMeas' },
{ label: '鎺ユ敹鏃堕棿', prop: 'receiverDate' },
- { label: '鎶ユ鏃堕棿', prop: 'declareDate' },
+ { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
{
dataType: 'action',
fixed: 'right',
@@ -424,7 +532,7 @@
],
page1: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
more: false,
@@ -433,7 +541,7 @@
orderNo: '', // 璁㈠崟鍙�
partNo: '', // 闆朵欢鍙�
partDesc: '', // 闆朵欢鎻忚堪
- qtyArrived: '', // 鎶佃揪鐨勯噰璐暟閲�
+ purQtyInStore: '', // 鎶佃揪鐨勯噰璐暟閲�
supplierId: '', // 渚涘簲鍟嗙紪鍙�
supplierName: '', // 渚涘簲鍟嗗悕绉�
updateBatchNo: '', // 鎵瑰彿
@@ -471,7 +579,7 @@
partDesc: [
{ required: true, message: '璇峰~鍐欓浂浠舵弿杩�', trigger: 'blur' }
],
- qtyArrived: [
+ purQtyInStore: [
{ required: false, message: '璇峰~鍐欐姷杈剧殑閲囪喘鏁伴噺', trigger: 'blur' }
],
supplierName: [
@@ -518,7 +626,8 @@
{ label: '鏈笅鍗�', value: 3 },
{ label: '璁╂鏀捐', value: 4 },
],
- outLoading: false
+ outLoading: false,
+ upLoading: false,
}
},
mounted() {
@@ -526,6 +635,85 @@
},
// 鏂规硶闆嗗悎
methods: {
+ resetOrderSplitData(){
+ this.orderSplitBasicData = []
+ this.orderSplitDetailData = []
+ this.pushToMes = false
+ this.$nextTick(()=>{
+ this.confirmSplitOrderLoading = false
+ this.orderSplitDialogVisible = false
+ this.refreshTable()
+ })
+ },
+ confirmSplitOrder(){
+ if(this.orderSplitDetailData.length===0){
+ this.$message.error('璇峰厛瀵煎叆鎷嗗垎鏁版嵁')
+ return
+ }
+ this.confirmSplitOrderLoading = true
+ let requestData = {
+ ifsId: this.declareObj.id,
+ splitDetailList: this.orderSplitDetailData,
+ pushToMes: this.pushToMes
+ }
+ confirmSplitOrder(requestData).then(res=>{
+ if(res.code===200 && res.data){
+ this.$message.success('璁㈠崟鎷嗗垎鎴愬姛')
+ }else if(this.pushToMes && res.code===200 && !res.data){
+ this.$message.success('璁㈠崟鎷嗗垎鎴愬姛,鍚屾MES澶辫触锛岃鑱旂郴绠$悊鍛�')
+ } else {
+ let msg = res.msg || res.message
+ this.$message({
+ message: '璁㈠崟鎷嗗垎澶辫触: '+msg,
+ dangerouslyUseHTMLString: true,
+ type: 'error'
+ });
+ }
+ this.resetOrderSplitData()
+ }).catch(error=>{
+ console.error(error)
+ this.confirmSplitOrderLoading = false
+ })
+ },
+ handleSuccess(response) {
+ if (response.code === 200) {
+ this.$message.success('涓婁紶鎴愬姛');
+ this.orderSplitDetailData = response.data
+ } else {
+ let msg = response.msg || response.message
+ this.$message({
+ message: '涓婁紶澶辫触: '+msg,
+ dangerouslyUseHTMLString: true,
+ type: 'error'
+ });
+ }
+ this.$nextTick(()=>{
+ this.upLoading = false;
+ this.detailDataLoading = false
+ })
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触: '+err)
+ this.$refs.upload.clearFiles()
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ this.upLoading = true;
+ this.detailDataLoading = true
+ return true;
+ }
+ },
+ downloadTemplate(){
+ downloadTemplate().then(res=>{
+ transformExcel(res,'璁㈠崟鎷嗗垎瀵煎叆妯℃澘.xlsx')
+ }).catch(error=>{
+ console.error(error)
+ })
+ },
// 鍒囨崲tab琛ㄦ牸
handleTab(m) {
this.tabIndex = m;
@@ -719,8 +907,21 @@
// 鎵撳紑鎶ユ纭寮规
declare(row) {
this.declareObj = { ...row }
- this.declareDialogVisible = true
this.declareType = 'edit'
+ if(row.updateBatchNo && row.updateBatchNo==='*'){
+ this.$confirm('鏄惁瑕佹媶鍒嗚璁㈠崟?', '鎻愮ず', {
+ confirmButtonText: '鏄�',
+ cancelButtonText: '鍚�',
+ type: 'warning'
+ }).then(() => {
+ this.orderSplitBasicData = [row]
+ this.orderSplitDialogVisible = true
+ }).catch(() => {
+ this.declareDialogVisible = true
+ });
+ }else{
+ this.declareDialogVisible = true
+ }
},
// 鎻愪氦鎶ユ
submitDeclare() {
@@ -793,6 +994,7 @@
openIFS() {
this.btnLoading = true
getIfsOrder().then(res => {
+ this.resetForm('componentData')
this.refreshTable()
this.btnLoading = false
}).catch(err => {
@@ -802,11 +1004,9 @@
},
// 鍏ㄩ儴瀵煎嚭
handleDown() {
- let entity = { ...this.componentData }
- delete entity.orderBy
this.outLoading = true
rawAllExport({
- entity: entity
+ ...this.componentData
}).then(res => {
this.outLoading = false
const blob = new Blob([res], { type: 'application/octet-stream' });
@@ -819,7 +1019,7 @@
orderNo: '', // 璁㈠崟鍙�
partNo: '', // 闆朵欢鍙�
partDesc: '', // 闆朵欢鎻忚堪
- qtyArrived: '', // 鎶佃揪鐨勯噰璐暟閲�
+ purQtyInStore: '', // 鎶佃揪鐨勯噰璐暟閲�
supplierId: '', // 渚涘簲鍟嗙紪鍙�
supplierName: '', // 渚涘簲鍟嗗悕绉�
updateBatchNo: '', // 鎵瑰彿
--
Gitblit v1.9.3