Commit 56caa378 by zhangzhen

细节优化

parent 117d7e19
import http from "@/common/vmeitime-http/index.js"
const setParamsData = (data = {},pageData) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {
count: 0,
limit: pageData && pageData.limit? pageData.limit : 10,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true"
},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(obj));
return paramsData
}
const setResultData = (data={}) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
obj[i] = data[i]
}
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"result": {
"attr": {},
"meta": {
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
return paramsData
}
export const getList = (params,pageData) => {
let url = `/service/S_XS_KK_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const save = (data) => {
let url = `/service/S_XS_KK_02`
let d = setResultData(data);
return http.post(url, d)
}
export const updateSubmitStatus = (data) => {
let url = `/service/S_XS_KK_03`
let d = setResultData(data);
return http.post(url, d)
}
export const getProList = (params,pageData) => {
let url = `/service/S_CW_XM_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
import http from "@/common/vmeitime-http/index.js"
const setParamsData = (data = {},pageData) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {
count: 0,
limit: pageData && pageData.limit? pageData.limit : 10,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true"
},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(obj));
return paramsData
}
const setResultData = (data={}) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
obj[i] = data[i]
}
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"result": {
"attr": {},
"meta": {
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
return paramsData
}
export const getList = (params,pageData) => {
let url = `/service/S_XS_JS_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const save = (data) => {
let url = `/service/S_XS_KK_02`
let d = setResultData(data);
return http.post(url, d)
}
export const updateSubmitStatus = (data) => {
let url = `/service/S_XS_KK_03`
let d = setResultData(data);
return http.post(url, d)
}
export const getProList = (params,pageData) => {
let url = `/service/S_CW_HT_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
......@@ -510,6 +510,83 @@
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/debit-note/list",
"style" :
{
"navigationBarTitleText" : "扣款单管理",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/debit-note/add",
"style" :
{
"navigationBarTitleText" : "新增扣款单",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/debit-note/index",
"style" :
{
"navigationBarTitleText" : "选择项目",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/debit-note/edit",
"style" :
{
"navigationBarTitleText" : "详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/settlement-doc/list",
"style" :
{
"navigationBarTitleText" : "结算单管理",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/settlement-doc/add",
"style" :
{
"navigationBarTitleText" : "新增结算单",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/settlement-doc/index",
"style" :
{
"navigationBarTitleText" : "选择合同",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {
......
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">选择项目</text>
</block>
<block slot="right">
<text class="text-green text-bold text-lg margin-right" @tap="onCheck">确 定</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col data-content" >
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item" @tap="onSelect(k)">
<view class="flex-col content-box" :class="k === current?'active':''">
<view class="flex-row">
<text class="text-gray part-1">甲方名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.partyA}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">主合同名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.contractName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">主合同号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.contractNumber}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">项目编号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.projCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">乙方名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.partyB}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {toJsonData} from "@/utils/tools.js";
import { getProList } from "@/api/debit-note.js";
export default {
data() {
return {
projectDataList:[],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
queryData: {},
pageData:{
showCount: "true",
limit:5,
offset:0
},
current:0,
eventChannel: null
};
},
onLoad(option) {
this.eventChannel = this.getOpenerEventChannel();
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
this.onGetList();
}
},
methods: {
onCheck(){
this.eventChannel.emit('acceptDataFromOpenedPage', this.projectDataList[this.current]);
this.onBack();
},
onSelect(k){
this.current = k;
},
onBack(){
uni.navigateBack();
},
onLoading() {
this.onGetList();
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getProList({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.projcet_combo_box.rows,res.data.__blocks__.projcet_combo_box.meta.columns)
if (this.pageData.offset == 0) {
this.projectDataList = list
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
if (this.projectDataList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
}
}
}
</script>
<style>
page {
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.page-content-box{
width: 100vw;
height: 100vh;
overflow: hidden;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 96%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 30upx auto;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 40upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row{
margin: 6upx 0;
.part-1{
width: 140upx;
text-align-last: justify;
}
.part-2{
margin-right: 24upx;
}
}
}
.active{
box-shadow: 0 0 12upx #4a93f8;
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.float-box{
position: fixed;
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border-radius: 25px;
background-color: #4a93f8;
color: #ffffff;
box-shadow: 0 0 16upx rgba(74, 147, 248, 0.34),0 0 12upx rgba(74, 147, 248, 0.34) inset;
z-index: 99;
font-size: 32upx;
}
.factory-name{
max-width: 360upx;
.factory-title{
// width: 360upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.ellipsis{
max-width: 420upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
\ No newline at end of file
......@@ -81,6 +81,126 @@
</form>
</view>
</view>
<view class="flex-col content-part-1 content-part-2">
<view class="flex-row header">
<text class="text-lg text-bold text-black">领料明细</text>
</view>
<view class="form-content-box ">
<view v-for="(item,k) in formList" :key="k" class="sub-item-box">
<form>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>存货名称:</text>
</view>
<view class="text-blue">
<picker @change="onInventRecordChange($event,k)" :value="item.inventRecordIndex" :range="inventRecordList"
range-key="label">
<view class="uni-input form-item-label">
<text class="text-blue">{{item.inventRecordIndex>=0 ? inventRecordList[item.inventRecordIndex].label:'请选择存货名称'}}</text>
<text class="cuIcon-right text-blue"></text>
</view>
</picker>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>存货类型:</text>
</view>
<view class="">
<text>{{inventTypeBoxEnum[item.inventType]}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>规格:</text>
</view>
<view class="">
<text>{{item.invSpec || '-'}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>长度(MM):</text>
</view>
<view class="">
<text>{{Number(item.invLength) || 0}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>宽度(MM):</text>
</view>
<view class="">
<text>{{Number(item.invWidth) || 0}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>厚度(MM):</text>
</view>
<view class="">
<text>{{Number(item.invThick) || 0}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>数量:</text>
</view>
<view class="text-blue">
<u-input v-model="item.invQty" color="#0081ff" inputAlign="right" @change="onNumChange($event,k)" type="text" :border="border" placeholder="请输入数量" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>单重:</text>
</view>
<view class="">
<text>{{Number(item.invUnitWeight) || 0 }}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>总重:</text>
</view>
<view class="">
<text>{{Number(item.invWeight) || 0 }}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>单价:</text>
</view>
<view class="text-blue">
<u-input v-model="item.price" color="#0081ff" inputAlign="right" @change="onPriceChange($event,k)" type="text" :border="border" placeholder="请输入单价" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>总价:</text>
</view>
<view class="">
<text>{{Number(item.amount) || 0 }}</text>
</view>
</view>
</form>
</view>
</view>
<view class="" style="margin-bottom: 140upx;">
<button class="cu-btn bg-gradual-green" @tap="onAddSub">
<text class="cuIcon-add"></text>
<text>新增明细</text>
</button>
</view>
</view>
<view class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">提交</button>
......@@ -103,13 +223,17 @@
} from "@/api/product-warehousing.js";
import {
getList,
getProjComboBox,
updateInfo
updateInfo,
getInventInfo,
saveSubList
} from "@/api/picking.js";
export default {
data() {
return {
border:"none",
show: false,
show2: false,
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
......@@ -126,7 +250,14 @@
receiptDate: [],
list: [],
listEnum: {},
index: -1
index: -1,
formList:[],
inventRecordIndex:-1,
inventRecordList:[],
inventRecordEnum:[],
inventTypeBoxList:[],
inventTypeBoxEnum:{},
};
},
onLoad() {
......@@ -134,6 +265,62 @@
this.onLoading();
},
methods: {
onNumChange(e,i){
this.formList[i].invWeight = Number(e) * Number(this.formList[i].invUnitWeight);
},
onPriceChange(e,i){
this.formList[i].amount = Number(e) * Number(this.formList[i].invQty);
},
onAddSub(){
if(this.factoryIndex<0){
uni.showToast({
icon:"none",
title:"请先选择公司"
})
return
}
if(this.projectIndex<0){
uni.showToast({
icon:"none",
title:"请先选择仓库"
})
return
}
this.formList.push({
invQty: 0,
price: 0,
amount:0,
inventType:'',
invLength:'',
invWidth:'',
invThick:'',
invSpec:'',
inventRecordIndex:-1
})
},
onInventRecordChange(e,i){
let index = Number(e.target.value);
if (this.formList[i].inventRecordIndex === index) return
this.formList[i].inventRecordIndex = index;
let list = this.inventRecordList[index];
this.formList[i].inventType = list.param1Field;
this.formList[i].inventRecordId = list.param2Field;
this.formList[i].invSpec = list.param3Field;
this.formList[i].invLength = list.param4Field;
this.formList[i].invWidth = list.param5Field;
this.formList[i].invThick = list.param6Field;
this.formList[i].invQty = list.param7Field;
this.formList[i].invUnitWeight = list.param8Field;
this.formList[i].invWeight = list.param9Field;
this.formList[i].inventTypeDetail= list.param10Field !== 'null'? list.param10Field : '0';
this.formList[i].inventName =list.textField;
this.formList[i].inventCode =list.value
this.$forceUpdate();
},
onSubmit() {
this.show = true
},
......@@ -186,6 +373,9 @@
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
if(this.formList&&this.formList.length){
}
uni.showToast({
icon: "success",
title: "新增成功"
......@@ -196,12 +386,35 @@
}
})
},
onSubSave(i=0){
saveSubList({
...this.formList[i],
receiveId:this.id,
receiveType:0,
whCode:this.orderInfo.whCode,
companyCode:this.orderInfo.companyCode
}).then(res =>{
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon:"success",
title:"提交成功"
})
setTimeout(()=>{
this.onBack();
},1500)
}
})
},
onChange(e) {
let index = Number(e.target.value);
if (this.factoryIndex === index) return
this.factoryIndex = index;
this.index = -1;
this.onGetProjComboBox();
if(this.projectIndex>=0){
this.onGetInventInfo();
}
},
onListChange(e){
let index = Number(e.target.value);
......@@ -212,6 +425,7 @@
let index = Number(e.target.value);
if (this.projectIndex === index) return
this.projectIndex = index;
this.onGetInventInfo();
},
onBack() {
uni.redirectTo({
......@@ -234,6 +448,16 @@
})
},
onLoading() {
getList().then(res => {
this.inventTypeBoxList = toJsonData(res.data.__blocks__.invent_type_box_block_id.rows, res.data
.__blocks__.invent_type_box_block_id.meta.columns).map(item => {
this.inventTypeBoxEnum[item.valueField] = item.textField
return {
label: item.textField,
value: item.valueField
}
});
})
getParamsList().then(res => {
this.factoryList = res.data.map(item => {
this.factoryEnum[item.companyCode] = item.companyName
......@@ -254,6 +478,24 @@
}
});
})
},
onGetInventInfo(){
getInventInfo({
companyCode: this.factoryList[this.factoryIndex].value,
whCode: this.projectList[this.projectIndex].value,
}).then(res => {
this.inventRecordList = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data
.__blocks__.invent_code_box_block_id.meta.columns).map(item => {
this.inventRecordEnum[item.valueField] = `[${item.valueField}]${item.textField}[${item.param1Field}]`
return {
...item,
label: `[${item.valueField}]${item.textField}[${item.param1Field}]` ,
value: item.valueField,
name: item.textField
}
});
this.$forceUpdate();
})
}
}
}
......@@ -587,6 +829,11 @@
}
.content-part-2 {
.header{
display: flex;
justify-content: space-between;
align-items: center;
}
.form-content-box {
display: flex;
background-color: transparent;
......
......@@ -64,8 +64,6 @@
<view class="form-content-box margin-bottom">
<view class="sub-item-box">
<form>
<view class="cu-form-group">
<view class="title">
<text v-if="orderInfo.status=='0'" class="text-xl text-red">*</text>
......
......@@ -114,6 +114,18 @@
v-model="orderInfo.finishQuantity"
></u--input>
</view>
<view class="flex-col">
<view class="margin-sm">
<text class="text-black text-title text-lg">图片上传:</text>
</view>
<view class="">
<u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="6"></u-upload>
</view>
</view>
</view>
</view>
<view class="flex-col content-part-1">
......@@ -132,6 +144,11 @@
<script>
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {uploadFile2} from "@/api/index.js";
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
......@@ -148,7 +165,8 @@
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: "",
queryData: {},
minDate: moment().subtract(1,'M').format("YYYY-MM-DD")
minDate: moment().subtract(1,'M').format("YYYY-MM-DD"),
fileList: [],
};
},
onLoad() {
......@@ -162,6 +180,36 @@
})
},
methods: {
// 删除图片
deletePic(event) {
this.fileList.splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file);
let fileListLen = this.fileList.length;
lists.map((item) => {
this.fileList.push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await uploadFile2({
url: lists[i].url
})
let item = this.fileList[fileListLen]
this.fileList.splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: lists[i].url,
id: JSON.parse(result.data).id
}))
fileListLen++
}
},
onBack() {
uni.redirectTo({
url:"/pages/product-order/list"
......
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">选择合同</text>
</block>
<block slot="right">
<text class="text-green text-bold text-lg margin-right" @tap="onCheck">确 定</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col data-content" >
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item" @tap="onSelect(k)">
<view class="flex-col content-box" :class="k === current?'active':''">
<view class="flex-row">
<text class="text-gray part-1">甲方名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.partyA}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">主合同名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.contractName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">合同类型</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{contractTypeEnum[item.contractType]}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">主合同号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.contractNumber}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">项目编号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.projCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">乙方名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.partyB}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {toJsonData} from "@/utils/tools.js";
import { getProList } from "@/api/settlement-doc.js";
import {getDict} from "@/api/index.js"
export default {
data() {
return {
projectDataList:[],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
queryData: {},
pageData:{
showCount: "true",
limit:5,
offset:0
},
current:0,
eventChannel: null,
contractTypeEnum:{}
};
},
onLoad(option) {
this.eventChannel = this.getOpenerEventChannel();
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
this.onGetList();
}
},
methods: {
onCheck(){
this.eventChannel.emit('acceptDataFromOpenedPage', {
...this.projectDataList[this.current],
totalContractPrice: this.projectDataList[this.current].totalContractPriceExcluding
} );
this.onBack();
},
onSelect(k){
this.current = k;
},
onBack(){
uni.navigateBack();
},
onLoading() {
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
})
}
})
this.onGetList();
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getProList({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns)
if (this.pageData.offset == 0) {
this.projectDataList = list
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
if (this.projectDataList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
}
}
}
</script>
<style>
page {
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.page-content-box{
width: 100vw;
height: 100vh;
overflow: hidden;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 96%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 30upx auto;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 40upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row{
margin: 6upx 0;
.part-1{
width: 140upx;
text-align-last: justify;
}
.part-2{
margin-right: 24upx;
}
}
}
.active{
box-shadow: 0 0 12upx #4a93f8;
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.float-box{
position: fixed;
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border-radius: 25px;
background-color: #4a93f8;
color: #ffffff;
box-shadow: 0 0 16upx rgba(74, 147, 248, 0.34),0 0 12upx rgba(74, 147, 248, 0.34) inset;
z-index: 99;
font-size: 32upx;
}
.factory-name{
max-width: 360upx;
.factory-title{
// width: 360upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.ellipsis{
max-width: 420upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
\ No newline at end of file
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