Browse Source

Merge branch 'dev_web'

dev_pda
陈薪名 2 years ago
parent
commit
e22d8ec6f3
  1. 7
      fe/PC/src/components/currenDescriptions/index.vue
  2. 5
      fe/PC/src/components/currenTable/index.vue
  3. 8
      fe/PC/src/components/umyTable/index.vue
  4. 12
      fe/PC/src/mixins/mixins.js
  5. 30
      fe/PC/src/utils/formatTime.js
  6. 3
      fe/PC/src/utils/request.js
  7. 2
      fe/PC/src/utils/tabsDesTions/index.js
  8. 2
      fe/PC/src/views/basicData/BomManage/Bom.vue
  9. 12
      fe/PC/src/views/basicData/WorkshopManage/WorkCenter.vue

7
fe/PC/src/components/currenDescriptions/index.vue

@ -66,6 +66,7 @@
</template> </template>
<script> <script>
import { parseTime } from "@/utils/index" import { parseTime } from "@/utils/index"
import { formatDateTime } from "@/utils/formatTime"
import { fileStorage } from "@/api/wms-api" import { fileStorage } from "@/api/wms-api"
let that let that
@ -83,11 +84,7 @@ export default {
}, },
filters: { filters: {
formatDate (time) { formatDate (time) {
if(!time){ return formatDateTime(time)
return "-"
}
var date = new Date(time);
return parseTime(date)
}, },
formatOnlyDate (time) { formatOnlyDate (time) {
var date = new Date(time); var date = new Date(time);

5
fe/PC/src/components/currenTable/index.vue

@ -307,7 +307,7 @@
</template> </template>
<script> <script>
import Sortable from "sortablejs"; import Sortable from "sortablejs";
import { parseTime, debounce } from "@/utils/index"; import { formatDateTime } from "@/utils/formatTime";
import { getMatchRegConformValue } from "@/utils/index" import { getMatchRegConformValue } from "@/utils/index"
import _ from "lodash"; import _ from "lodash";
export default { export default {
@ -317,8 +317,7 @@ export default {
if (time == null) { if (time == null) {
return '-' return '-'
} }
var date = new Date(time) return formatDateTime(time)
return parseTime(date)
}, },
}, },
props: { props: {

8
fe/PC/src/components/umyTable/index.vue

@ -320,18 +320,14 @@
</u-table> </u-table>
</template> </template>
<script> <script>
import { parseTime } from "@/utils/index"; import { formatDateTime } from "@/utils/formatTime";
import _ from "lodash"; import _ from "lodash";
import { getMatchRegConformValue } from "@/utils/index" import { getMatchRegConformValue } from "@/utils/index"
export default { export default {
name: "currenTable", name: "currenTable",
filters: { filters: {
formatDate(time) { formatDate(time) {
if (time == null) { return formatDateTime(time)
return '-'
}
var date = new Date(time)
return parseTime(date)
}, },
}, },
props: { props: {

12
fe/PC/src/mixins/mixins.js

@ -227,18 +227,19 @@ export const mixins = {
fd.append("file", formFile[0]) fd.append("file", formFile[0])
postImport(fd, _uploadURL, _isSpecial).then(res => { postImport(fd, _uploadURL, _isSpecial).then(res => {
const headers = JSON.parse(res.headers)
// 判断是否有错误记录 // 判断是否有错误记录
if (res.errorNum > 0) { if (headers.result.ErrorNum > 0) {
that.$alert('发现导入错误数据共:' + res.errorNum + '条', '错误报告', { that.$alert('发现导入错误数据共:' + headers.result.ErrorNum + '条', '错误报告', {
confirmButtonText: '下载错误报告', confirmButtonText: '下载错误报告',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
that.blob(res.bytes, menuName + '错误报告') that.blob(res, menuName + '错误报告')
} }
} }
}) })
} else if (res.exceptionMessage != null) { } else if (headers.result.ExceptionMessage != null) {
that.$alert('错误信息:' + res.exceptionMessage, '错误', { that.$alert('错误信息:' + headers.result.ExceptionMessage, '错误', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
} }
@ -259,6 +260,7 @@ export const mixins = {
that.displayDialog.importDialog = false; that.displayDialog.importDialog = false;
that.paging() that.paging()
}).catch(err => { }).catch(err => {
that.$errorMsg('导入过程中发生错误!请联系管理员!')
that.Loading.importLoading = false that.Loading.importLoading = false
that.FormRemove(val[0]); that.FormRemove(val[0]);
that.displayDialog.importDialog = false; that.displayDialog.importDialog = false;

30
fe/PC/src/utils/formatTime.js

@ -1,5 +1,35 @@
/**
* 格林威治的时间差 补8小时
*/
export function formatDateTime(dateTime) {
dateTime = formatTimeStrToStr(dateTime)
if (!dateTime) {
return '-'
}
var nowDate = new Date(dateTime).getTime();
// var timezone = 8; //目标时区时间,东八区
var offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
// var nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
// var targetDate = new Date(nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000);
var targetDate = new Date(nowDate - offset_GMT * 60 * 1000);
let datae = new Date(targetDate);
var YY = datae.getFullYear() + '-';
var MM =(datae.getMonth() + 1 < 10
? '0' + (datae.getMonth() + 1)
: datae.getMonth() + 1) + '-';
var DD = datae.getDate() < 10 ? '0' + datae.getDate() : datae.getDate();
var hh =(datae.getHours() < 10 ? '0' + datae.getHours() : datae.getHours())+':';
var mm =(datae.getMinutes() < 10 ? '0' + datae.getMinutes() : datae.getMinutes()) +':';
var ss =datae.getSeconds() < 10 ? '0' + datae.getSeconds() : datae.getSeconds();
let mydatavalue = `${YY}${MM}${DD} ${hh}${mm}${ss}`;
return mydatavalue
}
// 2022-08-31T09:45:51.9340433 转 2022-08-31 09:45:51 // 2022-08-31T09:45:51.9340433 转 2022-08-31 09:45:51
export function formatTimeStrToStr(timeStr) { export function formatTimeStrToStr(timeStr) {
if (!timeStr || !new Date(timeStr)) {
return ''
}
if (timeStr.lastIndexOf('.') == -1) { if (timeStr.lastIndexOf('.') == -1) {
return timeStr.replace('T',' ').substring(0,timeStr.length) return timeStr.replace('T',' ').substring(0,timeStr.length)
} }

3
fe/PC/src/utils/request.js

@ -57,9 +57,10 @@ service.interceptors.response.use(
*/ */
response => { response => {
const res = response.data const res = response.data
console.log(response)
if(response.headers['content-disposition']){ if(response.headers['content-disposition']){
res.disposition = response.headers['content-disposition'] res.disposition = response.headers['content-disposition']
} else if (response.headers['x-response']) {
res.headers = response.headers['x-response']
} }
// if the custom code is not 20000, it is judged as an error. // if the custom code is not 20000, it is judged as an error.
// if (res.code !== 20000) { // if (res.code !== 20000) {

2
fe/PC/src/utils/tabsDesTions/index.js

@ -618,7 +618,7 @@ export const ProductionLineItem = [
export const WorkCenter = [ export const WorkCenter = [
{ label: "生产线编号", prop: "productionLineCode" }, { label: "生产线编号", prop: "productionLineCode" },
{ label: "原料库位", prop: "rawLocation" }, { label: "原料库位", prop: "rawLocation" },
{ label: "成品编号", prop: "productLocation" }, { label: "成品库位", prop: "productLocation" },
{ label: "工作站编号", prop: "code" }, { label: "工作站编号", prop: "code" },
{ label: "工作站名称", prop: 'name' }, { label: "工作站名称", prop: 'name' },
{ type: "filter", label: "类型", prop: "type", filters: "workCenterType" }, { type: "filter", label: "类型", prop: "type", filters: "workCenterType" },

2
fe/PC/src/views/basicData/BomManage/Bom.vue

@ -156,7 +156,7 @@ export default {
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物料选择', this.CreateFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物料选择', this.CreateFormData) }, colSpan: 12 },
{ type: "input", label: "子物料用量", prop: 'componentQty', colSpan: 12, validType:'pointNumber' }, { type: "input", label: "子物料用量", prop: 'componentQty', colSpan: 12, validType:'pointNumber' },
{ type: "input", label: "子物料用量单位", prop: 'componentUom', colSpan: 12 }, { type: "input", label: "子物料用量单位", prop: 'componentUom', disabled:"true", colSpan: 12 },
{ type: "dateTime", label: "开始时间", prop: "beginTime", colSpan: 12 }, { type: "dateTime", label: "开始时间", prop: "beginTime", colSpan: 12 },
{ type: "dateTime", label: "结束时间", prop: "endTime", colSpan: 12 }, { type: "dateTime", label: "结束时间", prop: "endTime", colSpan: 12 },
{ type: "input", label: "ERP工序", prop: "erpOp", colSpan: 12 }, { type: "input", label: "ERP工序", prop: "erpOp", colSpan: 12 },

12
fe/PC/src/views/basicData/WorkshopManage/WorkCenter.vue

@ -133,7 +133,7 @@ export default {
description: null, description: null,
type: 1, type: 1,
productionLineCode: null, productionLineCode: null,
rawLocation: null, rawLocationCode: null,
productLocation: null, productLocation: null,
remark: null remark: null
}, },
@ -144,7 +144,7 @@ export default {
description: null, description: null,
type: 1, type: 1,
productionLineCode: null, productionLineCode: null,
rawLocation: null, rawLocationCode: null,
productLocation: null, productLocation: null,
concurrencyStamp: null, concurrencyStamp: null,
remark: null remark: null
@ -154,10 +154,10 @@ export default {
{ type: "filterSelect", label: "生产线编号", prop: "productionLineCode", optionsLabel: "name", optionsValue: "code", { type: "filterSelect", label: "生产线编号", prop: "productionLineCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/productionLine")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/productionLine")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/productionLine', 'ProductionLine', '生产线选择', this.CreateFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/productionLine', 'ProductionLine', '生产线选择', this.CreateFormData) }, colSpan: 12 },
{ type: "filterSelect", label: "原料库位", prop: "rawLocation", optionsLabel: "name", optionsValue: "code", { type: "filterSelect", label: "原料库位", prop: "rawLocationCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData) }, colSpan: 12 },
{ type: "filterSelect", label: "成品编号", prop: "productLocation", optionsLabel: "name", optionsValue: "code", { type: "filterSelect", label: "成品库位", prop: "productLocation", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData) }, colSpan: 12 },
{ type: "input", label: "工作站编号", prop: "code", validType:'numberLetter', colSpan: 12 }, { type: "input", label: "工作站编号", prop: "code", validType:'numberLetter', colSpan: 12 },
@ -170,10 +170,10 @@ export default {
{ type: "filterSelect", label: "生产线编号", prop: "productionLineCode", optionsLabel: "name", optionsValue: "code", { type: "filterSelect", label: "生产线编号", prop: "productionLineCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/productionLine")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/productionLine")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/productionLine', 'ProductionLine', '生产线选择', this.editFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/productionLine', 'ProductionLine', '生产线选择', this.editFormData) }, colSpan: 12 },
{ type: "filterSelect", label: "原料库位", prop: "rawLocation", optionsLabel: "name", optionsValue: "code", { type: "filterSelect", label: "原料库位", prop: "rawLocationCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.editFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.editFormData) }, colSpan: 12 },
{ type: "filterSelect", label: "成品编号", prop: "productLocation", optionsLabel: "name", optionsValue: "code", { type: "filterSelect", label: "成品库位", prop: "productLocation", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")}, focus: (type,val) => { return this.getFilterList(type, val, "basedata/location")},
searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.editFormData) }, colSpan: 12 }, searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.editFormData) }, colSpan: 12 },
{ type: "input", label: "工作站编号", prop: "code", validType:'numberLetter', colSpan: 12 }, { type: "input", label: "工作站编号", prop: "code", validType:'numberLetter', colSpan: 12 },

Loading…
Cancel
Save