From 36fc9186e39f2fd317603728b4ad3482a91b079b Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 三月 2025 14:22:48 +0800
Subject: [PATCH] 合并装备代码
---
src/views/business/inspectionTask/components/InspectionWord.vue | 2
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue | 2
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue | 2
src/views/business/productSamplingInfo/components/addQuarterItem.vue | 2
src/workers/DataWorker.worker.js | 0
src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue | 2
src/views/business/inspectionReview/index.vue | 49
src/views/business/productOrder/index.vue | 15
src/views/business/inspectionTask/index.vue | 201 +++--
src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue | 2
src/views/CNAS/process/ensureResults/qualityControlPlan/index.vue | 4
src/views/business/materialOrder/copperOrder.vue | 7
src/views/business/materialOrder/customsInspection.vue | 547 +++++++------
src/layout/components/Sidebar/SidebarItem.vue | 21
src/views/thirdpartylogin.vue | 21
src/views/business/productSamplingInfo/index.vue | 6
src/components/Table/lims-table.vue | 180 ++--
src/views/business/unpass/index.vue | 2
src/permission.js | 2
src/utils/dict/DictOptions.js | 1
src/assets/styles/sidebar.scss | 39
src/views/business/reportPreparation/index.vue | 8
src/views/business/finishedProductSampling/components/addQuarterItem.vue | 2
src/views/CNAS/personnel/personnelInfo/components/Edit.vue | 2
src/views/business/productOrder/components/add.vue | 44
src/views/business/inspectionTask/inspection.vue | 8
src/views/business/productOrder/components/cable-config.vue | 4
src/router/index.js | 2
src/views/business/materialOrder/index.vue | 70 +
src/components/UpPdfStamp/index.vue | 1
src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue | 2
src/utils/excelFountion.js | 2
src/views/business/unpass/components/PurchaseVerification.vue | 1
src/views/business/productOrder/components/printDialog.vue | 1
package.json | 1
src/views/CNAS/process/demand/index.vue | 20
src/workers/InspectionWorker.worker.js | 912 ------------------------
src/views/performance/manHour/workTimeConfig.vue | 3
src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue | 2
src/components/Preview/filePreview.vue | 1
src/views/business/productOrder/components/auxiliaryWireCore.vue | 9
41 files changed, 739 insertions(+), 1,463 deletions(-)
diff --git a/package.json b/package.json
index 750ba15..7e70330 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"@vue-office/excel": "^1.7.14",
"@vue/composition-api": "^1.7.2",
"axios": "0.28.1",
+ "big.js": "^6.2.2",
"clipboard": "2.0.8",
"core-js": "3.37.1",
"dom-to-image": "^2.6.0",
diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss
index e6f52a7..69f9693 100644
--- a/src/assets/styles/sidebar.scss
+++ b/src/assets/styles/sidebar.scss
@@ -1,17 +1,18 @@
#app {
+
.main-container {
height: 100%;
- transition: margin-left 0.28s;
+ transition: margin-left .28s;
margin-left: $base-sidebar-width;
position: relative;
}
.sidebarHide {
- margin-left: 0 !important;
+ margin-left: 0!important;
}
.sidebar-container {
- -webkit-transition: width 0.28s;
+ -webkit-transition: width .28s;
transition: width 0.28s;
width: $base-sidebar-width !important;
background-color: $base-menu-background;
@@ -23,13 +24,12 @@
left: 0;
z-index: 1001;
overflow: hidden;
- -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
+ -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
//box-shadow: 2px 0 6px rgba(0,21,41,.35);
// reset element-ui css
.horizontal-collapse-transition {
- transition: 0s width ease-in-out, 0s padding-left ease-in-out,
- 0s padding-right ease-in-out;
+ transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
}
.scrollbar-wrapper {
@@ -70,8 +70,7 @@
width: 100% !important;
}
- .el-menu-item,
- .el-submenu__title {
+ .el-menu-item, .el-submenu__title {
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
@@ -81,7 +80,7 @@
.submenu-title-noDropdown,
.el-submenu__title {
&:hover {
- background-color: rgba(0, 0, 0, 0.06) !important;
+ background-color: rgba(0, 0, 0, 0.08) !important;
}
}
@@ -89,16 +88,16 @@
color: $base-menu-color-active !important;
}
- & .nest-menu .el-submenu > .el-submenu__title,
+ & .nest-menu .el-submenu>.el-submenu__title,
& .el-submenu .el-menu-item {
min-width: $base-sidebar-width !important;
&:hover {
- background-color: rgba(0, 0, 0, 0.06) !important;
+ background-color: rgba(0, 0, 0, 0.08) !important;
}
}
- & .theme-dark .nest-menu .el-submenu > .el-submenu__title,
+ & .theme-dark .nest-menu .el-submenu>.el-submenu__title,
& .theme-dark .el-submenu .el-menu-item {
background-color: $base-sub-menu-background !important;
@@ -138,7 +137,7 @@
.el-submenu {
overflow: hidden;
- & > .el-submenu__title {
+ &>.el-submenu__title {
padding: 0 !important;
.svg-icon {
@@ -146,17 +145,18 @@
height: 1.5em;
margin-left: 25px;
}
+
}
}
.el-menu--collapse {
.el-submenu {
- & > .el-submenu__title {
+ &>.el-submenu__title {
height: auto; /* 鏍规嵁鍐呭鑷姩璋冩暣楂樺害 */
flex-direction: column; /* 鏀瑰彉甯冨眬鏂瑰悜涓哄瀭鐩� */
align-items: center; /* 灞呬腑瀵归綈 */
margin-bottom: 10px;
- & > span {
+ &>span {
display: block !important;
visibility: visible !important;
white-space: normal; /* 鍏佽鎹㈣ */
@@ -179,7 +179,7 @@
}
.sidebar-container {
- transition: transform 0.28s;
+ transition: transform .28s;
width: $base-sidebar-width !important;
}
@@ -193,6 +193,7 @@
}
.withoutAnimation {
+
.main-container,
.sidebar-container {
transition: none;
@@ -202,13 +203,13 @@
// when menu collapsed
.el-menu--vertical {
- & > .el-menu {
+ &>.el-menu {
.svg-icon {
margin-right: 16px;
}
}
- .nest-menu .el-submenu > .el-submenu__title,
+ .nest-menu .el-submenu>.el-submenu__title,
.el-menu-item {
&:hover {
// you can use $subMenuHover
@@ -217,7 +218,7 @@
}
// the scroll bar appears when the subMenu is too long
- > .el-menu--popup {
+ >.el-menu--popup {
max-height: 100vh;
overflow-y: auto;
diff --git a/src/components/Preview/filePreview.vue b/src/components/Preview/filePreview.vue
index f1c8d13..7633c5e 100644
--- a/src/components/Preview/filePreview.vue
+++ b/src/components/Preview/filePreview.vue
@@ -96,7 +96,6 @@
if (state) {
this.imgUrl = this.fileUrl.replaceAll('word', 'img')
}
- console.log(2222, this.imgUrl)
return state;
},
isPdf() {
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index dad9288..3accd8a 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -11,10 +11,10 @@
<el-table-column v-for="(item, index) in column" :key="index" :column-key="item.columnKey"
:filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
- :filters="item.filters" :fixed="item.fixed" :label="item.label" :min-width="item.minWidth" :prop="item.prop"
- :show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true"
- :sortable="item.sortable ? true : false" :type="item.type"
- :width="item.dataType == 'action' ? btnWidth : item.width" align="center">
+ :filters="item.filters" :fixed="item.fixed" :label="item.label" :prop="item.prop"
+ :show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true"
+ :min-width="item.dataType == 'action' ? btnWidth : getTitleWidth(item)"
+ :sortable="item.sortable ? true : false" :type="item.type" :width="item.dataType == 'action' ? btnWidth : getTitleWidth(item)" align="center">
<!-- <div class="123" v-if="item.type == ''"> -->
<template v-if="item.hasOwnProperty('colunmTemplate')" :slot="item.colunmTemplate" slot-scope="scope">
<slot v-if="item.theadSlot" :index="index" :name="item.theadSlot" :row="scope.row" />
@@ -63,7 +63,8 @@
</div>
<!-- 鎸夐挳 -->
- <div v-else-if="item.dataType == 'action'" :style="`width:${getWidth(item.operation, scope.row)}`">
+ <div v-else-if="item.dataType == 'action'"
+ :style="`width:${getWidth(item.operation, scope.row)}`">
<template v-for="(o, key) in item.operation">
<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"
@@ -72,13 +73,19 @@
{{ o.name }}
</el-button>
<el-upload :action="javaApi + o.url + '?id=' + (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)"
- size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false" :limit="1"
+ :key="uploadKeys[scope.$index]"
+ ref="uploadRef"
+ size="mini" :multiple="o.multiple ? o.multiple : false" :limit="1"
: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-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError"
- :on-exceed="onExceed" :on-success="handleSuccessUp" :show-file-list="false" :key="key">
+ v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader"
+ :before-upload="(file) => beforeUpload(file, scope.$index)"
+ :on-change="(file, fileList) => handleChange(file, fileList, scope.$index)"
+ :on-error="(error, file, fileList) => onError(error, file, fileList, scope.$index)"
+ :on-success="(response, file, fileList) => handleSuccessUp(response, file, fileList, scope.$index)"
+ :on-exceed="onExceed" :show-file-list="false">
<el-button :size="o.size ? o.size : 'small'" type="text"
:disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
</el-upload>
@@ -99,7 +106,7 @@
</template>
</el-table-column>
</el-table>
- <pagination v-if="page" v-show="page.total > 0" :total="page.total" :layout="page.layout" :page.sync="page.current"
+ <pagination v-show="page.total > 0" :total="page.total" :layout="page.layout" :page.sync="page.current"
:limit.sync="page.size" @pagination="pagination" />
</div>
</template>
@@ -158,7 +165,6 @@
name: "ZTTable",
filters: {
typeFn(val, row) {
- // console.log(val, row, '11111111');
if (typeof val === "function") {
return val(row);
} else return val;
@@ -258,27 +264,61 @@
data() {
return {
spanList: [],
- btnWidth: '120px',
+ btnWidth: "120px",
+ uploadRefs: [],
+ currentFiles: {}, // 鐢ㄤ簬瀛樺偍姣忚鐨勫綋鍓嶆枃浠�
+ uploadKeys: {} // 鐢ㄤ簬鍔ㄦ�侀噸缃粍浠�
};
},
mounted() {
this.calculateSpanInfo();
this.$nextTick(() => {
this.$refs.multipleTable.doLayout();
- });
+ this.tableData.forEach((_, index) => {
+ if (this.$refs.uploadRef) {
+ this.$refs.uploadRef[index] = this.$refs.uploadRef[index] || {};
+ }
+ });
+ })
+ },
+ watch: {
+ tableData: {
+ handler() {
+ // 褰撹〃鏍兼暟鎹彉鍖栨椂锛屽垵濮嬪寲 uploadKeys
+ this.tableData.forEach((_, index) => {
+ this.$set(this.uploadKeys, index, Date.now());
+ });
+ },
+ immediate: true
+ }
},
methods: {
- getWidth(row) {
+ getWidth(row, row0) {
let count = 0;
row.forEach((a) => {
- if (a.showHide !== undefined && a.showHide()) {
+ if (a.showHide !== undefined && a.showHide(row0)) {
count += a.name.length;
} else if (!a.showHide) {
count += a.name.length;
}
});
- this.btnWidth = count * 15 + 80 + "px";
- return count * 15 + 80 + "px";
+ this.btnWidth = count * 15 + 50 + "px";
+ return count * 15 + 50 + "px";
+ },
+ getTitleWidth(row) {
+ if (row.label.includes('鏃堕棿') || row.label.includes('缂栧彿') || row.label.includes('鏍峰搧鍚嶇О') || row.label.includes('闆朵欢')) {
+ return 160
+ } else if (row.label.includes('鎿嶄綔')) {
+ return row.width
+ } else {
+ const span = document.createElement('span');
+ span.innerText = row.label;
+ document.body.appendChild(span);
+ const width = `${span.offsetWidth + 50}px`;
+ document.body.removeChild(span);
+
+ return width;
+ }
},
iconFn(row) {
if (row.name === "缂栬緫" || row.name === "淇敼") {
@@ -290,9 +330,6 @@
} else {
return row.icon;
}
- // if (typeof (val) === 'function') {
- // return val(row);
- // } else return val;
},
formatType(val, format) {
if (typeof format === "function") {
@@ -307,21 +344,53 @@
setCurrent(row) {
this.$refs.multipleTable.setCurrentRow();
},
- handleSuccessUp(response, label) {
- if (typeof label === "string") {
- if (response.code == 200) {
- this.upData[label] = response.data.url;
+ handleSuccessUp(response, file, fileList, index) {
+ if (response.code == 200) {
+ // 娓呴櫎鏂囦欢鍒楄〃骞舵洿鏂板綋鍓嶆枃浠�
+ if (this.uploadRefs[index]) {
+ this.uploadRefs[index].clearFiles();
}
+ this.currentFiles[index] = file;
+ this.$message.success("涓婁紶鎴愬姛");
+ // 閲嶇疆缁勪欢鐘舵��
+ this.resetUploadComponent(index);
+
} else {
- if (response.code == 200) {
- this.$message.success("涓婁紶鎴愬姛");
- }
+ this.$message.error(response.message);
}
},
- onError(err, file, fileList) {
- this.$message.error("涓婁紶澶辫触");
- this.$refs.upload.clearFiles();
- this.uploading = false;
+ resetUploadComponent(index) {
+ // 鍔ㄦ�佹敼鍙� key 鏉ュ己鍒堕噸缃粍浠�
+ this.uploadKeys[index] = Date.now(); // 浣跨敤鏃堕棿鎴充綔涓烘柊鐨� key
+ },
+ handleChange(file, fileList, index) {
+ // 濡傛灉鏂囦欢鏁伴噺瓒呰繃闄愬埗锛岀Щ闄ゆ渶鏃╃殑鏂囦欢
+ if (fileList.length > 1) {
+ // 绉婚櫎鏈�鏃╃殑鏂囦欢
+ const earliestFile = fileList[0];
+ this.uploadRefs[index].handleRemove(earliestFile);
+ }
+
+ // 鏇存柊褰撳墠鏂囦欢
+ this.currentFiles[index] = file;
+ },
+ beforeUpload (file, index) {
+ this.currentFiles[index] = {}
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ // this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onError(error, file, fileList, index) {
+ this.$message.error('鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯');
+
+ // 娓呴櫎鏂囦欢鍒楄〃
+ if (this.uploadRefs[index]) {
+ this.uploadRefs[index].clearFiles();
+ }
},
onExceed() {
this.$message.warning("瓒呭嚭鏂囦欢涓暟");
@@ -330,7 +399,6 @@
this.$emit("pagination", { page: page, limit: limit });
},
indexMethod(index) {
- // return index * 2;
return (this.page.current - 1) * this.page.size + index + 1;
},
// 鐐瑰嚮鍗曞厓鏍糽ink浜嬩欢
@@ -399,40 +467,7 @@
};
}
}
- // // 鐗规畩鐨勫悎骞惰
- // if (
- // this.data.spanConfig != undefined &&
- // this.data.spanConfig.special &&
- // this.data.spanConfig.special.main &&
- // this.data.spanConfig.special.rows &&
- // this.data.spanConfig.special.rows.length > 0
- // ) {
- // let i = null;
- // let obj = this.data.spanConfig.special.rows.find((item, index) => {
- // i = index;
- // return item.index == columnIndex;
- // });
- // if (obj) {
- // const _row = this.specialSpanList[i].arr[rowIndex];
- // const _col = _row > 0 ? 1 : 0;
- // return {
- // rowspan: _row,
- // colspan: _col,
- // };
- // }
- // }
},
- // 鍥炴樉澶氶�夐�変腑鐘舵��
- toggleRowSelection(list) {
- this.$nextTick(() => {
- this.tableData.forEach(row => {
- let obj = list.find(m => m == row[this.rowKey])
- if (obj) {
- this.$refs.multipleTable.toggleRowSelection(obj, true);
- }
- });
- });
- }
},
};
</script>
@@ -442,10 +477,13 @@
text-align: center;
}
+.link {
+ color: rgb(64, 158, 255);
+ cursor: pointer;
+}
>>>.cell {
padding: 0 !important;
}
-
.cell {
white-space: nowrap;
overflow: hidden;
@@ -454,17 +492,10 @@
padding-left: 10px !important;
}
-.link {
- color: rgb(64, 158, 255);
- cursor: pointer;
-}
-
>>>.el-table__body-wrapper::-webkit-scrollbar {
height: 10px;
/* 璁剧疆婊氬姩鏉″搴� */
}
-</style>
-<style>
.lims-table .highlight-warning-row-border td:first-child {
border-left: 4px solid #ffcd29;
}
@@ -472,11 +503,6 @@
.lims-table .highlight-warning-row-border td:last-child {
border-right: 4px solid #ffcd29;
}
-
-/* .lims-table .highlight-danger-row-border td {
- border-top: 2px solid red;
- border-bottom: 2px solid red;
- } */
.lims-table .highlight-danger-row-border td:first-child {
border-left: 4px solid #f56c6c;
diff --git a/src/components/UpPdfStamp/index.vue b/src/components/UpPdfStamp/index.vue
index 844eac4..9e83bc3 100644
--- a/src/components/UpPdfStamp/index.vue
+++ b/src/components/UpPdfStamp/index.vue
@@ -125,7 +125,6 @@
// 娓叉煋绔�
drawStamps(x, y, index) {
var img = new Image();
- console.log(this.stampsName)
// 璁剧疆鍥剧墖婧�
img.src = require("@/assets/stamps/" + this.stampsName + ".png"); // 鏇挎崲涓轰綘鐨勫浘鐗囬摼鎺�
let that = this
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 3b68ff2..1a7b1bf 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -1,10 +1,9 @@
<template>
<div v-if="!item.hidden">
- <template
- v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
+ <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
- <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
- <item :icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" :title="onlyOneChild.meta.title" />
+ <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
+ <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
</el-menu-item>
</app-link>
</template>
@@ -13,8 +12,14 @@
<template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</template>
- <sidebar-item v-for="(child, index) in item.children" :key="child.path + index" :is-nest="true" :item="child"
- :base-path="resolvePath(child.path)" class="nest-menu" />
+ <sidebar-item
+ v-for="(child, index) in item.children"
+ :key="child.path + index"
+ :is-nest="true"
+ :item="child"
+ :base-path="resolvePath(child.path)"
+ class="nest-menu"
+ />
</el-submenu>
</div>
</template>
@@ -70,7 +75,7 @@
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
- this.onlyOneChild = { ...parent, path: '', noShowingChildren: true }
+ this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
return true
}
@@ -96,4 +101,4 @@
::v-deep .el-submenu__title i {
color: #ffffff !important;
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/permission.js b/src/permission.js
index b66190b..dbae342 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -9,7 +9,7 @@
NProgress.configure({ showSpinner: false })
-const whiteList = ['/login', '/register']
+const whiteList = ['/login', '/register', '/thirdpartylogin', '/logindemo']
const isWhiteList = (path) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
diff --git a/src/router/index.js b/src/router/index.js
index 9d4db52..e2b4cf6 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -74,7 +74,7 @@
hidden: true,
},
{
- path: "",
+ path: "/",
component: Layout,
redirect: "index",
children: [
diff --git a/src/utils/dict/DictOptions.js b/src/utils/dict/DictOptions.js
index 338a94e..9eb9daf 100644
--- a/src/utils/dict/DictOptions.js
+++ b/src/utils/dict/DictOptions.js
@@ -8,7 +8,6 @@
* 瀛楀吀璇锋眰锛屾柟娉曠鍚嶄负function(dictMeta: DictMeta): Promise
*/
request: (dictMeta) => {
- console.log(`load dict ${dictMeta.type}`)
return Promise.resolve([])
},
/**
diff --git a/src/utils/excelFountion.js b/src/utils/excelFountion.js
index eced05c..3cd11a9 100644
--- a/src/utils/excelFountion.js
+++ b/src/utils/excelFountion.js
@@ -46,7 +46,6 @@
let min = null;
if (val && val.length > 0) {
val = val.filter((item) => item != null && item !== "");
- // console.log(val)
if (val.length > 0) {
min = Math.min(...val);
}
@@ -255,7 +254,6 @@
fouList.forEach((item) => {
f = f.replace(new RegExp(item, "g"), "");
});
- // console.log('f',f)
let arr = f.split(",").filter((item) => {
return (
item && /[a-zA-Z]/.test(item) && item != "undefined" && item != "null"
diff --git a/src/views/CNAS/personnel/personnelInfo/components/Edit.vue b/src/views/CNAS/personnel/personnelInfo/components/Edit.vue
index 639af6b..0076ed3 100644
--- a/src/views/CNAS/personnel/personnelInfo/components/Edit.vue
+++ b/src/views/CNAS/personnel/personnelInfo/components/Edit.vue
@@ -371,7 +371,7 @@
}
},
getUserList(){
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
this.userList = res.data;
})
},
diff --git a/src/views/CNAS/process/demand/index.vue b/src/views/CNAS/process/demand/index.vue
index ef70abd..6d9b25b 100644
--- a/src/views/CNAS/process/demand/index.vue
+++ b/src/views/CNAS/process/demand/index.vue
@@ -17,7 +17,7 @@
<el-form-item label="濮旀墭浜�" prop="commissionUser">
<el-input v-model="entitySearch.commissionUser" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="refreshTable()"></el-input>
- </el-form-item>
+ </el-form-item>li
<el-form-item>
<el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">鏌� 璇�</el-button>
@@ -29,14 +29,14 @@
</div>
<div class="table">
<el-table v-loading="tableListLoading" :data="tableList"
- height="630" style="width: 100%" border :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }">
- <el-table-column align="center" label="搴忓彿" type="index" width="60"></el-table-column>
- <el-table-column label="璇曟牱鍚嶇О" prop="sampleName" show-overflow-tooltip width="120"></el-table-column>
- <el-table-column label="濮旀墭缂栧彿" prop="entrustCode" show-overflow-tooltip width="120"></el-table-column>
- <el-table-column label="濮旀墭鏃堕棿" prop="commissionDate" width="120"></el-table-column>
- <el-table-column label="鍨嬪彿" prop="modelNo"></el-table-column>
- <el-table-column label="濮旀墭鍗曚綅" prop="commissionUnit" show-overflow-tooltip width="120"></el-table-column>
- <el-table-column label="鐢熶骇鍗曚綅" prop="production" show-overflow-tooltip width="120"></el-table-column>
+ height="630" border :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }">
+ <el-table-column align="center" label="搴忓彿" type="index"></el-table-column>
+ <el-table-column label="璇曟牱鍚嶇О" prop="sampleName" show-overflow-tooltip></el-table-column>
+ <el-table-column label="濮旀墭缂栧彿" prop="entrustCode" show-overflow-tooltip></el-table-column>
+ <el-table-column label="濮旀墭鏃堕棿" prop="commissionDate" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鍨嬪彿" prop="modelNo" show-overflow-tooltip></el-table-column>
+ <el-table-column label="濮旀墭鍗曚綅" prop="commissionUnit" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鐢熶骇鍗曚綅" prop="production" show-overflow-tooltip></el-table-column>
<el-table-column label="濮旀墭浜�" prop="commissionUser"></el-table-column>
<el-table-column label="鏍峰搧鏁伴噺" prop="quantity"></el-table-column>
<el-table-column label="鏍峰搧鐘舵��" prop="sampleStatus"></el-table-column>
@@ -46,7 +46,7 @@
<span v-if="scope.row.isLeave === 0">鍚�</span>
</template>
</el-table-column>
- <el-table-column label="鏍峰搧澶勭悊鏂瑰紡" prop="processing">
+ <el-table-column label="鏍峰搧澶勭悊鏂瑰紡" prop="processing" width="150">
<template slot-scope="scope">
<span v-if="scope.row.processing === 1">瀹為獙瀹ゅ鐞�</span>
<span v-if="scope.row.processing === 0">濮旀墭鍗曚綅鍙栧洖</span>
diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
index e568f28..7b4f94e 100644
--- a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
@@ -254,7 +254,7 @@
this.$emit('closeCarryOutDia')
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue
index bd3bd9b..25d5c22 100644
--- a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue
@@ -296,7 +296,7 @@
})
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue
index 8ce627d..7672cfe 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue
@@ -162,7 +162,7 @@
this.$emit('closeDia')
},
getUserList(){
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
this.userList = res.data;
})
},
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
index a337f53..0b7fb4b 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
@@ -449,7 +449,7 @@
this.$emit('closeProcessingDia')
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
index b5c9e52..3c57bb1 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
@@ -376,7 +376,7 @@
this.$emit('closeRecordsDia')
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
index 2ee9c46..da1212b 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
@@ -406,7 +406,7 @@
this.showStep = step
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/index.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/index.vue
index 6ec2abf..36da145 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/index.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/index.vue
@@ -200,7 +200,6 @@
minWidth: '160'
}, {
dataType: 'action',
- minWidth: '170',
label: '鎿嶄綔',
fixed: 'right',
operation: [
@@ -284,7 +283,6 @@
minWidth: '150px'
}, {
dataType: 'action',
- width: '260',
label: '鎿嶄綔',
fixed: 'right',
operation: [
@@ -473,7 +471,7 @@
this.getUserList()
},
getUserList() {
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
this.userList = res.data;
})
},
diff --git a/src/views/business/finishedProductSampling/components/addQuarterItem.vue b/src/views/business/finishedProductSampling/components/addQuarterItem.vue
index bea5678..c4b20b1 100644
--- a/src/views/business/finishedProductSampling/components/addQuarterItem.vue
+++ b/src/views/business/finishedProductSampling/components/addQuarterItem.vue
@@ -279,7 +279,7 @@
}
},
getUserList(){
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition().then((res) => {
this.userList = res.data;
})
},
diff --git a/src/views/business/inspectionReview/index.vue b/src/views/business/inspectionReview/index.vue
index 8b979dc..8705d53 100644
--- a/src/views/business/inspectionReview/index.vue
+++ b/src/views/business/inspectionReview/index.vue
@@ -23,8 +23,8 @@
</div>
<div>
<lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
- :rowClassName="rowClassName" :height="'calc(100vh - 270px)'" @pagination="pagination"
- key="tableData0"></lims-table>
+ :rowClassName="rowClassName" :height="'calc(100vh - 270px)'" @pagination="pagination"
+ key="tableData0"></lims-table>
</div>
<!--鎶ュ憡鏌ョ湅-->
<el-dialog title="鎶ュ憡鏌ョ湅" :visible.sync="issuedVisible" width="80vw" :modal-append-to-body="false"
@@ -108,7 +108,18 @@
prop: "type",
dataType: "tag",
formatData: (params) => {
- return this.urgencyLevel.find((m) => m.value == params).label;
+ if (this.urgencyLevel.find((m) => m.value == params)) {
+ return this.urgencyLevel.find((m) => m.value == params).label;
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (this.urgencyLevel.find((m) => m.value == params)) {
+ return this.urgencyLevel.find((m) => m.value == params).type;
+ } else {
+ return null
+ }
},
},
{
@@ -128,11 +139,18 @@
prop: "insState",
dataType: "tag",
formatData: (params) => {
- return this.inspectionTaskState.find((m) => m.value == params)
- .label;
+ if (this.inspectionTaskState.find((m) => m.value == params)) {
+ return this.inspectionTaskState.find((m) => m.value == params).label;
+ } else {
+ return null
+ }
},
formatType: (params) => {
- return this.inspectionTaskState.find((m) => m.value == params).type;
+ if (this.inspectionTaskState.find((m) => m.value == params)) {
+ return this.inspectionTaskState.find((m) => m.value == params).type;
+ } else {
+ return null
+ }
},
},
{ label: "妫�楠屼汉", prop: "userName" },
@@ -229,10 +247,10 @@
fullscreen: false,
option: null,
orderTypeList: [
- { label: '濮旀墭璇曢獙', value: 'Customer-ordered test' },
- { label: '鎶芥', value: '鎶芥' },
- { label: '杩涘巶妫�楠�', value: '杩涘巶妫�楠�' },
- { label: '瀛e害妫�楠�', value: 'Quarterly inspection' },
+ { label: '濮旀墭璇曢獙', value: 'Customer-ordered test', type: 'success' },
+ { label: '鎶芥', value: '鎶芥', type: 'danger' },
+ { label: '杩涘巶妫�楠�', value: '杩涘巶妫�楠�', type: 'info' },
+ { label: '瀛e害妫�楠�', value: 'Quarterly inspection', type: '' },
],
urgencyLevel: [],
inspectionTaskState: [],
@@ -286,13 +304,6 @@
}
return "";
},
- // 鏌ョ湅浜т笟閾句俊鎭�
- // openInfoDialog (row) {
- // this.showInfoDialog = true
- // this.$nextTick(() => {
- // this.$refs.showInfoDialog.getInfo(row.ifsInventoryId)
- // })
- // },
selectAllByOne(row) {
this.isCopper = row.isCopper
this.customsInspection = row
@@ -373,10 +384,6 @@
// 鏌ョ湅鎶ュ憡
handleIssued(row) {
// todo: 鏌ョ湅鎶ュ憡缁勪欢
-/* if (!row.tempUrlPdf) return this.$message.warning('鏂囦欢鏈笂浼�')
- this.currentInfo = row
- this.lookDialogVisible = true*/
- console.log(this.javaApi)
this.currentInfo = row;
let fileName = row.url
let fileType = "docx"
diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 620a42f..7991e24 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -1919,7 +1919,7 @@
}
},
getAuthorizedPerson() {
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 1 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/business/inspectionTask/index.vue b/src/views/business/inspectionTask/index.vue
index c1b6a22..b635be5 100644
--- a/src/views/business/inspectionTask/index.vue
+++ b/src/views/business/inspectionTask/index.vue
@@ -50,7 +50,50 @@
</div>
<lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
:rowClassName="rowClassName" :height="'calc(100vh - 300px)'" @pagination="pagination"
- key="tableData0"></lims-table>
+ key="tableData0">
+ <div slot="action" slot-scope="scope">
+ <el-button size="small" type="text" @click="handleDataLook(scope.row)">鏁版嵁鏌ョ湅</el-button>
+ <el-button type="text" size="small"
+ :disabled="(scope.row.userName == null || scope.row.insState == 3 || scope.row.insState == 5) && checkPermi(['update:product:onPlan'])"
+ @click="editInspection(scope.row)">淇敼妫�楠屽��</el-button>
+ <el-button type="text" size="small" :disabled="(
+ scope.row.userName == null ||
+ scope.row.insState == 3 ||
+ scope.row.insState == 5 ||
+ (scope.row.userName && !scope.row.userName.includes(nickName))
+ )"
+ @click="handleInspection(scope.row)">妫�楠�</el-button>
+ <el-button type="text" size="small" :disabled="(
+ scope.row.userName == null ||
+ scope.row.insState == 5 ||
+ scope.row.insState == 3 ||
+ (scope.row.userName && !scope.row.userName.includes(nickName))
+ )"
+ @click="handleConnect(scope.row)">浜ゆ帴</el-button>
+ <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">鍘熷璁板綍</el-button>
+ <el-popover placement="bottom" trigger="hover" style="margin-left: 6px">
+ <template #reference>
+ <el-button link type="text" size="small">鏇村</el-button>
+ </template>
+ <div>
+ <el-button :disabled="scope.row.insState != 3" style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">涓嬭浇鎶ュ憡</el-button>
+ <el-upload ref='upload'
+ :action="javaApi + '/insReport/inReport'"
+ :before-upload="beforeUpload"
+ :data="{id: scope.row.insReportId}"
+ :headers="uploadHeader" :on-error="onError"
+ :on-success="handleSuccessUp"
+ :show-file-list="false"
+ style="display: inline;margin: 0 6px"
+ accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
+ <el-button :disabled="scope.row.insState != 3" size="small" type="text">涓婁紶</el-button>
+ </el-upload>
+ <el-button :disabled="scope.row.insState != 3" type="text" size="small" @click="handleRestore(scope.row)">杩樺師</el-button>
+ <el-button :disabled="scope.row.insState != 3" type="text" size="small" @click="handleIssued(scope.row)">鏌ョ湅鎶ュ憡</el-button>
+ </div>
+ </el-popover>
+ </div>
+ </lims-table>
</div>
</div>
<el-dialog :visible.sync="claimVisible" title="鎻愮ず" width="400px">
@@ -91,7 +134,7 @@
</span>
</el-dialog>
<el-dialog :visible.sync="dataDialogVisible" title="鏁版嵁鏌ョ湅" width="80%">
- <div v-if="dataDialogVisible" style="height: 70vh; overflow-y: auto">
+ <div v-if="dataDialogVisible" style="height: 74vh; overflow-y: auto">
<div>
<el-form :model="entity" :inline="true">
<el-form-item label="妫�楠岄」" prop="outputWorkTime">
@@ -184,6 +227,7 @@
} from "@/api/business/inspectionTask.js";
import { mapGetters } from "vuex";
import {getRetestResult} from "@/api/business/rawMaterialOrder";
+import {upReportUrl} from "@/api/business/insReport";
export default {
name: 'InspectionTask',
components: {
@@ -363,80 +407,16 @@
{ label: "妫�楠屽紑濮嬫椂闂�", prop: "insTime", width: "140px" },
{ label: "鐞嗙敱", prop: "verifyTell", width: "140px" },
{
- dataType: "action",
fixed: "right",
- label: "鎿嶄綔",
- operation: [
- {
- name: "鏁版嵁鏌ョ湅",
- type: "text",
- clickFun: (row) => {
- this.handleDataLook(row);
- },
- },
- {
- name: "淇敼妫�楠屽��",
- type: "text",
- clickFun: (row) => {
- this.editInspection(row);
- },
- disabled: (row) => {
- return (row.userName == null || row.insState == 3 || row.insState == 5) && this.checkPermi(['update:product:onPlan'])
- },
- },
- {
- name: "鏌ョ湅宸ユ椂",
- type: "text",
- clickFun: (row) => {
- this.viewManHour(row);
- },
- showHide: (row) => {
- return this.checkPermi(['get:working:hours:byOrder'])
- },
- },
- {
- name: "妫�楠�",
- type: "text",
- clickFun: (row) => {
- this.handleInspection(row);
- },
- disabled: (row) => {
- return (
- row.userName == null ||
- row.insState == 3 ||
- row.insState == 5 ||
- (row.userName && !row.userName.includes(this.nickName))
- );
- },
- },
- {
- name: "浜ゆ帴",
- type: "text",
- clickFun: (row) => {
- this.handleConnect(row);
- },
- disabled: (row) => {
- return (
- row.userName == null ||
- row.insState == 5 ||
- row.insState == 3 ||
- (row.userName && !row.userName.includes(this.nickName))
- );
- },
- },
- {
- name: "鍘熷璁板綍",
- type: "text",
- clickFun: (row) => {
- this.viewInspectInfo(row);
- },
- },
- ],
- },
+ dataType: "slot",
+ slot: "action",
+ width: '340px',
+ label: "鎿嶄綔"
+ }
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 0,
},
tableLoading: false,
@@ -535,7 +515,7 @@
],
lookPage: {
total: 0,
- size: 10,
+ size: 20,
current: 0,
},
lookTableLoading: false,
@@ -638,6 +618,56 @@
this.page.current = 1;
this.queryParams.typeSource = this.tabIndex;
this.getList();
+ },
+ // 涓嬭浇鎶ュ憡
+ download(row) {
+ let url = (row.urlS===null||row.urlS==='')?row.url:row.urlS
+ const link = document.createElement('a');
+ link.href = this.javaApi + url;
+ link.target = '_blank';
+ document.body.appendChild(link);
+ link.click();
+ },
+ // 杩樺師鎿嶄綔
+ handleRestore(row) {
+ this.$confirm('鏄惁杩樺師褰撳墠鎶ュ憡?', "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }).then(() => {
+ upReportUrl({ id: row.insReportId }).then(res => {
+ if (res.code === 200) {
+ this.$message.success('杩樺師鎴愬姛')
+ this.refreshTable()
+ }
+ })
+ }).catch(() => { })
+
+ },
+ // 鏌ョ湅鎶ュ憡
+ handleIssued(row) {
+ // todo: 鏌ョ湅鎶ュ憡缁勪欢
+ this.currentInfo = row;
+ let fileName = row.url
+ let fileType = "docx"
+ if (row.tempUrlPdf != null || row.tempUrlPdf === '') {
+ fileName = row.tempUrlPdf
+ fileType = "pdf"
+ }
+ fileName = fileName.replace('/word/','')
+ const userName = this.nickName
+ this.option = {
+ url: this.javaApi + "/word/" + fileName,
+ isEdit: false,
+ fileType: fileType,
+ title: fileName,
+ lang: 'zh-CN',
+ isPrint: false,
+ user_id: 1,
+ user_name: userName,
+ editUrl: this.javaApi + "/insReport/onlyOffice/save?fileName=" + fileName
+ }
+ this.issuedVisible = true;
},
// 鏌ョ湅浜т笟閾句俊鎭�
openInfoDialog(row) {
@@ -852,7 +882,6 @@
this.bindCurrentInfo = row;
getBindingProductByProductId({ productId: row.insProductId })
.then((res) => {
- // console.log(res)
this.bindTableData = res.data;
this.bindDialogVisible = true;
})
@@ -865,7 +894,6 @@
productId: this.bindCurrentInfo.insProductId,
})
.then((res) => {
- // console.log(res)
this.bindAddTableData = res.data;
this.bindAddDialogVisible = true;
})
@@ -915,6 +943,29 @@
});
});
},
+ beforeUpload (file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onError(error, file, fileList, index) {
+ this.$message.error('鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯');
+ },
+ onExceed() {
+ this.$message.warning("瓒呭嚭鏂囦欢涓暟");
+ },
+ handleSuccessUp(response) {
+ if (response.code == 200) {
+ this.$refs.upload.clearFiles()
+ this.$message.success("涓婁紶鎴愬姛");
+ } else {
+ this.$message.error(response.message);
+ }
+ },
},
};
</script>
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index a8b72dc..512b516 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -541,8 +541,8 @@
delfile,
inspectionOrderDetailsTaskSwitching
} from "@/api/business/inspectionTask.js";
-import InspectionWorker from '../../../InspectionWorker.worker';
-import DataWorker from '../../../DataWorker.worker';
+import InspectionWorker from '../../../workers/InspectionWorker.worker';
+import DataWorker from '../../../workers/DataWorker.worker';
import html2canvas from "html2canvas";
import { mapGetters } from "vuex";
import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
@@ -1133,7 +1133,6 @@
this.dataAcquisitionInfo = {};
this.getData = [];
for (let i in this.objectOrder(data)) {
- console.log("i---", i);
let obj = {};
if (i.includes("@")) {
obj = {
@@ -1476,7 +1475,6 @@
},
// 淇濆瓨婀垮害銆佹俯搴︽暟鎹�
subOtherForm(m, type) {
- console.log("m---", m);
write({
[type]: type === "remark" ? m : Number(m),
id: this.insOrder.id,
@@ -2747,7 +2745,7 @@
}
},
getAuthorizedPerson() {
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 1 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/business/materialOrder/copperOrder.vue b/src/views/business/materialOrder/copperOrder.vue
index 1f76b7c..25436fb 100644
--- a/src/views/business/materialOrder/copperOrder.vue
+++ b/src/views/business/materialOrder/copperOrder.vue
@@ -1808,4 +1808,11 @@
justify-content: space-between;
margin-bottom: 10px;
}
+>>>.warning-row {
+ color: #1890FF;
+}
+.node_i {
+ color: orange;
+ font-size: 18px;
+}
</style>
diff --git a/src/views/business/materialOrder/customsInspection.vue b/src/views/business/materialOrder/customsInspection.vue
index 2404734..e9a28fa 100644
--- a/src/views/business/materialOrder/customsInspection.vue
+++ b/src/views/business/materialOrder/customsInspection.vue
@@ -5,25 +5,23 @@
<div>
<span>閲囪喘璁㈠崟淇℃伅</span>
<ul class="tab" v-if="active > 1 && isShowTab">
- <li v-for="(m, i) in dataTitle" :key="i" :class="{ active: i === dataIndex }" @click="handleDataTab(m, i)">
- {{ m.label }}</li>
+ <li v-for="(m,i) in dataTitle" :key="i" :class="{active:i===dataIndex}" @click="handleDataTab(m,i)">{{m.label}}</li>
</ul>
</div>
<div>
- <el-select v-show="active == 1" v-model="template" placeholder="涓嬪崟妯℃澘" size="small" style="margin-right: 10px;"
- @change="selectInsOrderTemplateByIdList">
+ <el-select v-show="active==1" v-model="template" placeholder="涓嬪崟妯℃澘" size="small" style="margin-right: 10px;"
+ @change="selectInsOrderTemplateByIdList">
<el-option v-for="(a, ai) in templates" :key="ai" :label="a.name" :value="a.id">
<span style="float: left">{{ a.name }}</span>
<i class="el-icon-delete" style="float: right; color: #66b1ff; font-size: 16px"
- @click.stop="handleDelete(a)"></i>
+ @click.stop="handleDelete(a)"></i>
</el-option>
</el-select>
- <el-button v-show="active == 1" size="small" @click="templateDia = true">
+ <el-button v-show="active==1" size="small" @click="templateDia=true">
<span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
</el-button>
- <el-button v-show="active == 1 && addObj.orderType === '杩涘巶妫�楠�'" :loading="noNeedCheckLoad" size="small"
- type="primary" @click="noNeedCheck">鍏嶆</el-button>
- <el-button v-show="active == 1" :loading="saveLoad" size="small" type="primary" @click="save">鎻愪氦</el-button>
+ <el-button v-show="active==1 && addObj.orderType === '杩涘巶妫�楠�'" :loading="noNeedCheckLoad" size="small" type="primary" @click="noNeedCheck">鍏嶆</el-button>
+ <el-button v-show="active==1" :loading="saveLoad" size="small" type="primary" @click="save">鎻愪氦</el-button>
<el-button size="small" @click="goBack">
<span style="color: #3A7BFA;">杩斿洖</span>
</el-button>
@@ -35,41 +33,42 @@
<el-row>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="閲囪喘璁㈠崟鍙�:">
- <el-input v-model="addObj.orderNo" class="addObj-info" clearable disabled placeholder=""
- size="small"></el-input>
+ <el-input v-model="addObj.orderNo" class="addObj-info" clearable disabled placeholder="" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="濮旀墭鍗曚綅:">
- <el-input v-model="addObj.company" class="addObj-info" clearable disabled placeholder=""
- size="small"></el-input>
+ <el-input v-model="addObj.company" class="addObj-info" clearable disabled placeholder="" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="鎺ユ敹鏃堕棿:">
- <el-date-picker v-model="addObj.receiverDate" disabled placeholder="閫夋嫨鏃ユ湡" size="small"
- style="width: 100%;" type="date" value-format="yyyy-MM-dd">
+ <el-date-picker
+ v-model="addObj.receiverDate"
+ disabled
+ placeholder="閫夋嫨鏃ユ湡"
+ size="small"
+ style="width: 100%;"
+ type="date"
+ value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="闆朵欢鍙�:">
- <el-input v-model="addObj.partNo" class="addObj-info" clearable disabled placeholder=""
- size="small"></el-input>
+ <el-input v-model="addObj.partNo" class="addObj-info" clearable disabled placeholder="" size="small"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="鏍峰搧鍚嶇О:">
- <el-input v-model="addObj.sample" class="addObj-info" clearable disabled placeholder=""
- size="small"></el-input>
+ <el-input v-model="addObj.sample" class="addObj-info" clearable disabled placeholder="" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="鏍峰搧鎬绘暟:">
- <el-input v-model="addObj.qtyArrived" class="addObj-info" clearable disabled placeholder=""
- size="small"></el-input>
+ <el-input v-model="addObj.qtyArrived" class="addObj-info" clearable disabled placeholder="" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@@ -91,24 +90,22 @@
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="鎶芥鏁伴噺:" prop="testQuantity">
- <el-input v-model="addObj.testQuantity" :disabled="active > 1" class="addObj-info" clearable
- placeholder="璇峰~鍐欐娊妫�鏁伴噺" size="small"></el-input>
+ <el-input v-model="addObj.testQuantity" :disabled="active > 1" class="addObj-info"
+ clearable
+ placeholder="璇峰~鍐欐娊妫�鏁伴噺" size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="妫�楠岀被鍒�:" prop="orderType">
- <el-select v-model="addObj.orderType" :disabled="active > 1 || orderType == 1" clearable size="small"
- style="width: 100%">
- <el-option v-for="a in dict.type.check_type" :key="a.value" :label="a.label"
- :value="a.value"></el-option>
+ <el-select v-model="addObj.orderType" :disabled="active>1 || orderType==1" clearable size="small" style="width: 100%">
+ <el-option v-for="a in dict.type.check_type" :key="a.value" :label="a.label" :value="a.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="瑙勬牸鍨嬪彿:" placeholder="璇峰~鍐�" prop="partDetail">
<el-tooltip :content="addObj.partDetail" :disabled="!addObj.partDetail">
- <el-input v-model="addObj.partDetail" :disabled="active > 1" clearable class="addObj-info"
- size="small"></el-input>
+ <el-input v-model="addObj.partDetail" :disabled="active > 1" clearable class="addObj-info" size="small"></el-input>
</el-tooltip>
</el-form-item>
</el-col>
@@ -116,24 +113,29 @@
<el-row>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="绱ф�ョ▼搴�:" placeholder="璇烽�夋嫨" prop="type">
- <el-select v-model="addObj.type" :disabled="active > 1" class="addObj-info" clearable size="small"
- style="width: 100%">
- <el-option v-for="a in dict.type.urgency_level" :key="a.value" :label="a.label"
- :value="a.value"></el-option>
+ <el-select v-model="addObj.type" :disabled="active>1" class="addObj-info" clearable size="small" style="width: 100%">
+ <el-option v-for="a in dict.type.urgency_level" :key="a.value" :label="a.label" :value="a.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="绾﹀畾鏃堕棿:" prop="appointed">
- <el-date-picker v-model="addObj.appointed" :disabled="active > 1" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡"
- size="small" style="width: 100%" type="date" value-format="yyyy-MM-dd">
+ <el-date-picker
+ v-model="addObj.appointed"
+ :disabled="active > 1"
+ format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡"
+ size="small"
+ style="width: 100%"
+ type="date"
+ value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="addObj-form-item" label="澶囨敞:">
- <el-input v-model="addObj.remark" :autosize="{ minRows: 2, maxRows: 2 }" :disabled="active > 1"
- :placeholder="active > 1 ? '' : '璇疯緭鍏�'" clearable size="small" type="textarea"></el-input>
+ <el-input v-model="addObj.remark" :autosize="{ minRows: 2, maxRows: 2}" :disabled="active>1" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable
+ size="small" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
@@ -141,146 +143,162 @@
</div>
<div>
<div style="display: flex;justify-content: space-between;background-color: #F5F7FB;margin-bottom: 6px">
- <div v-if="active == 1">
+ <div v-if="active==1">
<el-form :inline="true" :model="addObj1" label-width="90px">
<el-form-item label="鏍峰搧鍨嬪彿:" style="margin-bottom: 6px;margin-top: 6px">
- <el-select v-model="model" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" allow-create clearable
- default-first-option filterable size="small" @change="changeModel">
+ <el-select v-model="model" :placeholder="active>1 ? '' : '璇疯緭鍏�'"
+ allow-create clearable default-first-option filterable
+ size="small"
+ @change="changeModel">
<el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="妫�楠屾爣鍑�:" style="margin-bottom: 6px;margin-top: 6px">
- <el-select v-model="standardMethodListId" :loading="methodLoad" :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
- clearable size="small" @change="changeStandardMethodListId" @focus="methodFocus">
+ <el-select v-model="standardMethodListId" :loading="methodLoad"
+ :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable size="small"
+ @change="changeStandardMethodListId" @focus="methodFocus">
<el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="" style="margin-bottom: 6px;margin-top: 6px">
- <el-button type="primary" size="small">杞﹂棿闄勪欢鏌ョ湅</el-button>
- </el-form-item>
</el-form>
</div>
<div style="margin-bottom: 6px;margin-top: 6px">
- <el-button v-show="active == 1" :disabled="sampleList.length === 2" size="small" type="primary"
- @click="handleSplitCountNum">鎷嗗垎</el-button>
+ <el-button v-show="active==1" :disabled="sampleList.length === 2" size="small" type="primary" @click="handleSplitCountNum">鎷嗗垎</el-button>
</div>
</div>
- <el-table ref="sampleTable" :data="sampleList" class="el-table sampleTable" highlight-current-row
- :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border max-height="400px" tooltip-effect="dark"
- @selection-change="selectSample" @row-click="rowClick">
- <el-table-column v-if="active == 1" :selectable="selectable" type="selection" width="65"></el-table-column>
+ <el-table ref="sampleTable" :data="sampleList"
+ class="el-table sampleTable"
+ highlight-current-row
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ max-height="400px"
+ tooltip-effect="dark"
+ @selection-change="selectSample" @row-click="rowClick">
+ <el-table-column v-if="active==1" :selectable="selectable" type="selection" width="65"></el-table-column>
<el-table-column align="center" label="搴忓彿" prop="index" type="index" width="65"></el-table-column>
<el-table-column align="center" label="鏍峰搧鍚嶇О" min-width="100" prop="sample">
<template slot-scope="scope">
- <el-input v-model="scope.row.sample" :disabled="active > 1 || scope.$index !== 0" size="small"
- @change="(val) => changeValue(val, 'sample')"></el-input>
+ <el-input v-model="scope.row.sample" :disabled="active>1 || scope.$index !== 0" size="small" @change="(val)=>changeValue(val, 'sample')"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="鏍峰搧缂栧彿" min-width="140" prop="sampleCode">
<template slot-scope="scope">
- <el-input v-model="scope.row.sampleCode" :disabled="active > 1 || scope.$index !== 0" clearable
- placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚" size="small" @change="(val) => changeValue(val, 'sampleCode')"></el-input>
+ <el-input v-model="scope.row.sampleCode" :disabled="active>1 || scope.$index !== 0" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚"
+ size="small"
+ @change="(val)=>changeValue(val, 'sampleCode')"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="鏍峰搧鍨嬪彿" min-width="100" prop="model">
<template slot-scope="scope">
- <el-select v-model="scope.row.model" :disabled="active > 1 || scope.$index !== 0" allow-create
- default-first-option filterable placeholder="鏍峰搧鍨嬪彿" size="small" style="width: 100%;"
- @change="handleChangeModel">
+ <el-select v-model="scope.row.model" :disabled="active>1 || scope.$index !== 0" allow-create default-first-option filterable
+ placeholder="鏍峰搧鍨嬪彿" size="small" style="width: 100%;" @change="handleChangeModel">
<el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
- <el-table-column v-if="!(active > 1)" align="center" label="鍨嬪彿鍙傛暟" prop="modelNum" width="130">
+ <el-table-column v-if="!(active>1)" align="center" label="鍨嬪彿鍙傛暟" prop="modelNum" width="130">
<template slot-scope="scope">
- <el-input v-model="scope.row.modelNum" :disabled="active > 1 || scope.$index !== 0" clearable
- placeholder="闈炲繀濉�" size="small"
- @input="methodChange(scope.row.standardMethodListId, scope.row)"></el-input>
+ <el-input v-model="scope.row.modelNum" :disabled="active>1|| scope.$index !== 0" clearable placeholder="闈炲繀濉�"
+ size="small"
+ @input="methodChange(scope.row.standardMethodListId, scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column align="center" label="妫�楠屾爣鍑�" min-width="100" prop="standardMethodListId">
<template slot-scope="scope">
- <el-select v-model="scope.row.standardMethodListId"
- :disabled="scope.row.model == null || active > 1 || scope.$index !== 0" :loading="methodLoad" clearable
- placeholder="妫�楠屾爣鍑�" size="small" style="width: 100%;" @change="(value) => methodChange(value, scope.row)"
- @clear="productList = []" @focus="methodFocus">
+ <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1|| scope.$index !== 0"
+ :loading="methodLoad" clearable placeholder="妫�楠屾爣鍑�" size="small"
+ style="width: 100%;" @change="(value)=>methodChange(value, scope.row)" @clear="productList = []" @focus="methodFocus">
<el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
- <el-table-column v-if="addObj.mating == 1" align="center" label="閰嶅鏍峰搧鍚嶇О" prop="joinName" width="140">
+ <el-table-column v-if="addObj.mating==1" align="center" label="閰嶅鏍峰搧鍚嶇О" prop="joinName" width="140">
<template slot-scope="scope">
- <el-input v-model="scope.row.joinName" :autosize="{ minRows: 1, maxRows: 1 }" size="small"
- type="textarea"></el-input>
+ <el-input v-model="scope.row.joinName" :autosize="{ minRows: 1, maxRows: 1}" size="small"
+ type="textarea"></el-input>
</template>
</el-table-column>
- <el-table-column v-if="addObj.mating == 1" align="center" label="閰嶅鏍峰搧鍨嬪彿" prop="joinModel" width="140">
+ <el-table-column v-if="addObj.mating==1" align="center" label="閰嶅鏍峰搧鍨嬪彿" prop="joinModel" width="140">
<template slot-scope="scope">
- <el-input v-model="scope.row.joinModel" :autosize="{ minRows: 1, maxRows: 1 }" size="small"
- type="textarea"></el-input>
+ <el-input v-model="scope.row.joinModel" :autosize="{ minRows: 1, maxRows: 1}" size="small"
+ type="textarea"></el-input>
</template>
</el-table-column>
- <el-table-column v-if="addObj.mating == 1" align="center" label="閰嶅鏍峰搧鏁伴噺" prop="joinNum" width="140">
+ <el-table-column v-if="addObj.mating==1" align="center" label="閰嶅鏍峰搧鏁伴噺" prop="joinNum" width="140">
<template slot-scope="scope">
<el-input-number v-model="scope.row.joinNum" :controls="false" :max="100" :min="1" :precision="0"
- size="small" style="width: 80%;"></el-input-number>
+ size="small" style="width: 80%;"></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="寰呮椤规暟閲�" prop="quantity" width="105">
<template slot-scope="scope">
- <el-select v-model="scope.row.quantity" disabled clearable size="small">
- <el-option v-for="item in quantityList" :key="item.value" :label="item.label"
- :value="item.value"></el-option>
+ <el-select v-model="scope.row.quantity" disabled clearable
+ size="small">
+ <el-option v-for="item in quantityList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
- <el-table ref="productTable" v-loading="getProductLoad" :data="productList" :row-class-name="tableRowClassName"
- class="el-table" max-height="400px" style="margin-bottom: 10px;"
- :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border tooltip-effect="dark"
- @select="selectOne" @selection-change="selectProduct" @select-all="handleAll">
- <el-table-column v-if="active == 1" :selectable="selectable" type="selection" width="65"></el-table-column>
+ <el-table ref="productTable" v-loading="getProductLoad" :data="productList"
+ :row-class-name="tableRowClassName"
+ class="el-table"
+ max-height="400px"
+ style="margin-bottom: 10px;"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ tooltip-effect="dark"
+ @select="selectOne"
+ @selection-change="selectProduct"
+ @select-all="handleAll">
+ <el-table-column v-if="active==1" :selectable="selectable" type="selection" width="65"></el-table-column>
<el-table-column label="妫�楠岄」" min-width="140" prop="inspectionItem" show-overflow-tooltip>
<template slot="header" slot-scope="scope">
<div style="display: flex;align-items: center;flex-direction: column;font-size: 14px">
<span>妫�楠岄」</span>
- <el-input v-if="active == 1" v-model="inspectionItem" placeholder="璇疯緭鍏�" size="mini"
- @input="searchFilterList" />
+ <el-input
+ v-if="active==1"
+ v-model="inspectionItem"
+ placeholder="璇疯緭鍏�"
+ size="mini"
+ @input="searchFilterList"/>
</div>
</template>
</el-table-column>
- <el-table-column label="妫�楠岄」瀛愰」" min-width="140" prop="inspectionItemSubclass" show-overflow-tooltip>
+ <el-table-column label="妫�楠岄」瀛愰」" min-width="140" prop="inspectionItemSubclass"
+ show-overflow-tooltip>
<template slot="header" slot-scope="scope">
<div style="display: flex;align-items: center;flex-direction: column;font-size: 14px">
<span>妫�楠岄」瀛愰」</span>
- <el-input v-if="active == 1" v-model="inspectionItemSubclass" placeholder="璇疯緭鍏�" size="mini"
- @input="searchFilterList" />
+ <el-input
+ v-if="active==1"
+ v-model="inspectionItemSubclass"
+ placeholder="璇疯緭鍏�"
+ size="mini"
+ @input="searchFilterList"/>
</div>
</template>
</el-table-column>
<el-table-column label="瑕佹眰鍊�" min-width="220px" prop="ask">
<template slot-scope="scope">
- <el-input v-if="active == 1 && isAskOnlyRead" v-model="scope.row.ask" :autosize="{ minRows: 1, maxRows: 3 }"
- clearable placeholder="瑕佹眰鍊�" size="small" type="textarea"
- @change="e => requestChange(e, scope.row)"></el-input>
+ <el-input v-if="active==1&&isAskOnlyRead" v-model="scope.row.ask" :autosize="{ minRows: 1, maxRows: 3}" clearable placeholder="瑕佹眰鍊�"
+ size="small" type="textarea"
+ @change="e=>requestChange(e,scope.row)"></el-input>
<span v-else>
- <template>{{ scope.row.ask }}</template>
+ <template >{{ scope.row.ask }}</template>
</span>
</template>
</el-table-column>
<el-table-column label="瑕佹眰鎻忚堪" min-width="220px" prop="tell">
<template slot-scope="scope">
- <el-input v-if="active == 1 && isAskOnlyRead" v-model="scope.row.tell"
- :autosize="{ minRows: 1, maxRows: 3 }" clearable placeholder="瑕佹眰鎻忚堪" size="small" type="textarea"
- @change="e => requestChange(e, scope.row, 'tell')"></el-input>
+ <el-input v-if="active==1&&isAskOnlyRead" v-model="scope.row.tell" :autosize="{ minRows: 1, maxRows: 3}" clearable placeholder="瑕佹眰鎻忚堪"
+ size="small" type="textarea"
+ @change="e=>requestChange(e,scope.row,'tell')"></el-input>
<span v-else>
- <template>{{ scope.row.tell }}</template>
- </span>
+ <template >{{ scope.row.tell }}</template>
+ </span>
</template>
</el-table-column>
<el-table-column label="鏉′欢" min-width="140" prop="radius" show-overflow-tooltip></el-table-column>
@@ -288,29 +306,35 @@
<template slot="header" slot-scope="scope">
<div style="display: flex;align-items: center;flex-direction: column;font-size: 14px">
<span>璇曢獙鏂规硶</span>
- <el-input v-if="active == 1" v-model="methodS" placeholder="璇疯緭鍏�" size="mini" @input="searchFilterList" />
+ <el-input
+ v-if="active==1"
+ v-model="methodS"
+ placeholder="璇疯緭鍏�"
+ size="mini"
+ @input="searchFilterList"/>
</div>
</template>
</el-table-column>
<el-table-column label="璁¢噺鍗曚綅" prop="unit" show-overflow-tooltip width="100"></el-table-column>
<el-table-column label="鍗曚环" prop="price" show-overflow-tooltip width="100"></el-table-column>
<el-table-column label="鍖洪棿" min-width="120" prop="section" show-overflow-tooltip></el-table-column>
- <el-table-column :filter-method="filterHandler" :filters="filters" label="瀛愬疄楠屽" min-width="130"
- prop="sonLaboratory" show-overflow-tooltip></el-table-column>
+ <el-table-column :filter-method="filterHandler" :filters="filters" label="瀛愬疄楠屽" min-width="130" prop="sonLaboratory"
+ show-overflow-tooltip></el-table-column>
</el-table>
</div>
<!--鐗规畩鍊煎鐞嗘-->
- <el-dialog :before-close="beforeClose" :close-on-click-modal="false" :close-on-press-escape="false"
- :show-close="false" :visible.sync="bsm1DiaAll" min-width="400px" title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨">
+ <el-dialog :before-close="beforeClose" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
+ :visible.sync="bsm1DiaAll"
+ min-width="400px"
+ title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨">
<div v-for="(item, index) in bsm1DiaList" :key="item.id" class="body" style="max-height: 60vh;">
- <span>{{ item.inspectionItem }}</span>
+ <span>{{item.inspectionItem}}</span>
<el-row v-if="item.bsm1">
<el-col :span="24" class="search_thing" style="height: initial;margin: 5px 0;">
<div class="search_label" style="width: 80px;"><span class="required-span">* </span>閫夐」锛�</div>
<div class="search_input">
<el-radio-group v-model="item.bsm1Val" v-removeAriaHidden @input="upBsmAll(item)">
- <el-radio v-for="(a, ai) in JSON.parse(item.bsmRow.sectionCopy)" :key="ai" :label="a"
- style="margin-bottom: 2px;margin-top: 2px;"></el-radio>
+ <el-radio v-for="(a, ai) in JSON.parse(item.bsmRow.sectionCopy)" :key="ai" :label="a" style="margin-bottom: 2px;margin-top: 2px;"></el-radio>
</el-radio-group>
</div>
</el-col>
@@ -318,8 +342,8 @@
<div class="search_label" style="width: 80px;">瑕佹眰鍊硷細</div>
<div class="search_input">
<el-radio-group v-model="item.bsm1Val" v-removeAriaHidden @input="upBsmAll(item)">
- <el-radio v-for="(a, ai) in JSON.parse(item.bsmRow.sectionCopy)" :key="ai" :label="a">{{
- JSON.parse(item.bsmRow.askCopy)[ai] }}</el-radio>
+ <el-radio v-for="(a, ai) in JSON.parse(item.bsmRow.sectionCopy)" :key="ai"
+ :label="a">{{JSON.parse(item.bsmRow.askCopy)[ai]}}</el-radio>
</el-radio-group>
</div>
</el-col>
@@ -332,8 +356,9 @@
</span>
</el-dialog>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
- :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border :show-close="false"
- :visible.sync="bsm3Dia" title="鍖洪棿鍊煎~鍐�" width="800px">
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ :show-close="false" :visible.sync="bsm3Dia"
+ title="鍖洪棿鍊煎~鍐�" width="800px">
<el-table :data="editTable" height="80vh" style="width: 100%">
<!-- inspectionItemList -->
<el-table-column label="妫�楠岄」" prop="inspectionItemList" width="180">
@@ -346,27 +371,36 @@
</el-table-column>
<el-table-column label="璇嗗埆绗﹀��" prop="value">
<template slot-scope="scope">
- <el-input v-model="scope.row.value" placeholder="璇疯緭鍏�" size="small"
- @input="inputValueHandler(scope.row, scope.$index)"></el-input>
+ <el-input v-model="scope.row.value" placeholder="璇疯緭鍏�" size="small" @input="inputValueHandler(scope.row,scope.$index)"></el-input>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-row>
- <el-button @click="bsm3Dia = false">鍙� 娑�</el-button>
+ <el-button @click="bsm3Dia=false">鍙� 娑�</el-button>
<el-button :loading="saveLoad" type="primary" @click="save0">纭� 瀹�</el-button>
</el-row>
</span>
</el-dialog>
- <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
- :visible.sync="dialogVisible" title="鎻愮ず" width="32%">
+ <el-dialog
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="false"
+ :visible.sync="dialogVisible"
+ title="鎻愮ず"
+ width="32%">
<span>{{ dialogMessage }}</span>
<span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="dialogVisible = false, closeOpenPage()">纭� 瀹�</el-button>
+ <el-button type="primary" @click="dialogVisible= false,closeOpenPage()">纭� 瀹�</el-button>
</span>
</el-dialog>
- <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
- :visible.sync="dialogVisible2" title="鎻愮ず" width="32%">
+ <el-dialog
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="false"
+ :visible.sync="dialogVisible2"
+ title="鎻愮ず"
+ width="32%">
<span>{{ dialogMessage2 }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible2 = false">纭� 瀹�</el-button>
@@ -384,8 +418,13 @@
<el-button :loading="templateLoading" type="primary" @click="addTemplateDia">纭� 瀹�</el-button>
</span>
</el-dialog>
- <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
- :visible.sync="noNeedCheckDia" title="鍏嶆鎻愮ず" width="32%">
+ <el-dialog
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="false"
+ :visible.sync="noNeedCheckDia"
+ title="鍏嶆鎻愮ず"
+ width="32%">
<span>纭鍏嶆褰撳墠妫�楠屽崟锛�</span>
<span slot="footer" class="dialog-footer">
<el-button :loading="noNeedCheckLoad" type="primary" @click="handleNoNeedCheck">纭� 瀹�</el-button>
@@ -423,7 +462,7 @@
active: 0,
currentId: 0,
isReport: '',
- editTable: [], // 鍖洪棿鐗规畩鍊煎~鍐�
+ editTable:[], // 鍖洪棿鐗规畩鍊煎~鍐�
template: null,
saveLoad: false, // 淇濆瓨鎸夐挳loading
noNeedCheckLoad: false, // 鍏嶆鎸夐挳loading
@@ -516,9 +555,9 @@
addObj1: {},
model: null,
standardMethodListId: null,
- inspectionItem: null,
- inspectionItemSubclass: null,
- methodS: null,
+ inspectionItem:null,
+ inspectionItemSubclass:null,
+ methodS:null,
codeLevel: '', // 鏍峰搧鎵�鍦ㄧ骇鍒�
selectTreeTem: '', // 鏍峰搧鐖剁骇
checkType: [], // 妫�楠岀被鍨嬮�夐」鏁版嵁
@@ -531,14 +570,14 @@
templateName: '', // 淇濆瓨妯$増鍚嶇О
templates: [], // 妯$増涓嬫媺妗嗘暟鎹�
quantityList: [
- { label: 1, value: 1 },
- { label: 2, value: 2 },
- { label: 3, value: 3 },
- { label: 4, value: 4 },
- { label: 5, value: 5 },
- { label: 6, value: 6 },
- { label: 7, value: 7 },
- { label: 8, value: 8 },
+ { label: 1, value: 1},
+ { label: 2, value: 2},
+ { label: 3, value: 3},
+ { label: 4, value: 4},
+ { label: 5, value: 5},
+ { label: 6, value: 6},
+ { label: 7, value: 7},
+ { label: 8, value: 8},
],
types: [], // 绱ф�ョ▼搴︿笅鎷夋
dataTitle: [
@@ -553,7 +592,7 @@
],
dataIndex: 0,
isShowTab: false,
- symbolList: ['RTS'],
+ symbolList:['RTS'],
bsm3Dia: false, // 鍖洪棿鍊煎~鍐欏脊妗�
bsmRow: {},
bsm1: false,
@@ -619,7 +658,7 @@
this.getInfo() // 鑾峰彇鏁版嵁
},
methods: {
- save1() {
+ save1 () {
if (this.bsm1DiaList.length > 0) {
this.bsm1DiaList.forEach(item => {
if (!item.bsm1Val) {
@@ -640,24 +679,24 @@
done()
},
//鐗规畩鍊煎~鍐欏鐞�
- inputValueHandler(row, index) {
- if (row) {
- const nextIndex = index + 1
+ inputValueHandler(row,index){
+ if(row){
+ const nextIndex = index+1
for (let i = nextIndex; i < this.editTable.length; i++) {
const element = this.editTable[i];
- if (element.model == row.model && row.symbolItem == element.symbolItem) {
+ if(element.model==row.model&&row.symbolItem==element.symbolItem){
this.editTable[i].value = row.value
}
}
}
},
// 鏌ョ湅鏃跺垏鎹ab鏍�
- handleDataTab(m, i) {
+ handleDataTab (m, i) {
this.dataIndex = i
this.getInfo()
},
// 鑾峰彇鏁版嵁
- getInfo() {
+ getInfo () {
if (this.active == 2) {
let orderId = ''
if (!this.customsInspection.enterOrderId && this.customsInspection.quarterOrderId) {
@@ -705,7 +744,7 @@
}
})
} else {
- notificationRawOrder({ ifsInventoryId: this.customsInspection.id }).then(res => {
+ notificationRawOrder({ifsInventoryId:this.customsInspection.id}).then(res => {
if (res.code === 200) {
if (res.data === 1) {
if (this.orderType != 1) {
@@ -719,7 +758,7 @@
}
})
// 鎶ユ娴佺▼
- selectStandardTreeListByPartNo({ partNo: this.customsInspection.partNo }).then(res => {
+ selectStandardTreeListByPartNo({partNo:this.customsInspection.partNo}).then(res => {
if (res.data !== null) {
this.addObj.sample = res.data.label
this.codeLevel = res.data.code
@@ -751,7 +790,7 @@
},
// 鏌ヨ妯℃澘-鍙嶆樉妯℃澘
selectInsOrderTemplateByIdList(e) {
- selectRawMaterOrderTemplateById({ id: e }).then(res => {
+ selectRawMaterOrderTemplateById({id: e}).then(res => {
let obj = JSON.parse(res.data)
this.sampleList = obj.sampleList;
this.productList = obj.sampleList[0].insProduct
@@ -773,7 +812,7 @@
thing: JSON.stringify({
// addObj: this.addObj,
sampleList: sampleList,
- selectTree: this.selectTree
+ selectTree:this.selectTree
})
}).then(res => {
this.templateLoading = false;
@@ -793,22 +832,22 @@
cancelButtonText: "鍙栨秷",
type: "warning"
}).then(() => {
- delRawMaterOrderTemplate({ id: row.id }).then(res => {
+ delRawMaterOrderTemplate({id: row.id}).then(res => {
this.$message.success('鍒犻櫎鎴愬姛')
this.selectInsOrderTemplate()
}).catch(e => {
this.$message.error('鍒犻櫎澶辫触')
})
- }).catch(() => { })
+ }).catch(() => {})
},
// 鏌ヨ妯℃澘鍒楄〃
selectInsOrderTemplate() {
- selectRawMaterOrderTemplate({ partNo: this.addObj.partNo }).then(res => {
+ selectRawMaterOrderTemplate({partNo:this.addObj.partNo}).then(res => {
this.templates = res.data
})
},
// 鎷嗗垎
- handleSplitCountNum() {
+ handleSplitCountNum () {
this.sample.joinName = null
this.sample.joinModel = null
this.sample.joinNum = 1
@@ -831,7 +870,7 @@
this.computationalPairing(this.sampleList.length)
},
// 妫�楠岄」鍒楄〃绛涢��
- searchFilterList() {
+ searchFilterList () {
const vtw = {
inspectionItem: this.inspectionItem, // 妫�楠岄」
inspectionItemSubclass: this.inspectionItemSubclass, // 妫�楠岄」瀛愰」
@@ -842,7 +881,7 @@
})
this.changeProductList0()
if (isHaveValue) {
- for (let i in vtw) {
+ for(let i in vtw) {
if (vtw[i]) {
this.productList = this.productList0.filter((item) => {
return item[i] && item[i].includes(vtw[i])
@@ -855,11 +894,11 @@
}
},
containsValue(str) {
- if (str) {
+ if(str){
let symbolItem = ''
- this.symbolList.some(value => {
- if (str.includes(value)) {
- symbolItem = value
+ this.symbolList.some(value =>{
+ if(str.includes(value)){
+ symbolItem = value
return true
}
})
@@ -880,18 +919,18 @@
})
this.getTotal(sampleList)
let projectNum = this.totalArr.filter(a => a.state == 1).length
- if (projectNum == 0) {
+ if(projectNum==0){
this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
}).then(() => {
this.saveMethod(sampleList)
- }).catch(() => { })
- } else {
- let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b => a.ask.includes(b)) && a.state == 1)
+ }).catch(() => {})
+ }else{
+ let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask.includes(b)) && a.state == 1)
if (isRTS) {
- this.editTable = this.handleData(sampleList, this.containsValue, 0)
+ this.editTable = this.handleData(sampleList,this.containsValue, 0)
this.editTable.forEach(item => {
item.value = item.modelNum
})
@@ -907,21 +946,21 @@
});
},
// 鎻愪氦鍖洪棿鍊�
- save0() {
- if (this.editTable.every(m => m.value)) {
+ save0(){
+ if(this.editTable.every(m=>m.value)){
this.sampleList.forEach(item => {
item.insProduct = this.productList
})
- let sampleList = this.handleData(this.HaveJson(this.sampleList), this.handleAsk, 1)
+ let sampleList = this.handleData(this.HaveJson(this.sampleList),this.handleAsk,1)
sampleList.forEach(a => {
- a.insProduct = a.insProduct.filter(b => b.state === 1)
+ a.insProduct = a.insProduct.filter(b=>b.state === 1)
})
this.saveMethod(sampleList)
- } else {
+ }else{
this.$message.error('璇峰~鍐欒瘑鍒鍊�')
}
},
- noNeedCheck() {
+ noNeedCheck () {
this.$refs['addObj'].validate((valid) => {
if (valid) {
if (!this.sampleList.every(m => m.standardMethodListId)) {
@@ -935,7 +974,7 @@
})
this.getTotal(sampleList)
let projectNum = this.totalArr.filter(a => a.state == 1).length
- if (projectNum != 0) {
+ if (projectNum!=0){
this.$message.error('鍏嶆涓嶅彲閫夋嫨妫�楠岄」')
return
}
@@ -946,7 +985,7 @@
}
});
},
- handleNoNeedCheck() {
+ handleNoNeedCheck () {
// 妫�楠岀被鍨嬩负杩涘巶妫�楠屾椂鍙�夋嫨鍏嶆锛屼絾涓嶈兘閫夋嫨妫�楠岄」
const sampleList = this.HaveJson(this.sampleList)
sampleList.forEach(item => {
@@ -986,7 +1025,7 @@
} else {
a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum))
}
- a.insProduct = a.insProduct.filter(b => b.state === 1)
+ a.insProduct = a.insProduct.filter(b=>b.state === 1)
return a
}),
}).then(res => {
@@ -994,11 +1033,11 @@
this.noNeedCheckDia = false
this.$message.success('宸叉彁浜�')
this.closeOpenPage()
- }).catch(e => {
+ }).catch(e=>{
this.noNeedCheckLoad = false
})
},
- saveMethod(sampleList) {
+ saveMethod(sampleList){
let trees = this.selectTree.split(" - ")
if (trees.length < 3) {
this.$message.error('鏈�夋嫨瀵硅薄')
@@ -1040,7 +1079,7 @@
} else {
a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum))
}
- a.insProduct = a.insProduct.filter(b => b.state === 1)
+ a.insProduct = a.insProduct.filter(b=>b.state === 1)
return a
}),
}).then(res => {
@@ -1048,12 +1087,12 @@
this.$message.success('宸叉彁浜�')
this.bsm3Dia = false;
this.closeOpenPage()
- }).catch(e => {
+ }).catch(e=>{
this.saveLoad = false
})
},
- handleAsk(ask, symbolItem, value) {
- try {
+ handleAsk(ask,symbolItem, value) {
+ try{
let code = [">", "<", "=", "锛�", "锛�", "鈮�", "鈮�", "卤", "*", "/"];
let code2 = ['+', '*', '/', '-']
if (ask.includes('&')) {
@@ -1097,42 +1136,42 @@
return code[index] + '' + num
}
}
- } catch (e) { }
+ }catch(e){}
},
- handleData(sampleList, calBack, type) {
+ handleData(sampleList,calBack,type){
let editTable = []
sampleList.forEach(item => {
let obj = {
- sampleCode: item.sampleCode,
- model: item.model,
- symbolList: [],
- sampleId: item.id,
- modelNum: item.modelNum,
+ sampleCode:item.sampleCode,
+ model:item.model,
+ symbolList:[],
+ sampleId:item.id,
+ modelNum:item.modelNum,
}
if (item.insProduct && item.insProduct.length > 0) {
item.insProduct.forEach(a => {
if (a.state == 1) {
- if (type == 0) {
+ if(type==0){
let str = calBack(a.ask)
- str && obj.symbolList.push({
- symbolItem: str,
- inspectionItem: a.inspectionItem,
+ str&&obj.symbolList.push({
+ symbolItem:str,
+ inspectionItem:a.inspectionItem,
})
- } else if (type == 1) {
+ }else if(type==1){
let arr = this.editTable.filter(b => b.sampleId == item.id)
- for (var i = 0; i < arr.length; i++) {
- if (a.ask) {
- if (a.ask.includes(arr[i].symbolItem)) {
- let ask = calBack(a.ask, arr[i].symbolItem, arr[i].value)
+ for (var i=0;i<arr.length;i++){
+ if(a.ask){
+ if(a.ask.includes(arr[i].symbolItem)){
+ let ask = calBack(a.ask, arr[i].symbolItem,arr[i].value)
if (ask) {
a.ask = ask
}
- let tell = this.handleAsk(a.tell, arr[i].symbolItem, arr[i].value)
+ let tell = this.handleAsk(a.tell, arr[i].symbolItem,arr[i].value)
if (tell) {
a.tell = tell
}
}
- } else {
+ }else{
this.$message.error('瑕佹眰鍊间负绌猴紝闇�瑕佸幓鏍囧噯搴撶淮鎶わ紒')
}
}
@@ -1148,21 +1187,21 @@
if (b.productList && b.productList.length > 0) {
b.productList.forEach(c => {
if (c.state == 1) {
- if (type == 0) {
+ if(type==0){
let str = calBack(c.ask)
- str && obj.symbolList.push({
- symbolItem: str,
- inspectionItem: c.inspectionItem,
+ str&&obj.symbolList.push({
+ symbolItem:str,
+ inspectionItem:c.inspectionItem,
})
- } else if (type == 1) {
+ }else if(type==1){
let arr = this.editTable.filter(b => b.sampleId == item.id)
arr.forEach(f => {
- if (c.ask.includes(f.symbolItem)) {
- let ask = calBack(c.ask, f.symbolItem, f.value)
+ if(c.ask.includes(f.symbolItem)){
+ let ask = calBack(c.ask, f.symbolItem,f.value)
if (ask) {
c.ask = ask
}
- let tell = this.handleTell(c.tell, f.symbolItem, f.value)
+ let tell = this.handleTell(c.tell, f.symbolItem,f.value)
if (tell) {
c.tell = tell
}
@@ -1179,25 +1218,25 @@
if (b.productList && b.productList.length > 0) {
b.productList.forEach(c => {
if (c.state == 1) {
- if (type == 0) {
+ if(type==0){
let str = calBack(c.ask)
- str && obj.symbolList.push({
- symbolItem: str,
- inspectionItem: c.inspectionItem,
+ str&&obj.symbolList.push({
+ symbolItem:str,
+ inspectionItem:c.inspectionItem,
})
- } else if (type == 1) {
+ }else if(type==1){
// let ask = calBack(c.ask, c.rts)
// if (ask && c.state == 1) {
// c.ask = csk
// }
let arr = this.editTable.filter(b => b.sampleId == item.id)
arr.forEach(f => {
- if (c.ask.includes(f.symbolItem)) {
- let ask = calBack(c.ask, f.symbolItem, f.value)
+ if(c.ask.includes(f.symbolItem)){
+ let ask = calBack(c.ask, f.symbolItem,f.value)
if (ask) {
c.ask = ask
}
- let tell = this.handleTell(c.tell, f.symbolItem, f.value)
+ let tell = this.handleTell(c.tell, f.symbolItem,f.value)
if (tell) {
c.tell = tell
}
@@ -1212,25 +1251,25 @@
if (c.productList && c.productList.length > 0) {
c.productList.forEach(d => {
if (d.state == 1) {
- if (type == 0) {
+ if(type==0){
let str = calBack(d.ask)
- str && obj.symbolList.push({
- symbolItem: str,
- inspectionItem: d.inspectionItem,
+ str&&obj.symbolList.push({
+ symbolItem:str,
+ inspectionItem:d.inspectionItem,
})
- } else if (type == 1) {
+ }else if(type==1){
// let ask = calBack(d.ask, d.rts)
// if (ask && d.state == 1) {
// d.ask = ask
// }
let arr = this.editTable.filter(b => b.sampleId == item.id)
arr.forEach(f => {
- if (d.ask.includes(f.symbolItem)) {
- let ask = calBack(d.ask, f.symbolItem, f.value)
+ if(d.ask.includes(f.symbolItem)){
+ let ask = calBack(d.ask, f.symbolItem,f.value)
if (ask) {
d.ask = ask
}
- let tell = this.handleTell(d.tell, f.symbolItem, f.value)
+ let tell = this.handleTell(d.tell, f.symbolItem,f.value)
if (tell) {
d.tell = tell
}
@@ -1246,11 +1285,11 @@
}
})
}
- if (type == 0) {
+ if(type==0){
editTable.push(obj)
}
})
- if (type == 0) {
+ if(type==0){
editTable.forEach(a => {
a.symbolList.forEach(b => {
let arr = a.symbolList.filter(c => c.symbolItem == b.symbolItem);
@@ -1259,13 +1298,13 @@
})
editTable.forEach(a => {
let mySet = new Set();
- a.symbolList = a.symbolList.filter(b => {
+ a.symbolList = a.symbolList.filter(b =>{
let num0 = mySet.size;
mySet.add(b.symbolItem);
let num1 = mySet.size;
- if (num0 != num1) {
+ if(num0!=num1){
return true;
- } else {
+ }else{
return false
}
})
@@ -1274,19 +1313,19 @@
editTable.forEach(a => {
a.symbolList.forEach(b => {
let obj = {
- sampleCode: a.sampleCode,
- model: a.model,
- symbolItem: b.symbolItem,
- sampleId: a.sampleId,
- value: null,
- inspectionItemList: b.inspectionItemList,
- modelNum: a.modelNum,
+ sampleCode:a.sampleCode,
+ model:a.model,
+ symbolItem:b.symbolItem,
+ sampleId:a.sampleId,
+ value:null,
+ inspectionItemList:b.inspectionItemList,
+ modelNum:a.modelNum,
}
editTableNew.push(obj)
})
})
return editTableNew
- } else {
+ }else{
return sampleList
}
},
@@ -1296,7 +1335,7 @@
} catch (e) {
}
},
- replaceAll(str, find, value) {
+ replaceAll(str,find,value) {
if (str === undefined) {
return str
}
@@ -1374,10 +1413,10 @@
let num1 = mySet0.size
mySet0.add(item.sonLaboratory)
let num2 = mySet0.size
- if (num2 > num1) {
+ if(num2>num1){
this.sonLaboratoryList.push({
- label: item.sonLaboratory,
- value: item.sonLaboratory,
+ label:item.sonLaboratory,
+ value:item.sonLaboratory,
})
}
})
@@ -1425,11 +1464,11 @@
} else {
this.methods = res.data.standardMethodList
}
- } catch (e) { }
+ } catch (e) {}
})
},
// 璧嬪�肩涓�鏉¢粯璁ゆ暟鎹�
- addListInfo(codeLevel, data) {
+ addListInfo (codeLevel, data) {
this.sampleList = []
this.productList = []
this.sample.model = this.addObj.model
@@ -1522,14 +1561,14 @@
}
this.bsm2Val3 = this.HaveJson(this.permute(nums))
},
- tableRowClassName({ row, rowIndex }) {
+ tableRowClassName({row, rowIndex}) {
if (row.state === 0) {
return '';
}
return 'warning-row';
},
// 淇敼鏍峰搧鍚嶇О
- changeValue(val, string) {
+ changeValue (val, string) {
if (this.sampleList.length > 1) {
// 鏈変袱鏉℃牱鍝佹椂锛岀浜屾潯鏍峰搧淇℃伅鍜岀涓�鏉′繚鎸佷竴鑷�
this.sampleList.forEach(item => {
@@ -1556,9 +1595,9 @@
}
this.getProductLoad = true
let selectTreeList = this.selectTree.split(" - ")
- this.addObj.model && (selectTreeList[selectTreeList.length - 1] = this.addObj.model)
+ this.addObj.model&&(selectTreeList[selectTreeList.length - 1] = this.addObj.model)
selectStandardProductList({
- model: this.addObj.model ? this.addObj.model : row.model,
+ model: this.addObj.model?this.addObj.model:row.model,
modelNum: row.modelNum,
standardMethodListId: val,
factory: selectTreeList.join(" - "),
@@ -1578,7 +1617,7 @@
})
}, 200)
}).catch(err => {
- console.log('err-', err)
+ console.log('err-',err)
})
},
// 閫夋嫨鏍峰搧鍨嬪彿鐨勫洖璋�
@@ -1639,7 +1678,7 @@
}
},
// 鍏ㄩ�夌壒娈婂�煎鐞嗘閫夋嫨瑕佹眰鍊肩殑鍥炶皟
- upBsmAll(item) {
+ upBsmAll (item) {
const i = this.bsm1DiaList.findIndex(obj => obj.id === item.id)
if (i > -1) {
// 鎵惧埌鐩稿簲鐨勬楠岄」璧嬪��
@@ -1670,7 +1709,7 @@
selectOne(selection, row) {
this.bsm1DiaList = []
row.state = row.state == 1 ? 0 : 1
- if (row.section === null) {
+ if(row.section === null) {
row.section = ""
}
if (row.sectionCopy === undefined && row.section) {
@@ -1684,18 +1723,18 @@
if (row.tell.includes('[')) {
this.$set(row, 'tellCopy', row.tell)
}
- let arr = this.productList.filter(m => m.state == 1 && row.sectionCopy && row.sectionCopy.includes(m.sectionCopy) && m.ask && m.sectionCopy.indexOf('[') == -1)
- if (row.bsm === '1' && row.sectionCopy !== '' && row.sectionCopy !== null && row.sectionCopy !== undefined && row.state === 1 && arr.length == 0) {
+ let arr = this.productList.filter(m=>m.state==1&&row.sectionCopy&&row.sectionCopy.includes(m.sectionCopy)&&m.ask&&m.sectionCopy.indexOf('[')==-1)
+ if (row.bsm === '1' && row.sectionCopy !== '' && row.sectionCopy !== null && row.sectionCopy !== undefined && row.state === 1&&arr.length==0) {
if (row.sectionCopy.indexOf('[') > -1) {
row.bsmRow = this.HaveJson(row)
}
row.bsm1 = true
this.bsm1DiaList.push(row)
this.bsm1DiaAll = true
- } else if (row.bsm === '1' && row.sectionCopy !== '' && row.sectionCopy !== null && row.state === 0 && arr.length == 0) {
+ } else if (row.bsm === '1' && row.sectionCopy !== '' && row.sectionCopy !== null && row.state === 0&&arr.length==0) {
row.bsm1 = false
- } else if (arr.length > 0) {
- try {
+ }else if(arr.length>0){
+ try{
row.bsmRow = this.HaveJson(row)
let section = arr[0].section
let arr0 = JSON.parse(row.section)
@@ -1705,7 +1744,7 @@
row.section = section
row.ask = arr1[index]
row.tell = arr4[index]
- } catch (e) { }
+ } catch(e) {}
}
this.sampleList.map(item => {
if (this.sampleIds.indexOf(item.id) > -1) {
@@ -1725,7 +1764,7 @@
handleAll(e) {
if (e.length > 0) {
this.productList.map(m => {
- if (e.find(a => a.id == m.id)) {
+ if(e.find(a=>a.id == m.id)){
m.state = 1
}
return m
@@ -1789,10 +1828,10 @@
this.$refs.productTable.doLayout()
})
},
- changeProductList0() {
- this.productList0.forEach(a => {
+ changeProductList0(){
+ this.productList0.forEach(a=>{
let obj = this.productList.find(m => m.id == a.id)
- if (obj) {
+ if(obj){
a.state = obj.state
a.section = obj.section
a.ask = obj.ask
@@ -1800,7 +1839,7 @@
// a.price = obj.price
a.tell = obj.tell
}
- if (a.state == 0 && a.bsmRow) {
+ if(a.state == 0&&a.bsmRow){
a = this.HaveJson(a.bsmRow)
}
})
@@ -1809,7 +1848,7 @@
const property = column['property'];
return row[property] === value;
},
- goBack() {
+ goBack () {
if (this.active == 1) {
this.$router.go(-1)
} else {
@@ -1830,7 +1869,6 @@
justify-content: space-between;
margin-bottom: 10px;
}
-
.tab {
list-style-type: none;
display: flex;
@@ -1859,4 +1897,7 @@
background-color: #ffffff;
}
+>>>.warning-row {
+ color: #1890FF;
+}
</style>
diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue
index b7c2f45..a263e75 100644
--- a/src/views/business/materialOrder/index.vue
+++ b/src/views/business/materialOrder/index.vue
@@ -275,7 +275,7 @@
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableData1: [],
@@ -356,7 +356,7 @@
],
page1: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableData2: [],
@@ -412,7 +412,25 @@
{ 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: 'sampleName',
@@ -515,7 +533,7 @@
],
page2: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableData3: [],
@@ -565,7 +583,25 @@
{ 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: 'sampleName',
@@ -621,7 +657,7 @@
],
page3: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableData4: [],
@@ -671,7 +707,25 @@
{ 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: 'sampleName',
@@ -744,7 +798,7 @@
],
page4: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
entity: {
diff --git a/src/views/business/productOrder/components/add.vue b/src/views/business/productOrder/components/add.vue
index 350dce2..b41c345 100644
--- a/src/views/business/productOrder/components/add.vue
+++ b/src/views/business/productOrder/components/add.vue
@@ -598,7 +598,7 @@
} from "@/api/business/rawMaterialOrder";
import {
addInsOrder, addInsOrderTemplate, delInsOrderTemplate,
- getQuarterOnOrder,
+ getQuarterOnOrder, selectInsOrderTemplateById,
selectOrderManDay,
updateInsOrder,
upInsOrder,
@@ -608,6 +608,7 @@
import {selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary";
import limsTable from "@/components/Table/lims-table.vue";
import {selectCustomPageList} from "@/api/system/customer";
+import {mapGetters} from "vuex";
export default {
name: 'Add',
@@ -615,6 +616,9 @@
limsTable,
cableConfig,
AuxiliaryWireCore
+ },
+ computed:{
+ ...mapGetters(["nickName"]),
},
dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list'],
data() {
@@ -981,7 +985,7 @@
},
// 鑾峰彇鐢ㄦ埛鍒楄〃
getAuthorizedPerson() {
- selectUserCondition().then(res => {
+ selectUserCondition({ type: 1 }).then(res => {
let data = []
res.data.forEach(a => {
data.push({
@@ -1126,7 +1130,9 @@
sampleList.forEach(a => {
if (a.insProduct.length > 0) {
a.insProduct.forEach(c => {
- delete c.id
+ if (this.tabIndex != 4) {
+ delete c.id
+ }
})
}
if (a.endModels) {
@@ -1164,7 +1170,9 @@
sampleList.forEach(a => {
if (a.insProduct.length > 0) {
a.insProduct.forEach(c => {
- delete c.id
+ if (this.tabIndex != 4) {
+ delete c.id
+ }
})
}
if (a.endModels) {
@@ -1263,14 +1271,16 @@
}
},
saveMethod(sampleList){
- console.log('sampleList----', sampleList)
this.saveLoad = true
if (this.addObj.quarterItemId) {
this.addObj.quarterItemId = this.addObj.quarterItemId[1]
}
if(this.tabIndex==4&&this.active==2){
+ if (this.addObj.createTime) {
+ delete this.addObj.createTime
+ }
// 閫�鍥炲悗鎻愪氦
- updateInsOrder({insOrder: this.addObj, sampleList: sampleList}).then(res => {
+ updateInsOrder({insOrder: this.addObj, sampleProduct: sampleList}).then(res => {
this.saveLoad = false
this.$message.success('宸叉彁浜�')
this.bsm3Dia = false;
@@ -1404,7 +1414,6 @@
if (node.data.code === '[3]') {
this.sampleViewEn = val.sampleTypeEn
} else if (node.data.code === '[4]') {
- console.log('node.data---', node.data)
if (node.data.children!==null && node.data.children.length>0) {
this.sampleViewEn = val.sampleEn
}
@@ -1648,14 +1657,12 @@
backtrack([], nums);
return result;
},
- tableRowClassName({
- row,
- rowIndex
- }) {
- if (row.state === 0) {
+ tableRowClassName({row, rowIndex}) {
+ if (row.state == 1) {
+ return 'warning-row';
+ } else {
return '';
}
- return 'warning-row';
},
selectInsOrderTemplate() {
selectInsOrderTemplate({company: this.addObj.company}).then(res => {
@@ -1708,12 +1715,13 @@
selectInsOrderTemplateById({id: e}).then(res => {
let obj = JSON.parse(res.data)
//鍒跺崟浜鸿缃负褰撳墠鐧诲綍鐢ㄦ埛
- let user = JSON.parse(localStorage.getItem('user'))
+ let user = this.nickName
obj.addObj.custom = user.name
obj.addObj.userId = user.userId
this.addObj = obj.addObj;
this.sampleList = obj.sampleList;
this.selectTree = obj.selectTree
+ this.rowClick(this.sampleList[0])
})
},
delSampleAndProduct() {
@@ -2214,7 +2222,11 @@
</script>
<style scoped>
-.el-table .warning-row .cell {
- color: #3A7BFA;
+>>>.warning-row {
+ color: #1890FF;
+}
+.node_i {
+ color: orange;
+ font-size: 18px;
}
</style>
diff --git a/src/views/business/productOrder/components/auxiliaryWireCore.vue b/src/views/business/productOrder/components/auxiliaryWireCore.vue
index 7545392..5e7898e 100644
--- a/src/views/business/productOrder/components/auxiliaryWireCore.vue
+++ b/src/views/business/productOrder/components/auxiliaryWireCore.vue
@@ -250,10 +250,7 @@
this.$refs.productTable.doLayout()
})
},
- tableRowClassName({
- row,
- rowIndex
- }) {
+ tableRowClassName({row, rowIndex}) {
if (row.state === 0) {
return '';
}
@@ -397,7 +394,7 @@
font-size: 12px;
}
-.ins_order_config .el-table .warning-row .cell {
- color: #3A7BFA;
+>>>.warning-row {
+ color: #1890FF;
}
</style>
diff --git a/src/views/business/productOrder/components/cable-config.vue b/src/views/business/productOrder/components/cable-config.vue
index e0f5de1..46c3e9e 100644
--- a/src/views/business/productOrder/components/cable-config.vue
+++ b/src/views/business/productOrder/components/cable-config.vue
@@ -384,7 +384,7 @@
display: flex;
justify-content: space-between;
}
-.el-table .warning-row .cell {
- color: #3A7BFA;
+>>>.warning-row {
+ color: #1890FF;
}
</style>
diff --git a/src/views/business/productOrder/components/printDialog.vue b/src/views/business/productOrder/components/printDialog.vue
index 589d674..77a921f 100644
--- a/src/views/business/productOrder/components/printDialog.vue
+++ b/src/views/business/productOrder/components/printDialog.vue
@@ -163,7 +163,6 @@
}).then(res => {
if (res.code === 200 && res.data.length > 0) {
res.data.forEach(item => {
- console.log('item---', item)
item.sendTime = item.sendTime && item.sendTime.substring(0, 10)
item.sampleNumber = item.qtyArrived + item.buyUnitMeas
this.$set(item, 'barcode', item.entrustCode)
diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue
index 18745a7..8b8acdd 100644
--- a/src/views/business/productOrder/index.vue
+++ b/src/views/business/productOrder/index.vue
@@ -529,7 +529,7 @@
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
state: 0,// 0:鍙拌处椤碉紝1锛氭楠岄〉闈�,2妫�楠岄〉闈�(澶嶆牳)锛岄粯璁や负0,3鏁版嵁鏌ョ湅
@@ -558,7 +558,7 @@
tableDataLook: [],
tableDataLookPage: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableDataLookColumn: [
@@ -649,7 +649,7 @@
],
pageFile: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
formData: {},
@@ -686,7 +686,7 @@
],
pageDelete: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
deleteDialogVisible: false,
@@ -946,7 +946,8 @@
path: "/productOrder/add", query: {
examine: 1,
active: 2,
- currentId: row.id
+ currentId: row.id,
+ tabIndex: this.tabIndex,
}
});
},
@@ -976,7 +977,7 @@
closeDia () {
this.tableDataLookPage = {
total: 0,
- size: 10,
+ size: 20,
current: 1
}
this.dataDialogVisible = false
@@ -1039,7 +1040,7 @@
},
getDeleteList() {
this.tableLoadingDelete = true
- selectNoProducts({ orderId: this.orderId, revocationInsProductIds: this.revocationInsProductIds }).then(res => {
+ selectNoProducts({ orderId: this.orderId, revocationInsProductIds: this.revocationInsProductIds, ...this.pageDelete }).then(res => {
this.tableLoadingDelete = false
this.componentDataDelete = res.data.records
this.pageDelete.total = res.data.total
diff --git a/src/views/business/productSamplingInfo/components/addQuarterItem.vue b/src/views/business/productSamplingInfo/components/addQuarterItem.vue
index dbfbce5..57e3908 100644
--- a/src/views/business/productSamplingInfo/components/addQuarterItem.vue
+++ b/src/views/business/productSamplingInfo/components/addQuarterItem.vue
@@ -273,7 +273,7 @@
}
},
getUserList(){
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition().then((res) => {
this.userList = res.data;
})
},
diff --git a/src/views/business/productSamplingInfo/index.vue b/src/views/business/productSamplingInfo/index.vue
index 3b9720b..82c9d40 100644
--- a/src/views/business/productSamplingInfo/index.vue
+++ b/src/views/business/productSamplingInfo/index.vue
@@ -316,7 +316,7 @@
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableData1: [],
@@ -362,7 +362,7 @@
],
page1: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
yearSampleDia: false, // 骞村害鎶芥牱
@@ -610,7 +610,7 @@
return 'height: calc(100% - ' + '44' + 'px)'
},
getUserList() {
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition().then((res) => {
this.userList = res.data;
})
},
diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index 7e161aa..61584a6 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -184,8 +184,8 @@
<el-button size="small" style="height: 38px" type="primary">闄勪欢涓婁紶</el-button>
</el-upload>
</div>
- <lims-table :tableData="tableDataFile" :column="columnFile" height="500px" key="tableDataFile"
- :tableLoading="tableLoadingFile"></lims-table>
+ <lims-table :tableData="tableDataFile" :column="columnFile" height="500px"
+ key="tableDataFile" :tableLoading="tableLoadingFile"></lims-table>
</el-dialog>
</div>
</template>
@@ -205,7 +205,7 @@
import { mapGetters } from "vuex";
import { selectUserCondition } from "@/api/business/inspectionTask";
import limsTable from "@/components/Table/lims-table.vue";
-import { delFile, downFile, getFileList } from "@/api/business/rawMaterialOrder";
+import {delFile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
export default {
name: 'ReportPreparation',
components: { limsTable, onlyoffice },
@@ -815,7 +815,7 @@
},
// 鑾峰彇浜哄憳鍒楄〃
getAuthorizedPerson() {
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 1 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
diff --git a/src/views/business/unpass/components/PurchaseVerification.vue b/src/views/business/unpass/components/PurchaseVerification.vue
index 6594480..ae4619d 100644
--- a/src/views/business/unpass/components/PurchaseVerification.vue
+++ b/src/views/business/unpass/components/PurchaseVerification.vue
@@ -246,7 +246,6 @@
// 鏂规硶闆嗗悎
methods: {
async getInsOrder(operationType, item) {
- console.log('operationType----', operationType)
this.operationType = operationType
this.info = item
// 鏌ヨ宸叉彁浜ょ殑鏁版嵁
diff --git a/src/views/business/unpass/index.vue b/src/views/business/unpass/index.vue
index b3a7250..e52f63b 100644
--- a/src/views/business/unpass/index.vue
+++ b/src/views/business/unpass/index.vue
@@ -95,7 +95,7 @@
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
}
diff --git a/src/views/performance/manHour/workTimeConfig.vue b/src/views/performance/manHour/workTimeConfig.vue
index 0ec72f6..87be98a 100644
--- a/src/views/performance/manHour/workTimeConfig.vue
+++ b/src/views/performance/manHour/workTimeConfig.vue
@@ -277,8 +277,7 @@
})
.then(() => {
deleteAuxiliaryWorkingHours({ id: row.id }).then((res) => {
- console.log('res', res)
- if (res.code == 200) {
+ if (res.code == 200){
this.$message.success("鍒犻櫎鎴愬姛");
this.refresh();
}
diff --git a/src/views/thirdpartylogin.vue b/src/views/thirdpartylogin.vue
index 692ce99..1fe70ea 100644
--- a/src/views/thirdpartylogin.vue
+++ b/src/views/thirdpartylogin.vue
@@ -5,25 +5,18 @@
export default {
data() {
return {
- SSO: window.location.hash
- }
+ };
},
created() {
- this.initLogin()
- console.log(this.SSO)
+ this.initLogin();
},
methods: {
initLogin() {
- const code = this.SSO.split('&')[0].split('=')[1]
- console.log(code)
-
- if (code) {
- this.$store.dispatch('LoginBySSO', code).then(() => {
- this.$router.push({ path: '/' })
- })
- }
+ this.$store.dispatch('LoginBySSO', {code: this.$route.query.code}).then(() => {
+ this.$router.push({path: '/'});
+ });
}
}
-}
+};
</script>
-<style scoped></style>
+<style scoped></style>
\ No newline at end of file
diff --git a/src/DataWorker.worker.js b/src/workers/DataWorker.worker.js
similarity index 100%
rename from src/DataWorker.worker.js
rename to src/workers/DataWorker.worker.js
diff --git a/src/InspectionWorker.worker.js b/src/workers/InspectionWorker.worker.js
similarity index 68%
rename from src/InspectionWorker.worker.js
rename to src/workers/InspectionWorker.worker.js
index 59ac692..5736162 100644
--- a/src/InspectionWorker.worker.js
+++ b/src/workers/InspectionWorker.worker.js
@@ -1,4 +1,6 @@
// 澶氱嚎绋嬮噷闈㈤渶瑕佷繚瀛樼殑鏁版嵁
+import Big from "big.js";
+
let code = "";
// 琛ㄦ牸鏁版嵁锛堟覆鏌擄級
let tableList = null;
@@ -1439,913 +1441,3 @@
console.log("error", error);
}
}
-
-/*
- * big.js v5.2.2
- * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
- * Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com>
- * https://github.com/MikeMcl/big.js/LICENCE
- */
-(function (GLOBAL) {
- "use strict";
- var Big,
- /************************************** EDITABLE DEFAULTS *****************************************/
-
- // The default values below must be integers within the stated ranges.
-
- /*
- * The maximum number of decimal places (DP) of the results of operations involving division:
- * div and sqrt, and pow with negative exponents.
- */
- DP = 20, // 0 to MAX_DP
- /*
- * The rounding mode (RM) used when rounding to the above decimal places.
- *
- * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)
- * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)
- * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)
- * 3 Away from zero. (ROUND_UP)
- */
- RM = 1, // 0, 1, 2 or 3
- // The maximum value of DP and Big.DP.
- MAX_DP = 1e6, // 0 to 1000000
- // The maximum magnitude of the exponent argument to the pow method.
- MAX_POWER = 1e6, // 1 to 1000000
- /*
- * The negative exponent (NE) at and beneath which toString returns exponential notation.
- * (JavaScript numbers: -7)
- * -1000000 is the minimum recommended exponent value of a Big.
- */
- NE = -7, // 0 to -1000000
- /*
- * The positive exponent (PE) at and above which toString returns exponential notation.
- * (JavaScript numbers: 21)
- * 1000000 is the maximum recommended exponent value of a Big.
- * (This limit is not enforced or checked.)
- */
- PE = 21, // 0 to 1000000
- /**************************************************************************************************/
-
- // Error messages.
- NAME = "[big.js] ",
- INVALID = NAME + "Invalid ",
- INVALID_DP = INVALID + "decimal places",
- INVALID_RM = INVALID + "rounding mode",
- DIV_BY_ZERO = NAME + "Division by zero",
- // The shared prototype object.
- P = {},
- UNDEFINED = void 0,
- NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
-
- /*
- * Create and return a Big constructor.
- *
- */
- function _Big_() {
- /*
- * The Big constructor and exported function.
- * Create and return a new instance of a Big number object.
- *
- * n {number|string|Big} A numeric value.
- */
- function Big(n) {
- var x = this;
-
- // Enable constructor usage without new.
- if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);
-
- // Duplicate.
- if (n instanceof Big) {
- x.s = n.s;
- x.e = n.e;
- x.c = n.c.slice();
- } else {
- parse(x, n);
- }
-
- /*
- * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which
- * points to Object.
- */
- x.constructor = Big;
- }
-
- Big.prototype = P;
- Big.DP = DP;
- Big.RM = RM;
- Big.NE = NE;
- Big.PE = PE;
- Big.version = "5.2.2";
-
- return Big;
- }
-
- /*
- * Parse the number or string value passed to a Big constructor.
- *
- * x {Big} A Big number instance.
- * n {number|string} A numeric value.
- */
- function parse(x, n) {
- var e, i, nl;
-
- // Minus zero?
- if (n === 0 && 1 / n < 0) n = "-0";
- else if (!NUMERIC.test((n += ""))) throw Error(INVALID + "number");
-
- // Determine sign.
- x.s = n.charAt(0) == "-" ? ((n = n.slice(1)), -1) : 1;
-
- // Decimal point?
- if ((e = n.indexOf(".")) > -1) n = n.replace(".", "");
-
- // Exponential form?
- if ((i = n.search(/e/i)) > 0) {
- // Determine exponent.
- if (e < 0) e = i;
- e += +n.slice(i + 1);
- n = n.substring(0, i);
- } else if (e < 0) {
- // Integer.
- e = n.length;
- }
-
- nl = n.length;
-
- // Determine leading zeros.
- for (i = 0; i < nl && n.charAt(i) == "0"; ) ++i;
-
- if (i == nl) {
- // Zero.
- x.c = [(x.e = 0)];
- } else {
- // Determine trailing zeros.
- for (; nl > 0 && n.charAt(--nl) == "0"; );
- x.e = e - i - 1;
- x.c = [];
-
- // Convert string to array of digits without leading/trailing zeros.
- for (e = 0; i <= nl; ) x.c[e++] = +n.charAt(i++);
- }
-
- return x;
- }
-
- /*
- * Round Big x to a maximum of dp decimal places using rounding mode rm.
- * Called by stringify, P.div, P.round and P.sqrt.
- *
- * x {Big} The Big to round.
- * dp {number} Integer, 0 to MAX_DP inclusive.
- * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP)
- * [more] {boolean} Whether the result of division was truncated.
- */
- function round(x, dp, rm, more) {
- var xc = x.c,
- i = x.e + dp + 1;
-
- if (i < xc.length) {
- if (rm === 1) {
- // xc[i] is the digit after the digit that may be rounded up.
- more = xc[i] >= 5;
- } else if (rm === 2) {
- more =
- xc[i] > 5 ||
- (xc[i] == 5 &&
- (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1));
- } else if (rm === 3) {
- more = more || !!xc[0];
- } else {
- more = false;
- if (rm !== 0) throw Error(INVALID_RM);
- }
-
- if (i < 1) {
- xc.length = 1;
-
- if (more) {
- // 1, 0.1, 0.01, 0.001, 0.0001 etc.
- x.e = -dp;
- xc[0] = 1;
- } else {
- // Zero.
- xc[0] = x.e = 0;
- }
- } else {
- // Remove any digits after the required decimal places.
- xc.length = i--;
-
- // Round up?
- if (more) {
- // Rounding up may mean the previous digit has to be rounded up.
- for (; ++xc[i] > 9; ) {
- xc[i] = 0;
- if (!i--) {
- ++x.e;
- xc.unshift(1);
- }
- }
- }
-
- // Remove trailing zeros.
- for (i = xc.length; !xc[--i]; ) xc.pop();
- }
- } else if (rm < 0 || rm > 3 || rm !== ~~rm) {
- throw Error(INVALID_RM);
- }
-
- return x;
- }
-
- /*
- * Return a string representing the value of Big x in normal or exponential notation.
- * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
- *
- * x {Big}
- * id? {number} Caller id.
- * 1 toExponential
- * 2 toFixed
- * 3 toPrecision
- * 4 valueOf
- * n? {number|undefined} Caller's argument.
- * k? {number|undefined}
- */
- function stringify(x, id, n, k) {
- var e,
- s,
- Big = x.constructor,
- z = !x.c[0];
-
- if (n !== UNDEFINED) {
- if (n !== ~~n || n < (id == 3) || n > MAX_DP) {
- throw Error(id == 3 ? INVALID + "precision" : INVALID_DP);
- }
-
- x = new Big(x);
-
- // The index of the digit that may be rounded up.
- n = k - x.e;
-
- // Round?
- if (x.c.length > ++k) round(x, n, Big.RM);
-
- // toFixed: recalculate k as x.e may have changed if value rounded up.
- if (id == 2) k = x.e + n + 1;
-
- // Append zeros?
- for (; x.c.length < k; ) x.c.push(0);
- }
-
- e = x.e;
- s = x.c.join("");
- n = s.length;
-
- // Exponential notation?
- if (
- id != 2 &&
- (id == 1 || (id == 3 && k <= e) || e <= Big.NE || e >= Big.PE)
- ) {
- s =
- s.charAt(0) +
- (n > 1 ? "." + s.slice(1) : "") +
- (e < 0 ? "e" : "e+") +
- e;
-
- // Normal notation.
- } else if (e < 0) {
- for (; ++e; ) s = "0" + s;
- s = "0." + s;
- } else if (e > 0) {
- if (++e > n) for (e -= n; e--; ) s += "0";
- else if (e < n) s = s.slice(0, e) + "." + s.slice(e);
- } else if (n > 1) {
- s = s.charAt(0) + "." + s.slice(1);
- }
-
- return x.s < 0 && (!z || id == 4) ? "-" + s : s;
- }
-
- // Prototype/instance methods
-
- /*
- * Return a new Big whose value is the absolute value of this Big.
- */
- P.abs = function () {
- var x = new this.constructor(this);
- x.s = 1;
- return x;
- };
-
- /*
- * Return 1 if the value of this Big is greater than the value of Big y,
- * -1 if the value of this Big is less than the value of Big y, or
- * 0 if they have the same value.
- */
- P.cmp = function (y) {
- var isneg,
- x = this,
- xc = x.c,
- yc = (y = new x.constructor(y)).c,
- i = x.s,
- j = y.s,
- k = x.e,
- l = y.e;
-
- // Either zero?
- if (!xc[0] || !yc[0]) return !xc[0] ? (!yc[0] ? 0 : -j) : i;
-
- // Signs differ?
- if (i != j) return i;
-
- isneg = i < 0;
-
- // Compare exponents.
- if (k != l) return (k > l) ^ isneg ? 1 : -1;
-
- j = (k = xc.length) < (l = yc.length) ? k : l;
-
- // Compare digit by digit.
- for (i = -1; ++i < j; ) {
- if (xc[i] != yc[i]) return (xc[i] > yc[i]) ^ isneg ? 1 : -1;
- }
-
- // Compare lengths.
- return k == l ? 0 : (k > l) ^ isneg ? 1 : -1;
- };
-
- /*
- * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
- * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
- */
- P.div = function (y) {
- var x = this,
- Big = x.constructor,
- a = x.c, // dividend
- b = (y = new Big(y)).c, // divisor
- k = x.s == y.s ? 1 : -1,
- dp = Big.DP;
-
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
-
- // Divisor is zero?
- if (!b[0]) throw Error(DIV_BY_ZERO);
-
- // Dividend is 0? Return +-0.
- if (!a[0]) return new Big(k * 0);
-
- var bl,
- bt,
- n,
- cmp,
- ri,
- bz = b.slice(),
- ai = (bl = b.length),
- al = a.length,
- r = a.slice(0, bl), // remainder
- rl = r.length,
- q = y, // quotient
- qc = (q.c = []),
- qi = 0,
- d = dp + (q.e = x.e - y.e) + 1; // number of digits of the result
-
- q.s = k;
- k = d < 0 ? 0 : d;
-
- // Create version of divisor with leading zero.
- bz.unshift(0);
-
- // CommunicateAdd zeros to make remainder as long as divisor.
- for (; rl++ < bl; ) r.push(0);
-
- do {
- // n is how many times the divisor goes into current remainder.
- for (n = 0; n < 10; n++) {
- // Compare divisor and remainder.
- if (bl != (rl = r.length)) {
- cmp = bl > rl ? 1 : -1;
- } else {
- for (ri = -1, cmp = 0; ++ri < bl; ) {
- if (b[ri] != r[ri]) {
- cmp = b[ri] > r[ri] ? 1 : -1;
- break;
- }
- }
- }
-
- // If divisor < remainder, subtract divisor from remainder.
- if (cmp < 0) {
- // Remainder can't be more than 1 digit longer than divisor.
- // Equalise lengths using divisor with extra leading zero?
- for (bt = rl == bl ? b : bz; rl; ) {
- if (r[--rl] < bt[rl]) {
- ri = rl;
- for (; ri && !r[--ri]; ) r[ri] = 9;
- --r[ri];
- r[rl] += 10;
- }
- r[rl] -= bt[rl];
- }
-
- for (; !r[0]; ) r.shift();
- } else {
- break;
- }
- }
-
- // CommunicateAdd the digit n to the result array.
- qc[qi++] = cmp ? n : ++n;
-
- // Update the remainder.
- if (r[0] && cmp) r[rl] = a[ai] || 0;
- else r = [a[ai]];
- } while ((ai++ < al || r[0] !== UNDEFINED) && k--);
-
- // Leading zero? Do not remove if result is simply zero (qi == 1).
- if (!qc[0] && qi != 1) {
- // There can't be more than one zero.
- qc.shift();
- q.e--;
- }
-
- // Round?
- if (qi > d) round(q, dp, Big.RM, r[0] !== UNDEFINED);
-
- return q;
- };
-
- /*
- * Return true if the value of this Big is equal to the value of Big y, otherwise return false.
- */
- P.eq = function (y) {
- return !this.cmp(y);
- };
-
- /*
- * Return true if the value of this Big is greater than the value of Big y, otherwise return
- * false.
- */
- P.gt = function (y) {
- return this.cmp(y) > 0;
- };
-
- /*
- * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
- * return false.
- */
- P.gte = function (y) {
- return this.cmp(y) > -1;
- };
-
- /*
- * Return true if the value of this Big is less than the value of Big y, otherwise return false.
- */
- P.lt = function (y) {
- return this.cmp(y) < 0;
- };
-
- /*
- * Return true if the value of this Big is less than or equal to the value of Big y, otherwise
- * return false.
- */
- P.lte = function (y) {
- return this.cmp(y) < 1;
- };
-
- /*
- * Return a new Big whose value is the value of this Big minus the value of Big y.
- */
- P.minus = P.sub = function (y) {
- var i,
- j,
- t,
- xlty,
- x = this,
- Big = x.constructor,
- a = x.s,
- b = (y = new Big(y)).s;
-
- // Signs differ?
- if (a != b) {
- y.s = -b;
- return x.plus(y);
- }
-
- var xc = x.c.slice(),
- xe = x.e,
- yc = y.c,
- ye = y.e;
-
- // Either zero?
- if (!xc[0] || !yc[0]) {
- // y is non-zero? x is non-zero? Or both are zero.
- return yc[0] ? ((y.s = -b), y) : new Big(xc[0] ? x : 0);
- }
-
- // Determine which is the bigger number. Prepend zeros to equalise exponents.
- if ((a = xe - ye)) {
- if ((xlty = a < 0)) {
- a = -a;
- t = xc;
- } else {
- ye = xe;
- t = yc;
- }
-
- t.reverse();
- for (b = a; b--; ) t.push(0);
- t.reverse();
- } else {
- // Exponents equal. Check digit by digit.
- j = ((xlty = xc.length < yc.length) ? xc : yc).length;
-
- for (a = b = 0; b < j; b++) {
- if (xc[b] != yc[b]) {
- xlty = xc[b] < yc[b];
- break;
- }
- }
- }
-
- // x < y? Point xc to the array of the bigger number.
- if (xlty) {
- t = xc;
- xc = yc;
- yc = t;
- y.s = -y.s;
- }
-
- /*
- * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only
- * needs to start at yc.length.
- */
- if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--; ) xc[i++] = 0;
-
- // Subtract yc from xc.
- for (b = i; j > a; ) {
- if (xc[--j] < yc[j]) {
- for (i = j; i && !xc[--i]; ) xc[i] = 9;
- --xc[i];
- xc[j] += 10;
- }
-
- xc[j] -= yc[j];
- }
-
- // Remove trailing zeros.
- for (; xc[--b] === 0; ) xc.pop();
-
- // Remove leading zeros and adjust exponent accordingly.
- for (; xc[0] === 0; ) {
- xc.shift();
- --ye;
- }
-
- if (!xc[0]) {
- // n - n = +0
- y.s = 1;
-
- // Result must be zero.
- xc = [(ye = 0)];
- }
-
- y.c = xc;
- y.e = ye;
-
- return y;
- };
-
- /*
- * Return a new Big whose value is the value of this Big modulo the value of Big y.
- */
- P.mod = function (y) {
- var ygtx,
- x = this,
- Big = x.constructor,
- a = x.s,
- b = (y = new Big(y)).s;
-
- if (!y.c[0]) throw Error(DIV_BY_ZERO);
-
- x.s = y.s = 1;
- ygtx = y.cmp(x) == 1;
- x.s = a;
- y.s = b;
-
- if (ygtx) return new Big(x);
-
- a = Big.DP;
- b = Big.RM;
- Big.DP = Big.RM = 0;
- x = x.div(y);
- Big.DP = a;
- Big.RM = b;
-
- return this.minus(x.times(y));
- };
-
- /*
- * Return a new Big whose value is the value of this Big plus the value of Big y.
- */
- P.plus = P.add = function (y) {
- var t,
- x = this,
- Big = x.constructor,
- a = x.s,
- b = (y = new Big(y)).s;
-
- // Signs differ?
- if (a != b) {
- y.s = -b;
- return x.minus(y);
- }
-
- var xe = x.e,
- xc = x.c,
- ye = y.e,
- yc = y.c;
-
- // Either zero? y is non-zero? x is non-zero? Or both are zero.
- if (!xc[0] || !yc[0]) return yc[0] ? y : new Big(xc[0] ? x : a * 0);
-
- xc = xc.slice();
-
- // Prepend zeros to equalise exponents.
- // Note: reverse faster than unshifts.
- if ((a = xe - ye)) {
- if (a > 0) {
- ye = xe;
- t = yc;
- } else {
- a = -a;
- t = xc;
- }
-
- t.reverse();
- for (; a--; ) t.push(0);
- t.reverse();
- }
-
- // Point xc to the longer array.
- if (xc.length - yc.length < 0) {
- t = yc;
- yc = xc;
- xc = t;
- }
-
- a = yc.length;
-
- // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.
- for (b = 0; a; xc[a] %= 10) b = ((xc[--a] = xc[a] + yc[a] + b) / 10) | 0;
-
- // No need to check for zero, as +x + +y != 0 && -x + -y != 0
-
- if (b) {
- xc.unshift(b);
- ++ye;
- }
-
- // Remove trailing zeros.
- for (a = xc.length; xc[--a] === 0; ) xc.pop();
-
- y.c = xc;
- y.e = ye;
-
- return y;
- };
-
- /*
- * Return a Big whose value is the value of this Big raised to the power n.
- * If n is negative, round to a maximum of Big.DP decimal places using rounding
- * mode Big.RM.
- *
- * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
- */
- P.pow = function (n) {
- var x = this,
- one = new x.constructor(1),
- y = one,
- isneg = n < 0;
-
- if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER)
- throw Error(INVALID + "exponent");
- if (isneg) n = -n;
-
- for (;;) {
- if (n & 1) y = y.times(x);
- n >>= 1;
- if (!n) break;
- x = x.times(x);
- }
-
- return isneg ? one.div(y) : y;
- };
-
- /*
- * Return a new Big whose value is the value of this Big rounded using rounding mode rm
- * to a maximum of dp decimal places, or, if dp is negative, to an integer which is a
- * multiple of 10**-dp.
- * If dp is not specified, round to 0 decimal places.
- * If rm is not specified, use Big.RM.
- *
- * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
- * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)
- */
- P.round = function (dp, rm) {
- var Big = this.constructor;
- if (dp === UNDEFINED) dp = 0;
- else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP)
- throw Error(INVALID_DP);
- return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm);
- };
-
- /*
- * Return a new Big whose value is the square root of the value of this Big, rounded, if
- * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
- */
- P.sqrt = function () {
- var r,
- c,
- t,
- x = this,
- Big = x.constructor,
- s = x.s,
- e = x.e,
- half = new Big(0.5);
-
- // Zero?
- if (!x.c[0]) return new Big(x);
-
- // Negative?
- if (s < 0) throw Error(NAME + "No square root");
-
- // Estimate.
- s = Math.sqrt(x + "");
-
- // Math.sqrt underflow/overflow?
- // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
- if (s === 0 || s === 1 / 0) {
- c = x.c.join("");
- if (!((c.length + e) & 1)) c += "0";
- s = Math.sqrt(c);
- e = (((e + 1) / 2) | 0) - (e < 0 || e & 1);
- r = new Big(
- (s == 1 / 0
- ? "1e"
- : (s = s.toExponential()).slice(0, s.indexOf("e") + 1)) + e
- );
- } else {
- r = new Big(s);
- }
-
- e = r.e + (Big.DP += 4);
-
- // Newton-Raphson iteration.
- do {
- t = r;
- r = half.times(t.plus(x.div(t)));
- } while (t.c.slice(0, e).join("") !== r.c.slice(0, e).join(""));
-
- return round(r, (Big.DP -= 4), Big.RM);
- };
-
- /*
- * Return a new Big whose value is the value of this Big times the value of Big y.
- */
- P.times = P.mul = function (y) {
- var c,
- x = this,
- Big = x.constructor,
- xc = x.c,
- yc = (y = new Big(y)).c,
- a = xc.length,
- b = yc.length,
- i = x.e,
- j = y.e;
-
- // Determine sign of result.
- y.s = x.s == y.s ? 1 : -1;
-
- // Return signed 0 if either 0.
- if (!xc[0] || !yc[0]) return new Big(y.s * 0);
-
- // Initialise exponent of result as x.e + y.e.
- y.e = i + j;
-
- // If array xc has fewer digits than yc, swap xc and yc, and lengths.
- if (a < b) {
- c = xc;
- xc = yc;
- yc = c;
- j = a;
- a = b;
- b = j;
- }
-
- // Initialise coefficient array of result with zeros.
- for (c = new Array((j = a + b)); j--; ) c[j] = 0;
-
- // Multiply.
-
- // i is initially xc.length.
- for (i = b; i--; ) {
- b = 0;
-
- // a is yc.length.
- for (j = a + i; j > i; ) {
- // Current sum of products at this digit position, plus carry.
- b = c[j] + yc[i] * xc[j - i - 1] + b;
- c[j--] = b % 10;
-
- // carry
- b = (b / 10) | 0;
- }
-
- c[j] = (c[j] + b) % 10;
- }
-
- // Increment result exponent if there is a final carry, otherwise remove leading zero.
- if (b) ++y.e;
- else c.shift();
-
- // Remove trailing zeros.
- for (i = c.length; !c[--i]; ) c.pop();
- y.c = c;
-
- return y;
- };
-
- /*
- * Return a string representing the value of this Big in exponential notation to dp fixed decimal
- * places and rounded using Big.RM.
- *
- * dp? {number} Integer, 0 to MAX_DP inclusive.
- */
- P.toExponential = function (dp) {
- return stringify(this, 1, dp, dp);
- };
-
- /*
- * Return a string representing the value of this Big in normal notation to dp fixed decimal
- * places and rounded using Big.RM.
- *
- * dp? {number} Integer, 0 to MAX_DP inclusive.
- *
- * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
- * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
- */
- P.toFixed = function (dp) {
- return stringify(this, 2, dp, this.e + dp);
- };
-
- /*
- * Return a string representing the value of this Big rounded to sd significant digits using
- * Big.RM. Use exponential notation if sd is less than the number of digits necessary to represent
- * the integer part of the value in normal notation.
- *
- * sd {number} Integer, 1 to MAX_DP inclusive.
- */
- P.toPrecision = function (sd) {
- return stringify(this, 3, sd, sd - 1);
- };
-
- /*
- * Return a string representing the value of this Big.
- * Return exponential notation if this Big has a positive exponent equal to or greater than
- * Big.PE, or a negative exponent equal to or less than Big.NE.
- * Omit the sign for negative zero.
- */
- P.toString = function () {
- return stringify(this);
- };
-
- /*
- * Return a string representing the value of this Big.
- * Return exponential notation if this Big has a positive exponent equal to or greater than
- * Big.PE, or a negative exponent equal to or less than Big.NE.
- * Include the sign for negative zero.
- */
- P.valueOf = P.toJSON = function () {
- return stringify(this, 4);
- };
-
- // Export
-
- Big = _Big_();
-
- Big["default"] = Big.Big = Big;
-
- //AMD.
- if (typeof define === "function" && define.amd) {
- define(function () {
- return Big;
- });
-
- // Node and other CommonJS-like environments that support module.exports.
- } else if (typeof module !== "undefined" && module.exports) {
- module.exports = Big;
-
- //Browser.
- } else {
- GLOBAL.Big = Big;
- }
-})(this);
--
Gitblit v1.9.3