From 6208ba6872cc54ccbd2b2ff3b67a1a2f054af41d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 19 九月 2023 14:52:15 +0800
Subject: [PATCH] 1.生产入库实现
---
src/views/scgl/scrk.vue | 1403 +++++++++++++++++++++++++++++++++++++++++++++++++++
vue.config.js | 4
src/main.js | 4
src/views/scgl/sckbg.vue | 62 ++
src/api/jcsz.js | 31 +
src/layout/components/Sidebar/index.vue | 2
src/api/scgl.js | 36 +
src/router/index.js | 6
src/utils/global.js | 24
src/api/xtsz.js | 8
10 files changed, 1,572 insertions(+), 8 deletions(-)
diff --git a/src/api/jcsz.js b/src/api/jcsz.js
index 6fa81e2..2b6f176 100644
--- a/src/api/jcsz.js
+++ b/src/api/jcsz.js
@@ -230,3 +230,34 @@
params: data
})
}
+// 鑾峰彇AppTicket
+export function AppTicketSelect() {
+ return request({
+ url: 'Message/AppTicketSelect',
+ method: 'get'
+ })
+}
+
+// ERP鐢熶骇杞﹂棿/閮ㄩ棬淇℃伅鏌ヨ
+export function ErpWkshopDepartmentSelect() {
+ return request({
+ url: 'BaseDate/ErpWkshopDepartmentSelect',
+ method: 'get'
+ })
+}
+
+// ERP鐢熶粨搴撲俊鎭煡璇�
+export function ErpWarehouseSelect() {
+ return request({
+ url: 'BaseDate/ErpWarehouseSelect',
+ method: 'get'
+ })
+}
+
+// ERP鐢熺敤鎴蜂俊鎭煡璇�
+export function ErpUserSelect() {
+ return request({
+ url: 'BaseDate/ErpUserSelect',
+ method: 'get'
+ })
+}
diff --git a/src/api/scgl.js b/src/api/scgl.js
index 102dee4..5c4ebb8 100644
--- a/src/api/scgl.js
+++ b/src/api/scgl.js
@@ -252,3 +252,39 @@
data
})
}
+
+// 鐢熶骇鍏ュ簱淇℃伅鏌ヨ
+export function ProductInHouseOrderSearch(data) {
+ return request({
+ url: 'ProductionManagement/ProductInHouseOrderSearch',
+ method: 'get',
+ params: data
+ })
+}
+
+// 鐢熶骇鍏ュ簱鑾峰彇鍗曟嵁鍙�
+export function ProductInHouseOrderCodeSearch(data) {
+ return request({
+ url: 'ProductionManagement/ProductInHouseOrderCodeSearch',
+ method: 'post',
+ params: data
+ })
+}
+
+// 鎻愪氦
+export function ProductInHouseOrderSeave(data) {
+ return request({
+ url: 'ProductionManagement/ProductInHouseOrderSeave',
+ method: 'post',
+ data
+ })
+}
+
+// 鐢熶骇鍏ュ簱閫氳繃杞﹂棿鏌ユ壘鐢熶骇璁㈠崟
+export function ProductInHouseWkshopOrder(data) {
+ return request({
+ url: 'ProductionManagement/ProductInHouseWkshopOrder',
+ method: 'get',
+ params: data
+ })
+}
diff --git a/src/api/xtsz.js b/src/api/xtsz.js
index dc37f10..abf04af 100644
--- a/src/api/xtsz.js
+++ b/src/api/xtsz.js
@@ -52,3 +52,11 @@
params: data
})
}
+// 鐢熸垚绯荤粺鏉$爜(鑷畾涔�)
+export function LabelBarCode(data) {
+ return request({
+ url: 'SystemSetting/LabelBarCode',
+ method: 'get',
+ params: data
+ })
+}
diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue
index 727bd6d..d210bd7 100644
--- a/src/layout/components/Sidebar/index.vue
+++ b/src/layout/components/Sidebar/index.vue
@@ -28,7 +28,7 @@
</el-scrollbar>
<div style="position: absolute;bottom: 20px;left: 30px;">
<div>
- <el-button v-if="$store.state.app.sidebar.opened" type="text" style="font-size: 14px;cursor: pointer">鏂板嚡杩埗閫燰1.0.01</el-button>
+ <el-button v-if="$store.state.app.sidebar.opened" type="text" style="font-size: 14px;cursor: pointer">鏂板嚡杩埗閫燰1.3.21</el-button>
<!-- <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">鏂板嚡杩埗閫燰1.0.01</a></el-button>-->
</div>
</div>
diff --git a/src/main.js b/src/main.js
index 099145e..68fc163 100644
--- a/src/main.js
+++ b/src/main.js
@@ -43,6 +43,10 @@
Vue.prototype.$headerCellStyle = headerCellStyle() // 璁剧疆鍏ㄥ眬琛ㄥご鏍峰紡
Vue.prototype.$cellStyle = cellStyle() // 璁剧疆鍏ㄥ眬琛ㄤ綋鏍峰紡
+Vue.prototype.$chanjetBaseUrl = 'https://openapi.chanjet.com'
+Vue.prototype.$AppKey = 'Umm1gS5q'
+Vue.prototype.$AppSecret = 'FFAD54C4FBF9AAF1AFA33BBF3DF52752'
+
// import 'lib-flexible' // 闃块噷鍙几缂╁竷灞�鏂规
// import 'lib-flexible-computer'
diff --git a/src/router/index.js b/src/router/index.js
index 7346650..45b4c52 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -458,6 +458,12 @@
code: '1074',
component: () => import('@/views/scgl/gdplgb'),
meta: { code: '1074', title: 'MES宸ュ崟鎵归噺鍏抽棴', icon: '', keepAlive: true }
+ }, {
+ path: 'scrk',
+ name: 'SCRKCancel',
+ code: '1077',
+ component: () => import('@/views/scgl/scrk'),
+ meta: { code: '1077', title: '鐢熶骇鍏ュ簱', icon: '', keepAlive: true }
}
]
},
diff --git a/src/utils/global.js b/src/utils/global.js
index dedc120..3b4889c 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -1,4 +1,7 @@
import { NewEncodingRules } from '@/api/xtsz'
+import axios from 'axios'
+import Vue from 'vue'
+import { AppTicketSelect } from '@/api/jcsz'
// 鍏ㄥ眬涓昏棰滆壊
export function getGlobalColor() {
@@ -91,3 +94,24 @@
}
}
}
+
+// 鑾峰彇token 鐢ㄤ簬璇锋眰鐣呮嵎閫氭帴鍙�
+export async function getTPlusToken() {
+ const r1 = await AppTicketSelect()
+ const r2 = r1.data[0]
+ Vue.prototype.$AppKey = r2.appKey
+ Vue.prototype.$AppSecret = r2.appSecret
+ const data = {
+ appTicket: r2.AppTicket,
+ certificate: r2.certificate
+ }
+ const r3 = await axios.post(Vue.prototype.$chanjetBaseUrl + '/v1/common/auth/selfBuiltApp/generateToken',
+ data, {
+ headers: {
+ 'appKey': Vue.prototype.$AppKey,
+ 'appSecret': Vue.prototype.$AppSecret,
+ 'Content-Type': 'application/json'
+ }
+ })
+ return r3.data.value.accessToken
+}
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index a58e108..905a31d 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -1173,6 +1173,7 @@
import QRCode from 'qrcodejs2'
import { getCookie } from '@/utils/auth'
import { handleDatetime2 } from '@/utils/global'
+import { LabelBarCode } from '@/api/xtsz'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -1266,6 +1267,8 @@
reportuser: '', // 鎶ュ伐浜哄憳
startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
+
+ inbarcode: '',
operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
remarks: ''// 澶囨敞
@@ -1699,7 +1702,7 @@
this.dialogForm.startqty = obj.noreportqty
this.dialogForm.nextstepname = obj.nextstepname
- this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
+ this.dialogForm.nextstepcode = obj.nextstepcode
this.dialogForm.startqtySum = obj.noreportqty
})
@@ -1760,7 +1763,7 @@
this.dialogForm.stepcode = obj.stepcode
this.dialogForm.nextstepname = obj.nextstepname
- this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
+ this.dialogForm.nextstepcode = obj.nextstepcode
this.dialogForm.noputqty = obj.noputqty
this.dialogForm.stepseq = obj.seq
@@ -1900,6 +1903,7 @@
},
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
+ this.dialogForm.inbarcode = ''
this.judgeIsScanningArr = []
this.form.orderstepqrcode = ''
this.WXform.orderstepqrcode = ''
@@ -1953,7 +1957,7 @@
},
// 瀵硅瘽妗嗙‘璁�
dialogVisibleConfirm() {
- this.$refs.dialogForm.validate(valid => {
+ this.$refs.dialogForm.validate(async valid => {
if (valid) {
// this.$store.state.app.buttonIsDisabled = true
if (this.dialogTitle === '澶栧崗鍙戞枡') {
@@ -1993,6 +1997,19 @@
return this.$message.info('璇烽�夋嫨涓嶈壇鍘熷洜锛�')
}
}
+ this.dialogForm.inbarcode = ''
+ if (this.dialogForm.nextstepcode === '') {
+ const D = {
+ rightcode: '1078',
+ partcode: this.dialogForm.partcode,
+ qty: this.dialogForm.sqty,
+ onelabqty: this.dialogForm.sqty
+ }
+ const r = await LabelBarCode(D)
+ this.dialogForm.inbarcode = r.data[0].labcode
+
+ this.qrForm.partspec = this.dialogForm.partspec
+ }
const data = {
mesordercode: this.dialogForm.wo_code, // 宸ュ崟缂栧彿
@@ -2004,6 +2021,9 @@
taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
sqty: this.dialogForm.sqty, // 鏀舵枡鏁伴噺
remarks: this.dialogForm.remarks, // 澶囨敞
+
+ inbarcode: this.dialogForm.inbarcode, // 鐢熶骇鍏ュ簱鏉$爜
+
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
@@ -2066,6 +2086,23 @@
this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
})
+
+ this.dialogForm.inbarcode = ''
+
+ // 褰撲负鏈亾鐨勬椂鍊�
+ if (this.dialogForm.nextstepcode === '') {
+ const D = {
+ rightcode: '1073',
+ partcode: this.dialogForm.partcode,
+ qty: this.dialogForm.startqty,
+ onelabqty: this.dialogForm.startqty
+ }
+ const r = await LabelBarCode(D)
+ this.dialogForm.inbarcode = r.data[0].labcode
+
+ this.qrForm.partspec = this.dialogForm.partspec
+ }
+
// console.log(this.userTableData, 1)
const reportuser = this.userTableData.map(item => item.usercode).join(';')
const data = {
@@ -2082,6 +2119,9 @@
// reportqty: this.dialogForm.reportqty, // 鎶ュ伐鏁伴噺
reportqty: this.dialogForm.startqty, // 鎶ュ伐鏁伴噺
remarks: this.dialogForm.remarks, // 澶囨敞
+
+ inbarcode: this.dialogForm.inbarcode, // 鐢熶骇鍏ュ簱鏉$爜
+
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
@@ -2118,7 +2158,13 @@
})
},
ZZprint2(username) {
- this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+ if (this.dialogForm.nextstepcode !== '') {
+ this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+ } else {
+ this.qrForm.qrvalue = this.dialogForm.inbarcode
+ }
+
+ // this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
this.qrForm.startqty = this.dialogForm.startqty
this.qrForm.wo_code = this.dialogForm.wo_code
this.qrForm.partcode = this.dialogForm.partcode
@@ -2131,7 +2177,13 @@
})
},
WXprint2(username) {
- this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+ if (this.dialogForm.nextstepcode !== '') {
+ this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+ } else {
+ this.qrForm.qrvalue = this.dialogForm.inbarcode
+ }
+
+ // this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
this.qrForm.startqty = this.dialogForm.sqty
this.qrForm.wo_code = this.dialogForm.wo_code
this.qrForm.partcode = this.dialogForm.partcode
diff --git a/src/views/scgl/scrk.vue b/src/views/scgl/scrk.vue
new file mode 100644
index 0000000..60384b6
--- /dev/null
+++ b/src/views/scgl/scrk.vue
@@ -0,0 +1,1403 @@
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <!-- <div class="bodyTopButtonGroup" style="justify-content: space-between">-->
+ <!-- <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>-->
+ <!-- <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
+ <!-- </div>-->
+
+ <div
+ class="bodyTopFormGroup"
+ style="margin-top: 10px"
+ :style="{height:(mainHeight-20)+'px'}"
+ >
+ <div style="display: flex;align-items: center">
+ <i
+ class="el-icon-s-operation"
+ :style="{color:$store.state.settings.theme,fontSize:'14px'}"
+ />
+ <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
+ 鏌ヨ椤�
+ </div>
+ <!-- <div v-if="!isPermission" style="font-size: 14px;margin-left: 10px;color: red">-->
+ <!-- 褰撳墠鐢ㄦ埛鍦‥RP绯荤粺涓笉瀛樺湪鎴栨湭鎺堟潈锛屾棤娉曞叆搴撴彁浜�-->
+ <!-- </div>-->
+ </div>
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm" style="display: flex;flex-direction: column;justify-content: flex-start">
+ <div style="display: flex">
+ <el-form-item label="鍗曟嵁绫诲瀷" required style=" display: flex;">
+ <el-select
+ v-model="form.documentType"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="documentTypeChange"
+ >
+ <el-option
+ v-for="item in documentTypeArr"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鐢熶骇杞﹂棿" required style=" display: flex;">
+ <el-select
+ v-model="form.wkshopcode"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="wkshopcodeChange"
+ >
+ <el-option
+ v-for="item in WorkShopArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item
+ v-if="form.documentType==='Y'"
+ label="鐢熶骇璁㈠崟"
+ :required="form.documentType==='Y'"
+ style="display: flex;"
+ >
+
+ <el-select
+ v-model="form.erpordercode"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="getProductInHouseOrderSearch"
+ >
+ <el-option
+ v-for="item in erpordercodeArr"
+ :key="item.ordercode"
+ :label="item.ordercode"
+ :value="item.ordercode"
+ />
+ </el-select>
+
+ <!-- <el-input-->
+ <!-- v-model="form.erpordercode"-->
+ <!-- placeholder="璇疯緭鍏�"-->
+ <!-- style="width: 200px"-->
+ <!-- @input="getProductInHouseOrderSearch"-->
+ <!-- />-->
+ </el-form-item>
+
+ <el-form-item
+ v-if="form.documentType==='N'"
+ label="鐢熶骇宸ュ崟"
+ :required="form.documentType==='N'"
+ style=" display: flex;"
+ >
+ <el-select
+ v-model="form.mesordercode"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="getProductInHouseOrderSearch"
+ >
+ <el-option
+ v-for="item in mesordercodeArr"
+ :key="item.ordercode"
+ :label="item.ordercode"
+ :value="item.ordercode"
+ />
+ </el-select>
+ </el-form-item>
+
+ <el-form-item
+ v-if="form.documentType==='Y'"
+ label="鐢熶骇宸ュ崟"
+ style=" display: flex;"
+ >
+ <el-input
+ v-model="form.mesordercode"
+ placeholder="璇疯緭鍏�"
+ style="width: 200px"
+ @input="getProductInHouseOrderSearch"
+ />
+ </el-form-item>
+ <el-form-item
+ v-if="form.documentType==='Y'"
+ label="閿�鍞鍗�"
+ style="display: flex;"
+ >
+ <el-input
+ v-model="form.saleOrderCode"
+ readonly
+ style="width: 200px"
+ @change="getProductInHouseOrderSearch"
+ />
+ <!-- disabled-->
+ </el-form-item>
+ </div>
+
+ <div style="display: flex">
+ <el-form-item label="浜у搧缂栫爜" style=" display: flex;">
+ <el-input v-model="form.partcode" placeholder="璇疯緭鍏�" style="width: 200px" @change="getProductInHouseOrderSearch" />
+ </el-form-item>
+ <el-form-item label="浜у搧鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.partname" style="width: 200px" placeholder="璇疯緭鍏�" @change="getProductInHouseOrderSearch" />
+ </el-form-item>
+ <el-form-item label="浜у搧瑙勬牸" style=" display: flex;">
+ <el-input v-model="form.partspec" style="width: 200px" placeholder="璇疯緭鍏�" @change="getProductInHouseOrderSearch" />
+ </el-form-item>
+ <el-form-item
+ label="宸ュ崟鏃ユ湡"
+ style=" display: flex;font-size: 14px;margin-top: 3px;margin-bottom: -3px"
+ >
+ <el-date-picker
+ v-model="form.paystartdate"
+ type="daterange"
+ range-separator="~"
+ class="timeMini"
+ size="mini"
+ style="width: 200px;display: flex;line-height: 34px;height: 34px;"
+ :clearable="false"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ @change="getProductInHouseOrderSearch"
+ />
+ </el-form-item>
+ </div>
+
+ </div>
+ <div
+ class="bodySearchReset"
+ >
+ <!-- :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"-->
+
+ <!-- <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>-->
+ <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ </div>
+ </el-form>
+
+ <div style="display: flex;align-items: center">
+ <i
+ class="el-icon-s-operation"
+ :style="{color:$store.state.settings.theme,fontSize:'14px'}"
+ />
+ <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
+ 閫夋嫨椤�
+ </div>
+ </div>
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm" style="justify-content: flex-start">
+ <el-form-item label="鍗曟嵁鏃ユ湡" style=" display: flex;">
+ <el-date-picker
+ v-model="form.lm_date"
+ style="width: 200px"
+ readonly
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ />
+ </el-form-item>
+ <el-form-item label="鍗曟嵁缂栧彿" style=" display: flex;">
+ <el-input
+ v-model="form.hbillno"
+ readonly
+ placeholder="璇疯緭鍏�"
+ style="width: 200px"
+ />
+ </el-form-item>
+
+ <el-form-item label="鍏ュ簱浠撳簱" required style=" display: flex;">
+ <el-select
+ v-model="form.stockcode"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="stockcodeChange"
+ >
+ <el-option
+ v-for="item in stockcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+
+ </div>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button
+
+ type="primary"
+ icon="el-icon-s-promotion"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="submit"
+ >鍏ュ簱鎻愪氦
+ </el-button>
+ <!-- <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>-->
+ </div>
+ </el-form>
+ <div style="display: flex;align-items: center">
+ <i
+ class="el-icon-s-operation"
+ :style="{color:$store.state.settings.theme,fontSize:'14px'}"
+ />
+ <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
+ 淇℃伅鏍�
+ </div>
+ </div>
+ <div style="padding:0 10px;position: relative">
+ <!-- <el-button-->
+ <!-- -->
+ <!-- type="primary"-->
+ <!-- style="position: absolute;right: 10px;top: 10px;z-index: 10"-->
+ <!-- icon="el-icon-s-promotion"-->
+ <!-- @click=""-->
+ <!-- >鍏ュ簱鎻愪氦-->
+ <!-- </el-button>-->
+ <el-tabs style="margin-top: 10px;" @tab-click="tabClick">
+ <el-tab-pane label="鏄庣粏">
+ <div class="elTableDiv" style="margin: 0 auto 10px;">
+ <el-table
+ v-show="form.documentType==='Y'"
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableDataDetail"
+ :height="(tableHeight-25)+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:(tableHeight-25)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @selection-change="handleSelectionChange"
+ >
+ <!-- @cell-dblclick="cellDblclick"-->
+ <!-- @cell-click="cellClick"-->
+ <el-table-column
+ type="selection"
+ width="50"
+ fixed
+ />
+ <el-table-column
+ type="index"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+
+ <!-- <el-table-column-->
+ <!-- prop="stockcode"-->
+ <!-- label="浠撳簱"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div>{{ row.stockcode ? stockcodeArr.find(i => i.code === row.stockcode).name : '/' }}</div>-->
+ <!-- <!– <div–>-->
+ <!-- <!– v-if="!(row.index === tabClickIndex && tabClickLabel === '浠撳簱')"–>-->
+ <!-- <!– >–>-->
+ <!-- <!– {{ row.stockcode ? stockcodeArr.find(i => i.code === row.stockcode).name : '/' }}–>-->
+ <!-- <!– </div>–>-->
+ <!-- <!– <el-select–>-->
+ <!-- <!– v-if="row.index === tabClickIndex && tabClickLabel === '浠撳簱'"–>-->
+ <!-- <!– v-model="row.stockcode"–>-->
+ <!-- <!– placeholder="璇烽�夋嫨"–>-->
+ <!-- <!– >–>-->
+ <!-- <!– <el-option–>-->
+ <!-- <!– v-for="item in stockcodeArr"–>-->
+ <!-- <!– :key="item.code"–>-->
+ <!-- <!– :label="item.name"–>-->
+ <!-- <!– :value="item.code"–>-->
+ <!-- <!– />–>-->
+ <!-- <!– </el-select>–>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="inbarcode"-->
+ <!-- label="鍏ュ簱鏉$爜"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <el-table-column
+ prop="m_po"
+ label="璁㈠崟缂栧彿"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.m_po">{{ row.m_po }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="wo_code"
+ label="宸ュ崟缂栧彿"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partcode"
+ label="浜у搧缂栫爜"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partname"
+ label="浜у搧鍚嶇О"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partspec"
+ label="浜у搧瑙勬牸"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.partspec">{{ row.partspec }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="qty"
+ label="璁㈠崟鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.qty">{{ row.qty }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="plan_qty"
+ label="宸ュ崟鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="good_qty"
+ label="瀹屽伐鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="inhouseqty"
+ label="宸插叆搴撴暟閲�"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="stinhouseqty"
+ label="鍙叆搴撴暟閲�"
+ min-width="130"
+ fixed="right"
+ >
+ <!-- <template slot-scope="{row}">-->
+ <!-- <el-input-number v-model="row.stinhouseqty" :min="0" :max="row.good_qty" size="small" />-->
+ <!-- </template>-->
+ </el-table-column>
+ </el-table>
+ <el-table
+ v-show="form.documentType==='N'"
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableDataDetail"
+ :height="(tableHeight-25)+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:(tableHeight-25)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column
+ type="selection"
+ width="50"
+ fixed
+ />
+ <el-table-column
+ type="index"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+
+ <!-- <el-table-column-->
+ <!-- prop="stockname"-->
+ <!-- label="浠撳簱"-->
+ <!-- width="110"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.stockname">{{ row.stockname }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="inbarcode"-->
+ <!-- label="鍏ュ簱鏉$爜"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="m_po"-->
+ <!-- label="璁㈠崟缂栧彿"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.m_po">{{ row.m_po }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <el-table-column
+ prop="wo_code"
+ label="宸ュ崟缂栧彿"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partcode"
+ label="浜у搧缂栫爜"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partname"
+ label="浜у搧鍚嶇О"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partspec"
+ label="浜у搧瑙勬牸"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.stockname">{{ row.stockname }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <!-- <el-table-column-->
+ <!-- prop="qty"-->
+ <!-- label="璁㈠崟鏁伴噺"-->
+ <!-- min-width="95"-->
+ <!-- fixed="right"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.qty">{{ row.qty }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <el-table-column
+ prop="plan_qty"
+ label="宸ュ崟鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="good_qty"
+ label="瀹屽伐鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="inhouseqty"
+ label="宸插叆搴撴暟閲�"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="stinhouseqty"
+ label="鍙叆搴撴暟閲�"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ </el-table>
+ </div>
+ </el-tab-pane>
+ <el-tab-pane label="姹囨��">
+ <div class="elTableDiv" style="margin: 0 auto 10px;">
+ <el-table
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableDataSummary"
+ :height="(tableHeight-25)+'px'"
+ border
+ :row-class-name="tableRowClassName2"
+ :style="{width: 100+'%',height:(tableHeight-25)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ >
+ <el-table-column
+ type="index"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+ <!-- <el-table-column-->
+ <!-- prop="stockcode"-->
+ <!-- label="浠撳簱"-->
+ <!-- width="110"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div>{{ stockcodeArr.find(i => i.code === row.stockcode).name }}</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.stockname">{{ row.stockname }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="inbarcode"-->
+ <!-- label="鍏ュ簱鏉$爜"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="m_po"-->
+ <!-- label="璁㈠崟缂栧彿"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.m_po">{{ row.m_po }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="wo_code"-->
+ <!-- label="宸ュ崟缂栧彿"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <el-table-column
+ prop="partcode"
+ label="浜у搧缂栫爜"
+ min-width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partname"
+ label="浜у搧鍚嶇О"
+ min-width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partspec"
+ label="浜у搧瑙勬牸"
+ min-width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.stockname">{{ row.stockname }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="qty"
+ label="璁㈠崟鏁伴噺"
+ min-width="95"
+
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.qty">{{ row.qty }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <!-- <el-table-column-->
+ <!-- prop="plan_qty"-->
+ <!-- label="宸ュ崟鏁伴噺"-->
+ <!-- min-width="95"-->
+ <!-- fixed="right"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <el-table-column
+ prop="good_qty"
+ label="瀹屽伐鏁伴噺"
+ min-width="95"
+
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="inhouseqty"
+ label="宸插叆搴撴暟閲�"
+ min-width="95"
+
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="stinhouseqty"
+ label="鍙叆搴撴暟閲�"
+ min-width="95"
+
+ show-tooltip-when-overflow
+ />
+ </el-table>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+
+ </div>
+
+ </div>
+
+ </div>
+</template>
+
+<script>
+
+import {
+ ProductInHouseOrderCodeSearch,
+ ProductInHouseOrderSearch, ProductInHouseOrderSeave,
+ ProductInHouseWkshopOrder
+} from '@/api/scgl'
+import { getTPlusToken, handleDatetime, handleDatetime2 } from '@/utils/global'
+import {
+ ErpUserSelect,
+ ErpWarehouseSelect,
+ ErpWkshopDepartmentSelect
+} from '@/api/jcsz'
+import { getCookie } from '@/utils/auth'
+import Vue from 'vue'
+import axios from 'axios'
+
+export default {
+ name: 'Zzjg',
+ components: {},
+ data() {
+ return {
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ hbillno: '', // 鍏ュ簱鍗曞彿
+ incbit: '', // 娴佹按鍙�
+ documentType: 'Y', // 鍗曟嵁绫诲瀷
+
+ wkshopcode: '', // 鐢熶骇杞﹂棿
+ erpordercode: '', // 璁㈠崟缂栧彿
+ mesordercode: '', // 宸ュ崟缂栧彿
+ partcode: '', // 浜у搧缂栫爜
+ partname: '', // 浜у搧鍚嶇О
+ partspec: '', // 瑙勬牸鍨嬪彿
+ orderdate: '', // 宸ュ崟鏃ユ湡
+
+ saleOrderCode: '', // 閿�鍞鍗�
+ lm_date: new Date(), // 鍗曟嵁鏃ユ湡
+ stockcode: '' // 鍏ュ簱浠撳簱
+
+ },
+ documentTypeArr: [
+ { label: '鏈夋簮鍗�', value: 'Y' },
+ { label: '鏃犳簮鍗�', value: 'N' }
+ ],
+ tableDataDetail: [], // 鏄庣粏琛�
+ multipleSelection: [],
+ stockcodeArr: [], // 鍏ュ簱浠撳簱鏁扮粍
+ WorkShopArr: [], // 鐢熶骇杞﹂棿鏁扮粍
+ erpordercodeArr: [], // 鐢熶骇璁㈠崟鏁扮粍
+ mesordercodeArr: [], // 鐢熶骇宸ュ崟鏁扮粍
+
+ tabClickIndex: null, // 鐐瑰嚮鐨勫崟鍏冩牸
+ tabClickLabel: '', // 褰撳墠鐐瑰嚮鐨勫垪鍚�
+
+ tableDataSummary: [], // 姹囨�昏〃
+
+ // isPermission: true, // 鏄惁鏈夋潈闄愬彲鎻愪氦
+
+ userArr: [] // ERP浜哄憳鏁扮粍
+
+ }
+ },
+ watch: {},
+ created() {
+ this.getErpUserSelect()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+
+ this.getWareHouseSelect()
+ this.getWorkShopSelect()
+ this.getProductInHouseOrderCodeSearch()
+ },
+ methods: {
+ async getProductInHouseOrderCodeSearch() {
+ const { data: res } = await ProductInHouseOrderCodeSearch({ rightcode: '2064' })
+ this.form.hbillno = res[0]
+ this.form.incbit = res[1]
+ },
+ async getErpUserSelect() {
+ const { data: res } = await ErpUserSelect()
+ this.userArr = res
+
+ // if (!res.map(i => i.name).includes(getCookie('username'))) {
+ // this.isPermission = false
+ //
+ // await this.$alert('褰撳墠鐢ㄦ埛鍦‥RP绯荤粺涓笉瀛樺湪鎴栨湭鎺堟潈锛屾棤娉曞叆搴撴彁浜�', '鎻愮ず', {
+ // confirmButtonText: '纭畾'
+ // })
+ // }
+ },
+
+ // 鍗曟嵁绫诲瀷鏀瑰彉
+ documentTypeChange(val) {
+ this.form.erpordercode = ''
+ this.form.wkshopcode = ''
+ this.reset()
+ },
+ // 鐢熶骇杞﹂棿鏀瑰彉
+ async wkshopcodeChange(val) {
+ this.form.erpordercode = ''
+ this.form.mesordercode = ''
+ this.form.saleOrderCode = ''
+ this.tableDataDetail = []
+ this.tableDataSummary = []
+ this.multipleSelection = []
+ const data = {
+ ordertype: this.form.documentType,
+ wkshopcode: val
+ }
+ const { data: res } = await ProductInHouseWkshopOrder(data)
+ if (this.form.documentType === 'Y') {
+ this.erpordercodeArr = res
+ } else {
+ this.mesordercodeArr = res
+ }
+ },
+
+ async getProductInHouseOrderSearch() {
+ let tempDate = this.form.orderdate
+ if (tempDate.length > 0) {
+ tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
+ }
+ const data = {
+ wkshopcode: this.form.wkshopcode, // 鐢熶骇杞﹂棿
+ erpordercode: this.form.erpordercode, // 璁㈠崟缂栧彿
+ mesordercode: this.form.mesordercode, // 宸ュ崟缂栧彿
+ partcode: this.form.partcode, // 浜у搧缂栫爜
+ partname: this.form.partname, // 浜у搧鍚嶇О
+ partspec: this.form.partspec, // 瑙勬牸鍨嬪彿
+ orderdate: tempDate// 宸ュ崟鏃ユ湡
+ }
+ const res = await ProductInHouseOrderSearch(data)
+ // this.tableDataDetail = res.data
+
+ // 鏍规嵁鍘熷崟鍋氳繃婊�
+ this.tableDataDetail = res.data.filter(i => this.form.documentType === 'Y' ? i.m_po : !i.m_po)
+
+ this.form.saleOrderCode = res.data[0].saleOrderCode
+
+ this.$nextTick(() => {
+ this.$refs.tableDataRef.doLayout()
+ })
+ },
+ // 鑾峰彇浠撳簱鎺ュ彛
+ async getWareHouseSelect() {
+ const { data: res } = await ErpWarehouseSelect()
+ this.stockcodeArr = res
+ },
+ // 鑾峰彇鎵�灞炶溅闂�
+ async getWorkShopSelect() {
+ const { data: res } = await ErpWkshopDepartmentSelect()
+ this.WorkShopArr = res
+ },
+
+ // 閲嶇疆
+ reset() {
+ this.form.wkshopcode = ''
+ this.form.erpordercode = ''
+ this.form.mesordercode = ''
+ this.form.partcode = ''
+ this.form.partname = ''
+ this.form.partspec = ''
+ this.form.orderdate = ''
+ this.form.stockcode = ''
+
+ this.tableDataDetail = []
+ this.tableDataSummary = []
+ this.multipleSelection = []
+ },
+
+ // 琛ㄦ牸鍗曞厓鏍煎弻鍑�
+ cellDblclick(row, column, cell, event) {
+ switch (column.label) {
+ case '浠撳簱':
+ this.tabClickIndex = row.index
+ this.tabClickLabel = column.label
+ break
+ case '鍙叆搴撴暟閲�':
+ this.tabClickIndex = row.index
+ this.tabClickLabel = column.label
+ break
+ default:
+ return
+ }
+ },
+ // 琛ㄦ牸鍗曞嚮浜嬩欢
+ cellClick() {
+ this.tabClickLabel = ''
+ },
+ // 鍏ュ簱浠撳簱鍊兼敼鍙�
+ stockcodeChange(val) {
+ this.tableDataDetail.forEach(i => {
+ i.stockcode = val
+ })
+ },
+
+ // 澶氶�夐�変腑
+ handleSelectionChange(val) {
+ this.multipleSelection = val
+ },
+
+ // tab鐐瑰嚮
+ tabClick(val) {
+ const partcodeArr = [...new Set(this.multipleSelection.map(i => i.partcode))]// 鏁扮粍鍘婚噸
+ const newData = []
+
+ partcodeArr.forEach(i => {
+ const t = this.multipleSelection.find(j => j.partcode === i)
+ let sum = 0
+ const good_qty = this.multipleSelection.filter(j => j.partcode === i).map(j => parseFloat(j.good_qty)).reduce((pre, curr) => {
+ sum = pre + curr
+ return sum
+ })
+ sum = 0
+ const inhouseqty = this.multipleSelection.filter(j => j.partcode === i).map(j => parseFloat(j.inhouseqty)).reduce((pre, curr) => {
+ sum = pre + curr
+ return sum
+ })
+ sum = 0
+ const stinhouseqty = this.multipleSelection.filter(j => j.partcode === i).map(j => parseFloat(j.stinhouseqty)).reduce((pre, curr) => {
+ sum = pre + curr
+ return sum
+ })
+ newData.push(
+ {
+ stockcode: t.stockcode,
+ partcode: t.partcode,
+ partname: t.partname,
+ partspec: t.partspec,
+ qty: t.qty,
+ good_qty,
+ inhouseqty,
+ stinhouseqty,
+ unitid: t.unitid,
+ unitname: t.unitname,
+ sourceVoucherDetailId: t.sbid,
+ saleOrderDetailId: t.saleOrderDetailId,
+ ManufactureOrderDetailId: t.sbid,
+ stck_id: t.stockcode ? this.stockcodeArr.find(i => i.code === t.stockcode).id : '',
+ SourceVoucherDetailIdByMergedFlow: t.sbid,
+ materiel_code: t.partcode,
+ warehouse: t.stockcode,
+ materiel_id: t.materiel_id
+
+ }
+ )
+ })
+ this.tableDataSummary = newData
+ },
+
+ async submit() {
+ if (!this.form.stockcode) {
+ return this.$message.error('鍏ュ簱浠撳簱涓嶈兘涓虹┖锛�')
+ }
+ if (this.multipleSelection.length === 0) {
+ return this.$message.error('鏈�夋嫨浜у搧锛�')
+ }
+
+ this.$store.state.app.buttonIsDisabled = true
+ await this.tabClick()
+ const openToken = await getTPlusToken() // 鑾峰彇TPlus token
+
+ // 鏈夋簮鍗�
+ if (this.form.documentType === 'Y') {
+ const RDRecordDetails = []
+ this.tableDataSummary.forEach((i, index) => {
+ RDRecordDetails.push({
+ Code: index + 1, // 琛屽彿锛屼粠1寮�濮嬭嚜澧為暱
+ SourceVoucherId: this.tableDataDetail[0].mpoid, // 鏉ユ簮鍗曟嵁鐨勫崟鎹甀D
+ BaseQuantity: i.stinhouseqty, // 涓昏閲忓崟浣嶆暟閲�
+ SourceVoucherDetailId: i.sourceVoucherDetailId, // 鏉ユ簮鍗曟嵁鐨勫搴旀槑缁咺D
+ Inventory: {
+ Code: i.materiel_code // 瀛樿揣缂栫爜
+ },
+ IdSourceVoucherType: 69
+ })
+ })
+ const data = {
+ 'dto': {
+ 'Warehouse': {
+ 'Code': this.form.stockcode// 浠撳簱缂栫爜
+ },
+ 'Code': this.form.hbillno, // 鍗曟嵁缂栫爜
+ 'IsModifiedCode': true,
+ 'BusiType': {
+ 'Code': '03'// 涓氬姟绫诲瀷缂栫爜
+ },
+ 'Department': {
+ 'Code': this.form.wkshopcode// 閮ㄩ棬缂栫爜
+ },
+ 'VoucherDate': handleDatetime(new Date().getTime()), // 鍗曟嵁鏃ユ湡
+ 'RdStyle': {
+ 'Code': '21'// 鍑哄簱绫诲埆缂栫爜
+ },
+ 'RDRecordDetails': RDRecordDetails,
+ // 'Clerk': {
+ // 'Code': this.userArr.find(i => i.name === getCookie('username')).code // 涓氬姟鍛榗ode
+ // // 'Code': '001' // 涓氬姟鍛榗ode
+ // // 'Name': getCookie('username')
+ // },
+ 'ExternalCode': this.form.hbillno,
+ 'VoucherType': {
+ 'Code': 'ST1002'
+ }
+ }
+ }
+ const res = await axios.post(Vue.prototype.$chanjetBaseUrl + '/tplus/api/v2/ProductReceiveOpenApi/Create',
+ data, {
+ headers: {
+ 'openToken': openToken,
+ 'appKey': Vue.prototype.$AppKey,
+ 'appSecret': Vue.prototype.$AppSecret,
+ 'Content-Type': 'application/json'
+ }
+ }
+ )
+ if (res.data.code === 0) {
+ this.multipleSelection.forEach(i => {
+ i.stockname = this.stockcodeArr.find(j => j.code === i.stockcode).name
+ i.id = this.stockcodeArr.find(j => j.code === i.stockcode).id
+ })
+
+ const head = {
+ rightcode: '2064',
+ hbillno: this.form.hbillno,
+ incbit: this.form.incbit,
+ wkshpcode: this.form.wkshopcode,
+ sourceVoucherId: this.form.documentType === 'Y' ? this.tableDataDetail[0].mpoid : '',
+ sourceVoucherCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ saleOrderId: this.tableDataDetail[0].saleOrderid,
+ saleOrderCode: this.tableDataDetail[0].saleOrderCode,
+ rdDirectionFlag: 1,
+ // makerid: this.userArr.find(i => i.name === getCookie('username')).id,
+ makerid: '',
+ maker: getCookie('username'),
+ accountingyear: new Date().getFullYear(),
+ VoucherYear: new Date().getFullYear(),
+ VoucherPeriod: new Date().getMonth() + 1,
+ ManufactureOrderCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ idbusitype: '03',
+ iddepartment: this.WorkShopArr.find(i => i.code === this.form.wkshopcode).id,
+ idrdstyle: 21,
+ idwarehouse: '',
+ voucherState: 181,
+ idvouchertype: 15,
+ voucherdate: handleDatetime(new Date().getTime()),
+ madedate: handleDatetime(new Date().getTime()),
+ createdtime: handleDatetime2(new Date().getTime()),
+ DataSource: '56133',
+ idsourcevouchertype: 69
+ }
+
+ const subsum = []
+ this.tableDataSummary.forEach((i, index) => {
+ subsum.push({
+ code: index.toString().padStart(4, '0'),
+ rownumber: index + 1,
+ arrivalQuantity: i.qty,
+ quantity: i.stinhouseqty,
+ compositionQuantity: i.stinhouseqty + i.unitname,
+ baseQuantity: i.stinhouseqty,
+ sourceVoucherId: this.form.documentType === 'Y' ? this.tableDataDetail[0].mpoid : '',
+ sourceVoucherCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ sourceVoucherDetailId: i.sourceVoucherDetailId,
+ idsourcevouchertype: 69,
+ saleOrderId: this.tableDataDetail[0].saleOrderid,
+ saleOrderCode: this.tableDataDetail[0].saleOrderCode,
+ saleOrderDetailId: i.saleOrderDetailId,
+ ManufactureOrderId: this.form.documentType === 'Y' ? this.tableDataDetail[0].mpoid : '',
+ ManufactureOrderCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ ManufactureOrderDetailId: i.ManufactureOrderDetailId,
+ idbusiTypeByMergedFlow: 3,
+ idinventory: i.materiel_id,
+ idbaseunit: i.unitid,
+ idunit: i.unitid,
+ idwarehouse: i.stck_id,
+ SourceVoucherIdByMergedFlow: this.tableDataDetail[0].mpoid,
+ SourceVoucherCodeByMergedFlow: this.tableDataDetail[0].m_po,
+ SourceVoucherDetailIdByMergedFlow: i.SourceVoucherDetailIdByMergedFlow,
+ idsourceVoucherTypeByMergedFlow: 69,
+ createdtime: handleDatetime2(new Date().getTime()),
+ DataSource: '56133',
+ materiel_code: i.materiel_code,
+ warehouse: i.warehouse
+ })
+ })
+
+ const data = {
+ head, sub: this.multipleSelection, subsum
+ }
+
+ const r1 = await ProductInHouseOrderSeave(data)
+ if (r1.code === '200') {
+ this.$message.success('鍏ュ簱鎴愬姛锛�')
+ await this.getProductInHouseOrderCodeSearch()
+ await this.wkshopcodeChange(this.form.wkshopcode)
+ this.tableDataDetail = []
+ this.tableDataSummary = []
+ this.multipleSelection = []
+ this.form.stockcode = ''
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ } else {
+ this.$message.error('鍏ュ簱澶辫触锛�')
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ }
+
+ // 鏃犳簮鍗�
+ if (this.form.documentType === 'N') {
+ const RDRecordDetails = []
+ this.tableDataSummary.forEach((i, index) => {
+ RDRecordDetails.push({
+ Code: index + 1, // 琛屽彿锛屼粠1寮�濮嬭嚜澧為暱
+ Inventory: {
+ Code: i.materiel_code // 瀛樿揣缂栫爜
+ },
+ BaseQuantity: i.stinhouseqty, // 涓昏閲忓崟浣嶆暟閲�
+ SNObject: {
+ SnAccountDetails: [
+ {
+ SNCode: index.toString().padStart(4, '0')
+ }
+ ]
+ }
+ })
+ })
+ const data = {
+ 'dto': {
+ 'IsModifiedCode': true,
+ 'ExternalCode': this.form.hbillno,
+ 'Code': this.form.hbillno,
+ 'VoucherType': {
+ 'Code': 'ST1002'
+ },
+ 'VoucherDate': handleDatetime(new Date().getTime()),
+ 'BusiType': {
+ 'Code': '03'
+ },
+ 'Warehouse': {
+ 'Code': this.form.stockcode
+ },
+ 'Department': {
+ 'Code': this.form.wkshopcode,
+ 'Name': this.WorkShopArr.find(i => i.code === this.form.wkshopcode).name
+ },
+ 'RDRecordDetails': RDRecordDetails
+ }
+ }
+ const res = await axios.post(Vue.prototype.$chanjetBaseUrl + '/tplus/api/v2/productReceive/Create',
+ data, {
+ headers: {
+ 'openToken': openToken,
+ 'appKey': Vue.prototype.$AppKey,
+ 'appSecret': Vue.prototype.$AppSecret,
+ 'Content-Type': 'application/json'
+ }
+ }
+ )
+
+ if (res.data === null) {
+ this.multipleSelection.forEach(i => {
+ i.stockname = this.stockcodeArr.find(j => j.code === i.stockcode).name
+ i.id = this.stockcodeArr.find(j => j.code === i.stockcode).id
+ })
+
+ const head = {
+ rightcode: '2064',
+ hbillno: this.form.hbillno,
+ incbit: this.form.incbit,
+ wkshpcode: this.form.wkshopcode,
+ sourceVoucherId: this.form.documentType === 'Y' ? this.tableDataDetail[0].mpoid : this.tableDataDetail[0].wo_id,
+ sourceVoucherCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ saleOrderId: this.tableDataDetail[0].saleOrderid,
+ saleOrderCode: this.tableDataDetail[0].saleOrderCode,
+ rdDirectionFlag: 1,
+ // makerid: this.userArr.find(i => i.name === getCookie('username')).id,
+ makerid: '',
+ maker: getCookie('username'),
+ accountingyear: new Date().getFullYear(),
+ VoucherYear: new Date().getFullYear(),
+ VoucherPeriod: new Date().getMonth() + 1,
+ ManufactureOrderCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ idbusitype: '03',
+ iddepartment: this.WorkShopArr.find(i => i.code === this.form.wkshopcode).id,
+ idrdstyle: 21,
+ idwarehouse: '',
+ voucherState: 181,
+ idvouchertype: 15,
+ voucherdate: handleDatetime(new Date().getTime()),
+ madedate: handleDatetime(new Date().getTime()),
+ createdtime: handleDatetime2(new Date().getTime()),
+ DataSource: '56133',
+ idsourcevouchertype: 69
+ }
+
+ const subsum = []
+ this.tableDataSummary.forEach((i, index) => {
+ subsum.push({
+ code: index.toString().padStart(4, '0'),
+ rownumber: index + 1,
+ arrivalQuantity: i.qty,
+ quantity: i.stinhouseqty,
+ compositionQuantity: i.stinhouseqty + i.unitname,
+ baseQuantity: i.stinhouseqty,
+ sourceVoucherId: this.form.documentType === 'Y' ? this.tableDataDetail[0].mpoid : '',
+ sourceVoucherCode: '',
+ sourceVoucherDetailId: i.sourceVoucherDetailId,
+ idsourcevouchertype: 69,
+ saleOrderId: this.tableDataDetail[0].saleOrderid,
+ saleOrderCode: this.tableDataDetail[0].saleOrderCode,
+ saleOrderDetailId: i.saleOrderDetailId,
+ ManufactureOrderId: this.form.documentType === 'Y' ? this.tableDataDetail[0].mpoid : '',
+ ManufactureOrderCode: this.form.documentType === 'Y' ? this.tableDataDetail[0].m_po : this.tableDataDetail[0].wo_code,
+ ManufactureOrderDetailId: i.ManufactureOrderDetailId,
+ idbusiTypeByMergedFlow: 3,
+ idinventory: i.materiel_id,
+ idbaseunit: i.unitid,
+ idunit: i.unitid,
+ idwarehouse: i.stck_id,
+ SourceVoucherIdByMergedFlow: this.tableDataDetail[0].mpoid,
+ SourceVoucherCodeByMergedFlow: this.tableDataDetail[0].m_po,
+ SourceVoucherDetailIdByMergedFlow: i.SourceVoucherDetailIdByMergedFlow,
+ idsourceVoucherTypeByMergedFlow: 69,
+ createdtime: handleDatetime2(new Date().getTime()),
+ DataSource: '56133',
+ materiel_code: i.materiel_code,
+ warehouse: i.warehouse
+ })
+ })
+
+ const data = {
+ head, sub: this.multipleSelection, subsum
+ }
+ console.log(data, 2)
+ const r1 = await ProductInHouseOrderSeave(data)
+ if (r1.code === '200') {
+ this.$message.success('鍏ュ簱鎴愬姛锛�')
+ await this.getProductInHouseOrderCodeSearch()
+ await this.wkshopcodeChange(this.form.wkshopcode)
+ this.tableDataDetail = []
+ this.tableDataSummary = []
+ this.multipleSelection = []
+ this.form.stockcode = ''
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ } else {
+ this.$message.error('鍏ュ簱澶辫触锛�')
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ }
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 255
+ this.$refs.tableDataRef.doLayout()
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ // 鎶婃瘡涓�琛岀殑绱㈠紩鏀捐繘row
+ row.index = rowIndex
+ return 'custom-row'
+ },
+ tableRowClassName2({ row, rowIndex }) {
+ return 'custom-row'
+ }
+ }
+}
+</script>
+
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-range__icon {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-separator {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-input {
+ font-size: 14px;
+}
+
+::v-deep .el-range-separator {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+::v-deep .el-button--text {
+ font-size: 14px;
+ cursor: pointer;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
+}
+
+.el-icon-edit-outline {
+ margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
+}
+
+::v-deep .el-input__inner {
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+ padding: 20px 100px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+ transform: scale(0.8);
+}
+
+::v-deep .cell {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+ height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+ border: 1px solid #eee;
+ width: 99%;
+ margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+::v-deep .el-select__caret {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
+ height: 100% !important;
+ }
+
+ ::v-deep .el-table__fixed {
+ height: 100% !important;
+ }
+}
+
+::v-deep .el-tabs__item {
+ padding-right: 0;
+}
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
+</style>
diff --git a/vue.config.js b/vue.config.js
index 2ceeef2..77fa077 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -50,8 +50,8 @@
},
proxy: {
[process.env.VUE_APP_BASE_API]: {
- // target: 'http://121.196.36.24:8003', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃 鏈湴鏈嶅姟鍣�(澶у矝)
- target: 'http://192.168.2.138:8001', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃 瀹㈡埛鏈嶅姟鍣�(澶у矝)
+ target: 'http://121.196.36.24:8023', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃 鏈湴鏈嶅姟鍣�(澶у矝)
+ // target: 'http://192.168.2.138:8001', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃 瀹㈡埛鏈嶅姟鍣�(澶у矝)
changeOrigin: true, // 璇锋眰璺ㄥ煙鏃讹紝闇� 閰嶇疆姝ら」
pathRewrite: { // 璺緞閲嶅啓,鏇挎崲target涓殑璇锋眰鍦板潃
['^' + process.env.VUE_APP_BASE_API]: '/api/'
--
Gitblit v1.9.3