Commit 3cdcd05f by zhangzhen

代码优化

parent 0819347e
......@@ -204,7 +204,6 @@ export const uploadFile = (data) => {
export const uploadFile2 = (data) => {
console.log(data, "我要上传文件")
return new Promise((resolve, reject) => {
let tokenHeaders = uni.getStorageSync("tokenHeaders");
uni.uploadFile({
......
......@@ -29,4 +29,10 @@
left: 0;
width: 100%;
height: 100%;
}
.ellipsis{
max-width: 420upx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file
const CONFIG = {
// 开发环境配置
development: {
assetsPath: 'http://129.211.46.84:8085', // 静态资源路径
assetsPath: 'https://www.eis-paas.com', // 静态资源路径
// assetsPath: 'http://129.211.46.84:8085', // 静态资源路径
// baseUrl: 'http://10.24.1.97:8080/hp-smart', // 后台接口请求地址
// #ifdef MP
baseUrl:'http://129.211.46.84:8085',
......@@ -9,7 +10,8 @@ const CONFIG = {
// #ifndef MP
baseUrl:'/prod-api',
// #endif
hostUrl: 'http://129.211.46.84:8085/hggp', // H5地址(前端运行地址)
hostUrl: 'https://www.eis-paas.com', // H5地址(前端运行地址)
// hostUrl: 'http://129.211.46.84:8085/hggp', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '' ,// 微信公众号appid
codeHeadUrl:"",
......@@ -17,9 +19,9 @@ const CONFIG = {
},
// 生产环境配置
production: {
assetsPath: 'http://129.211.46.84:8085', // 静态资源路径
assetsPath: 'https://www.eis-paas.com', // 静态资源路径
baseUrl: '/hggp', // 后台接口请求地址
hostUrl: 'http://129.211.46.84:8085', // H5地址(前端运行地址)
hostUrl: 'https://www.eis-paas.com', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid
codeHeadUrl:"",
......
......@@ -203,7 +203,6 @@
};
},
onLoad(option) {
console.log(uni.getStorageSync("userInfor"))
this.onLoading();
if (option && option.id) {
this.textTitle = "维保申请"
......@@ -296,7 +295,7 @@
},
onChange2(e) {
let index = Number(e.target.value);
if (this.deviceIndex === index) return
if (!this.deviceList.length || this.deviceIndex === index) return
this.deviceIndex = index;
},
onProjectChange(e) {
......
......@@ -205,7 +205,6 @@
status: '1'
}).then(res => {
uni.hideLoading();
console.log(res);
this.projectDataList[this.submitIndex].status = "1";
this.$forceUpdate();
})
......
......@@ -206,7 +206,6 @@
createdTime:""
}).then(res=>{
uni.hideLoading();
console.log(res,99999)
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
if(list && list.length){
this.orderInfo = {
......
......@@ -231,10 +231,8 @@
id: this.id
}).then(res=>{
uni.hideLoading();
console.log(res,99999)
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
if(list && list.length){
console.log(list[0].checkDate.trim(),"990999")
this.orderInfo = {
...list[0],
checkDate: list[0].checkDate.trim()? moment(list[0].checkDate).format("YYYY-MM-DD"):moment().format("YYYY-MM-DD"),
......
......@@ -323,7 +323,6 @@
};
},
onLoad(option) {
console.log(option,99999)
this.value = Number(option.tabIndex) || 0;
this.onLoading();
},
......
......@@ -447,9 +447,6 @@
let list = xData.map(item => {
return this.dataChatList.filter(val => val.completeDate === item)
})
console.log(yData,9999)
console.log(list,9999)
let option = {
color: ['#157DFF', '#5FD77E', '#FF8C00', '#e05aff'],
tooltip: {
......
......@@ -154,12 +154,10 @@
url:"/pages/debit-note/index",
events:{
acceptDataFromOpenedPage: (data) => {
console.log(data)
that.orderInfo = {
...that.orderInfo,
...data
}
console.log(that.orderInfo,9999)
that.$forceUpdate();
}
}
......
......@@ -279,7 +279,6 @@
};
},
onLoad(option) {
console.log(option, 99999)
this.value = Number(option.tabIndex) || 0;
this.onLoading();
},
......
......@@ -270,7 +270,6 @@
};
},
onLoad(option) {
console.log(option, 99999)
this.value = Number(option.tabIndex) || 0;
this.onLoading();
},
......
......@@ -238,7 +238,6 @@
};
},
onLoad(option) {
console.log(uni.getStorageSync("userInfor"))
this.onLoading();
if (option && option.id) {
this.textTitle = "设备台账"
......@@ -409,7 +408,7 @@
getOrgByCompanyCode({
parentOrgId: this.factoryList[this.factoryIndex].value
}).then(res => {
console.log(res,9999)
this.groupRecordList = toJsonData(res.data.__blocks__.group_record_block_id.rows, res.data.__blocks__.group_record_block_id.meta.columns).map(item=>{
return {
value: item.valueField,
......@@ -426,7 +425,7 @@
getUserByCompanyCode({
companyCode: this.factoryList[this.factoryIndex].value
}).then(res => {
console.log(res,9999)
this.userList = toJsonData(res.data.__blocks__.user_block_id.rows, res.data.__blocks__.user_block_id.meta.columns).map(item=>{
return {
value: item.valueField,
......
......@@ -226,7 +226,7 @@
deviceStatus: status
}).then(res => {
uni.hideLoading();
console.log(res);
this.projectDataList[this.submitIndex].deviceStatus = status;
this.$forceUpdate();
})
......
......@@ -173,7 +173,7 @@
this.onLoading();
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('acceptDataFromOpenerPage', (data) => {
console.log(data,"shuju")
this.orderInfo = {
...data.data,
checkDate: data.data.checkDate.trim()? data.data.checkDate : moment().format("YYYY-MM-DD")
......@@ -182,7 +182,6 @@
},
methods: {
onChange1(e){
console.log(e,this.orderInfo.quantity,99999)
if(e>0){
if(e > Number(this.orderInfo.quantity)){
this.orderInfo.passQuantity = this.orderInfo.quantity;
......
......@@ -485,7 +485,7 @@
value: item.valueField
}
});
console.log(this.inventTypeBoxList, "存货类型")
})
},
onGetInventRecord(i) {
......
......@@ -725,7 +725,7 @@
.title {
display: flex;
flex-direction: row;
width: 200upx;
width: 220upx;
align-items: center;
}
}
......
......@@ -301,7 +301,6 @@
}
})
}
console.log(this.merchantList,9999)
})
},
onFactoryChange(e) {
......
......@@ -260,7 +260,6 @@
}
});
this.subList = [...list,...this.subList];
console.log(this.subList,99999)
this.$forceUpdate();
}
}
......
......@@ -267,7 +267,7 @@
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList= toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
console.log(this.projectDataList)
})
},
onGetList2() {
......
......@@ -28,6 +28,14 @@
<form>
<view class="cu-form-group">
<view class="title">
<text>项目名称:</text>
</view>
<view class="">
<text>{{orderInfo.projName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
......@@ -692,7 +700,7 @@
.title {
display: flex;
flex-direction: row;
width: 200upx;
width: 220upx;
align-items: center;
}
.text-blue{
......
......@@ -37,7 +37,7 @@
<view class="header-title" @tap="onNavToOrderInfo(item)">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.projName}}</text>
<text class="text-black text-bold ellipsis">{{item.projName}}</text>
<view class="margin-right text-blue">
<text class="">详情</text>
<text class="cuIcon-right"></text>
......
......@@ -288,7 +288,7 @@
getByPlanInfoNo(this.queryData).then(res => {
uni.hideLoading();
if (res.data.__sys__.status == 0) {
console.log(res, "数据结果");
this.orderInfor = {
...res.data.planInfo,
planDetail: res.data.planInfo.planDetail&&res.data.planInfo.planDetail.length? res.data.planInfo.planDetail.map(item => {
......
......@@ -237,7 +237,7 @@
...this.orderInfo,
depositDate: moment(this.orderInfo.depositDate).format("YYYYMMDD")
}).then(res2 => {
console.log(res2, 777777);
if (res2.data.__sys__.status === 1) {
uni.showToast({
icon:"none",
......@@ -253,7 +253,7 @@
whCode: this.projectList[this.projectIndex].value,
whName: this.projectList[this.projectIndex].label
}).then(res => {
console.log(res, 99999999)
if (res.data.__sys__.status === 0) {
updateSubmitStatus({
...this.orderInfo,
......@@ -261,7 +261,7 @@
whCode: this.projectList[this.projectIndex].value,
whName: this.projectList[this.projectIndex].label
}).then(res2 => {
console.log(res2, 88888);
if (res2.data.__sys__.status === 1) {
uni.showToast({
icon:"none",
......@@ -565,7 +565,7 @@
.title {
display: flex;
flex-direction: row;
width: 240upx;
min-width: 180upx;
align-items: center;
}
}
......
......@@ -32,7 +32,7 @@
<view class="header-title" @tap="onNavToOrderInfo(item)">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.projName|| ''}}</text>
<text class="text-black text-bold ellipsis">{{item.projName|| ''}}</text>
<view class="margin-right text-blue">
<text class="">详情</text>
<text class="cuIcon-right"></text>
......@@ -216,7 +216,7 @@
},
onLoading() {
getParamsList().then(res=>{
console.log(res,9999999)
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
......
......@@ -210,7 +210,7 @@
},
methods: {
onChange(e){
console.log(e,99999)
this.orderInfo.weight = e*Number(this.orderInfo.singleWeight);
if(e > Number(this.orderInfo.unregisterQuantity)){
this.tipShow = true
......@@ -264,9 +264,9 @@
},
// 新增图片
async afterRead(event) {
console.log(event,"文件资源")
let lists = this.onOversize(event);
console.log(lists,9999)
let fileListLen = this.fileList.length;
lists.map((item) => {
this.fileList.push({
......@@ -279,7 +279,6 @@
const result = await uploadFile2({
url: lists[i].url
})
console.log(result,99999)
let res = JSON.parse(result.data)
let item = this.fileList[fileListLen]
this.fileList.splice(fileListLen, 1, Object.assign(item, {
......@@ -316,7 +315,6 @@
this.onCancel();
},
onConfirmSave(){
console.log(this.fileList,999)
this.onCancel();
uni.showLoading({
title:"提交中..."
......
......@@ -137,13 +137,13 @@
range-key="label">
<view class="uni-input">
<text
class="text-blue">{{ projectIndex>=0 ? projectList[projectIndex].label:'请选择仓库'}}</text>
class="text-blue">{{ projectIndex >= 0 ? projectList[projectIndex].label:'请选择仓库'}}</text>
<text class="cuIcon-right"></text>
</view>
</picker>
</view>
<view v-else class="">
<text>{{orderInfo.whName}}</text>
<text>{{factoryEnum[orderInfo.whCode]}}</text>
</view>
</view>
</form>
......@@ -239,7 +239,6 @@
this.show = false;
if (this.orderInfo.whCode.length>2) {
updateSubmitStatus(this.orderInfo).then(res2 => {
console.log(res2, 777777);
if (res2.data.__sys__.status === 1) {
uni.showToast({
icon:"none",
......@@ -293,20 +292,18 @@
this.projectIndex = index;
},
onBack() {
uni.redirectTo({
url: "/pages/purchase-warehousing/list"
})
uni.navigateBack();
},
onLoading() {
getParamsData(this.queryData).then(res => {
this.projectList = toJsonData(res.data.__blocks__.wh_code_block_id.rows, res.data
.__blocks__.wh_code_block_id.meta.columns).map(item => {
this.projectList = toJsonData(res.data.__blocks__.wh_code_block_id.rows, res.data.__blocks__.wh_code_block_id.meta.columns).map(item => {
this.factoryEnum[item.valueField] = item.textField
return {
label: item.textField,
value: item.valueField
}
});
console.log(this.projectList,"仓库数据")
this.onGetList();
})
},
......@@ -326,6 +323,10 @@
...obj,
depositDate: moment(obj.depositDate).format("YYYY-MM-DD")
}
if(this.orderInfo && this.orderInfo.whCode.length>2){
this.projectIndex = this.projectList.findIndex(item=>item.value === this.orderInfo.whCode);
}
}
})
}
......
......@@ -481,13 +481,11 @@
url: `/pages/settlement-doc/index?contractNumber=${this.orderInfo.contractNumber}`,
events: {
acceptDataFromOpenedPage: (data) => {
console.log(data)
that.orderInfo = {
...that.orderInfo,
...data
}
that.formList = [];
console.log(that.orderInfo, 9999)
that.$forceUpdate();
}
}
......
......@@ -455,7 +455,6 @@
this.orderInfo.cumulativeSettlementTax = this.orderInfo.thisSettlementTax; // 累计税额
}
console.log(this.orderInfo.thisSettlementAmount)
this.$forceUpdate();
}
......@@ -635,7 +634,7 @@
}
});
this.subList = [...list,...this.subList];
console.log(this.subList,99999)
this.$forceUpdate();
}
}
......@@ -652,7 +651,7 @@
getProList2({
contractNumber: this.orderInfo.contractNumber
}).then(res => {
console.log(res,99999)
if(res.data.__sys__.status === 0){
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns);
if(list.length && list.length ==1){
......
......@@ -125,7 +125,6 @@
getDict({
codeset:'hggp.cw.contractType'
}).then(res=>{
console.log(res,9999)
if(res.data.list && res.data.list.length){
res.data.list.forEach(item=>{
this.contractTypeEnum[item.value] = item.label
......
......@@ -273,7 +273,7 @@
id: this.id
}).then(res=>{
uni.hideLoading();
console.log(res,99999)
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
if(list && list.length){
this.orderInfo = {
......
......@@ -254,7 +254,7 @@
id: this.id
}).then(res=>{
uni.hideLoading();
console.log(res,99999)
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
if(list && list.length){
this.orderInfo = {
......
......@@ -286,7 +286,7 @@
};
},
onLoad(option) {
console.log(option,99999)
this.value = Number(option.tabIndex) || 0;
this.onLoading();
},
......
......@@ -5,8 +5,9 @@ module.exports = {
open: true,
proxy: {
'/prod-api': {
target: `http://129.211.46.84:8085/hggp`,
// target: `https://www.eis-paas.com/hggp`,
// target: `http://10.24.4.81:8099/hggp`,
// target: `http://129.211.46.84:8085/hggp`,
target: `https://www.eis-paas.com/hggp`,
changeOrigin: true,
pathRewrite: {
'/prod-api': ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment