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 @@ ...@@ -510,6 +510,83 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh" : false "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": { "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>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">扣款单</text>
</view>
<view class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>项目编号:</text>
</view>
<view class="text-blue" @tap="onNavToSelect">
<text>{{orderInfo.projCode|| "请选择项目"}}</text>
<text class="cuIcon-list"></text>
</view>
</view>
<view v-if="orderInfo.projName" class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>项目名称:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.projName}}</text>
</view>
</view>
<view v-if="orderInfo.contractName" class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>合同名称:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.contractName}}</text>
</view>
</view>
<view v-if="orderInfo.contractNumber" class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>合同编号:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.contractNumber}}</text>
</view>
</view>
<view v-if="orderInfo.partyA" class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>甲方名称:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.partyA}}</text>
</view>
</view>
<view v-if="orderInfo.partyB" class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>乙方名称:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.partyB}}</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="orderInfo.contractContent" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入扣款事由" />
</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="orderInfo.totalContractPriceIncluding" color="#0081ff" inputAlign="right"
type="text" :border="border" placeholder="请输入扣款金额" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>扣款日期:</text>
</view>
<view class="text-blue" @tap="onOpenCalendar">
<text>{{orderInfo.signingDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
</view>
</view>
</form>
</view>
</view>
<view class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">提交</button>
</view>
<u-calendar :show="show2" mode="single" :defaultDate="orderInfo.signingDate" :minDate="minDate" :monthNum='4'
@confirm="onConfirm" @close="onCancel"></u-calendar>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
save
} from "@/api/debit-note.js";
export default {
data() {
return {
border: 'none',
show: false,
show2: false,
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行新增扣款单?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: {
reviewStatus:'3',
signingDate: moment().format("YYYY-MM-DD")
},
};
},
methods: {
onNavToSelect(){
let that = this;
uni.navigateTo({
url:"/pages/debit-note/index",
events:{
acceptDataFromOpenedPage: (data) => {
console.log(data)
that.orderInfo = {
...that.orderInfo,
...data
}
console.log(that.orderInfo,9999)
that.$forceUpdate();
}
}
})
},
onSubmit() {
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onConfirm(e) {
this.orderInfo.signingDate = e[0];
this.onCancel();
},
onSave() {
this.show = false;
if (!this.orderInfo.projCode) {
uni.showToast({
icon: "none",
title: "请选择项目"
})
return
}
if (!this.orderInfo.contractContent) {
uni.showToast({
icon: "none",
title: "请输入扣款事由"
})
return
}
if (!this.orderInfo.totalContractPriceIncluding) {
uni.showToast({
icon: "none",
title: "请输入扣款金额"
})
return
}
uni.showLoading({
title: "加载中..."
})
save({
...this.orderInfo,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD")
}).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;
},
onProjectChange(e) {
let index = Number(e.target.value);
if (this.projectIndex === index) return
this.projectIndex = index;
},
onBack() {
uni.redirectTo({
url: "/pages/debit-note/list"
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
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: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
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: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
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-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.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 {
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
.text-blue {
white-space: normal;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
.form-content-box:last-child {
margin-bottom: 120upx;
}
}
.sub-item-box {
display: flex;
flex-direction: column;
width: 94%;
margin: 0 auto 8upx;
padding-bottom: 24upx;
.item-form {
position: relative;
z-index: 2;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 0 6upx rgba(0, 0, 0, 0.34);
margin-top: -20upx;
padding: 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;
}
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<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>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="form-content-box margin-bottom">
<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="">
<text>{{orderInfo.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>主合同名称:</text>
</view>
<view class="">
<text>{{orderInfo.contractName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>主合同号:</text>
</view>
<view class="">
<text>{{orderInfo.contractNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>项目编号:</text>
</view>
<view class="">
<text>{{orderInfo.projCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>甲方名称:</text>
</view>
<view class="">
<text>{{orderInfo.partyA}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>乙方名称:</text>
</view>
<view class="">
<text>{{orderInfo.partyB}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>扣款事由:</text>
</view>
<view class="">
<text>{{orderInfo.contractContent}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>扣款金额:</text>
</view>
<view class="">
<text>{{orderInfo.totalContractPriceIncluding}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text v-if="orderInfo.reviewStatus !=3" class="text-xl text-red">*</text>
<text>扣款日期:</text>
</view>
<view v-if="orderInfo.reviewStatus ==3" class="">
<text>{{orderInfo.totalContractPriceIncluding}}</text>
</view>
<view v-else class="text-blue" @tap="onOpenCalendar">
<text>{{orderInfo.signingDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>审批状态:</text>
</view>
<view class="">
<text>{{submitStatusEnum[orderInfo.reviewStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view v-if="orderInfo.reviewStatus && orderInfo.reviewStatus!=3" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit(1)">提交</button>
</view>
<u-calendar :show="show2" mode="single" :defaultDate="orderInfo.signingDate" :minDate="minDate" :monthNum='4'
@confirm="onConfirm" @close="onCancel"></u-calendar>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getParamsData
} from "@/api/product-warehousing.js";
import {
getList,
updateSubmitStatus
} from "@/api/debit-note.js";
export default {
data() {
return {
border: 'none',
show: false,
show2: false,
titleText: '添加',
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行审核操作?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: {},
id: '',
submitStatusEnum:{
3:'已提交',
1:'已提交',
0:"待审核"
}
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.subId = option.subId || ''
this.titleText = option.subId ? '编辑' : '添加'
}
this.onLoading();
},
methods: {
onSubmit(t) {
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onConfirm(e) {
this.orderInfo.signingDate = e[0];
this.onCancel();
},
onSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
updateSubmitStatus({
...this.orderInfo,
reviewStatus:3,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD")
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "提交成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
}
})
},
onBack() {
uni.redirectTo({
url:'/pages/debit-note/list'
})
},
onLoading() {
this.onGetList();
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
id: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.orderInfo = {
...list[0],
signingDate: moment(list[0].signingDate).format("YYYY-MM-DD")
}
}
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
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: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
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: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
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-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.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: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
padding: 1px 10px 1px 30upx;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
}
.sub-item-box {
width: 92%;
padding: 20upx;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34);
margin-bottom: 120upx;
}
.form-item-label {
display: flex;
flex-direction: row;
align-items: center;
.text-blue {
white-space: normal;
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<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
<template>
<view :class="floatBoxStatus? 'page-content-box':'' ">
<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">
<view class="margin-right" @tap="onNavToAdd">
<text class="text-white">录入</text>
</view>
</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-row header-title">
<picker mode="selector" :range="factoryList" v-model="factoryIndex" range-key="label" @change="onFactoryChange">
<view class="flex-row-center factory-name">
<text class="factory-title">{{factoryList.length? factoryList[factoryIndex].label:'厂别'}}</text>
<text class="cuIcon-unfold text-sm"></text>
</view>
</picker>
<view class="flex-1 margin-left-sm">
<u--input placeholder="请输入项目名称" v-model="queryData.projName" suffixIcon="search"
suffixIconStyle="color: #909399" :customStyle="{padding:'3px 6px'}" :fontSize="13" confirmType="search" @blur="onSearchByName"></u--input>
</view>
</view>
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item">
<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 ellipsis">{{item.projName}}</text>
<view class="margin-right text-blue">
<text class="">详情</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">公司名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.companyName}}</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.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.partyB}}</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.contractContent}}</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.totalContractPriceIncluding}}</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.signingDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">审批状态</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{submitStatusEnum[item.reviewStatus]}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="projectDataList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
</view>
</template>
<script>
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import { getParamsList } from "@/api/product-warehousing.js";
import { getList } from "@/api/debit-note.js";
export default {
data() {
return {
projectDataList:[],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
showText: false,
target: 60,
modelVale: 100,
value: 0,
title: '生产领料',
eChartData: [],
current:0,
formData: {},
//不良品类
form: {},
factoryIndex:0,
factoryList:[
{
value:"",
label:"全部"
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp:0,
endTimeStamp:0,
factoryEnum:{},
queryData: {},
pageData:{
showCount: "true",
limit:5,
offset:0
},
submitStatusEnum:{
3:'已提交',
1:'已提交',
0:"待审核"
},
};
},
onLoad(option) {
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
this.onGetList();
}
},
methods: {
onNavToAdd(){
uni.navigateTo({
url:"/pages/debit-note/add"
})
},
onFactoryChange(e){
this.factoryIndex = e.target.value;
this.pageData.offset = 0;
this.onGetList();
},
onBack(){
uni.redirectTo({
url:"/"
})
},
onLoading() {
getParamsList().then(res=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
...this.queryData,
companyCode:this.factoryList[this.factoryIndex].value
},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'
}
})
},
onChange(e) {
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetList();
},
onChangeTab(e) {
this.current = e.index;
this.pageData.offset = 0;
this.onGetList();
},
onNavToOrderInfo(val){
uni.navigateTo({
url:`/pages/debit-note/edit?id=${val.id}`
})
}
}
}
</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: 0 auto 30upx;
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: 120upx;
.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;
}
}
}
}
.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 @@ ...@@ -81,6 +81,126 @@
</form> </form>
</view> </view>
</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"> <view class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">提交</button> <button class="cu-btn block bg-blue" @tap="onSubmit">提交</button>
...@@ -103,13 +223,17 @@ ...@@ -103,13 +223,17 @@
} from "@/api/product-warehousing.js"; } from "@/api/product-warehousing.js";
import { import {
getList,
getProjComboBox, getProjComboBox,
updateInfo updateInfo,
getInventInfo,
saveSubList
} from "@/api/picking.js"; } from "@/api/picking.js";
export default { export default {
data() { data() {
return { return {
border:"none",
show: false, show: false,
show2: false, show2: false,
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"), minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
...@@ -126,7 +250,14 @@ ...@@ -126,7 +250,14 @@
receiptDate: [], receiptDate: [],
list: [], list: [],
listEnum: {}, listEnum: {},
index: -1 index: -1,
formList:[],
inventRecordIndex:-1,
inventRecordList:[],
inventRecordEnum:[],
inventTypeBoxList:[],
inventTypeBoxEnum:{},
}; };
}, },
onLoad() { onLoad() {
...@@ -134,6 +265,62 @@ ...@@ -134,6 +265,62 @@
this.onLoading(); this.onLoading();
}, },
methods: { 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() { onSubmit() {
this.show = true this.show = true
}, },
...@@ -186,6 +373,9 @@ ...@@ -186,6 +373,9 @@
}).then(res => { }).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
if(this.formList&&this.formList.length){
}
uni.showToast({ uni.showToast({
icon: "success", icon: "success",
title: "新增成功" title: "新增成功"
...@@ -196,12 +386,35 @@ ...@@ -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) { onChange(e) {
let index = Number(e.target.value); let index = Number(e.target.value);
if (this.factoryIndex === index) return if (this.factoryIndex === index) return
this.factoryIndex = index; this.factoryIndex = index;
this.index = -1; this.index = -1;
this.onGetProjComboBox(); this.onGetProjComboBox();
if(this.projectIndex>=0){
this.onGetInventInfo();
}
}, },
onListChange(e){ onListChange(e){
let index = Number(e.target.value); let index = Number(e.target.value);
...@@ -212,6 +425,7 @@ ...@@ -212,6 +425,7 @@
let index = Number(e.target.value); let index = Number(e.target.value);
if (this.projectIndex === index) return if (this.projectIndex === index) return
this.projectIndex = index; this.projectIndex = index;
this.onGetInventInfo();
}, },
onBack() { onBack() {
uni.redirectTo({ uni.redirectTo({
...@@ -234,6 +448,16 @@ ...@@ -234,6 +448,16 @@
}) })
}, },
onLoading() { 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 => { getParamsList().then(res => {
this.factoryList = res.data.map(item => { this.factoryList = res.data.map(item => {
this.factoryEnum[item.companyCode] = item.companyName this.factoryEnum[item.companyCode] = item.companyName
...@@ -254,6 +478,24 @@ ...@@ -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 @@ ...@@ -587,6 +829,11 @@
} }
.content-part-2 { .content-part-2 {
.header{
display: flex;
justify-content: space-between;
align-items: center;
}
.form-content-box { .form-content-box {
display: flex; display: flex;
background-color: transparent; background-color: transparent;
......
...@@ -64,8 +64,6 @@ ...@@ -64,8 +64,6 @@
<view class="form-content-box margin-bottom"> <view class="form-content-box margin-bottom">
<view class="sub-item-box"> <view class="sub-item-box">
<form> <form>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text v-if="orderInfo.status=='0'" class="text-xl text-red">*</text> <text v-if="orderInfo.status=='0'" class="text-xl text-red">*</text>
......
...@@ -114,6 +114,18 @@ ...@@ -114,6 +114,18 @@
v-model="orderInfo.finishQuantity" v-model="orderInfo.finishQuantity"
></u--input> ></u--input>
</view> </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> </view>
<view class="flex-col content-part-1"> <view class="flex-col content-part-1">
...@@ -132,6 +144,11 @@ ...@@ -132,6 +144,11 @@
<script> <script>
import { import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {uploadFile2} from "@/api/index.js";
import {
toJsonData toJsonData
} from "@/utils/tools.js"; } from "@/utils/tools.js";
import moment from "@/common/moment.js"; import moment from "@/common/moment.js";
...@@ -148,7 +165,8 @@ ...@@ -148,7 +165,8 @@
statusBarHeight: uni.getStorageSync("statusHeight") || 0, statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: "", orderInfo: "",
queryData: {}, queryData: {},
minDate: moment().subtract(1,'M').format("YYYY-MM-DD") minDate: moment().subtract(1,'M').format("YYYY-MM-DD"),
fileList: [],
}; };
}, },
onLoad() { onLoad() {
...@@ -162,6 +180,36 @@ ...@@ -162,6 +180,36 @@
}) })
}, },
methods: { 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() { onBack() {
uni.redirectTo({ uni.redirectTo({
url:"/pages/product-order/list" 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>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">结算单</text>
</view>
<view class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>项目名称:</text>
</view>
<view class="text-blue" @tap="onNavToSelect">
<text>{{orderInfo.projName|| "请选择项目"}}</text>
<text class="cuIcon-list"></text>
</view>
</view>
<view v-if="orderInfo.projCode" class="cu-form-group">
<view class="title">
<text>项目编号:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.projCode}}</text>
</view>
</view>
<view v-if="orderInfo.contractName" class="cu-form-group">
<view class="title">
<text>合同名称:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.contractName}}</text>
</view>
</view>
<view v-if="orderInfo.contractNumber" class="cu-form-group">
<view class="title">
<text>合同编号:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.contractNumber}}</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" >
<text>{{orderInfo.settlementNumber}}</text>
</view>
</view> -->
<view v-if="orderInfo.thisSettlementAmount" class="cu-form-group">
<view class="title">
<text>结算金额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.thisSettlementAmount}}</text>
</view>
</view>
<view v-if="orderInfo.thisPriceTax" class="cu-form-group">
<view class="title">
<text>含税金额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.thisPriceTax}}</text>
</view>
</view>
<view v-if="orderInfo.thisSettlementTax" class="cu-form-group">
<view class="title">
<text>结算税额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.thisSettlementTax}}</text>
</view>
</view>
<view v-if="orderInfo.totalContractPrice" class="cu-form-group">
<view class="title">
<text>合同金额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.totalContractPrice}}</text>
</view>
</view>
<view v-if="orderInfo.cumulativeSettlementAmount" class="cu-form-group">
<view class="title">
<text>累计结算金额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.cumulativeSettlementAmount}}</text>
</view>
</view>
<view v-if="orderInfo.cumulativeSettlementTax" class="cu-form-group">
<view class="title">
<text>累计结算税额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.cumulativeSettlementTax}}</text>
</view>
</view>
<view v-if="orderInfo.cumulativePriceTax" class="cu-form-group">
<view class="title">
<text>累计结算含税金额:</text>
</view>
<view class="text-blue" >
<text>{{orderInfo.cumulativePriceTax}}</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">
<picker @change="onTypeChange" :value="settlementCategoryIndex" :range="settlementCategoryList"
range-key="label">
<view class="uni-input">
<text
class="text-blue">{{ settlementCategoryIndex >=0 ? settlementCategoryList[settlementCategoryIndex].label:'请选择'}}</text>
<text class="cuIcon-right"></text>
</view>
</picker>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>结算日期:</text>
</view>
<view class="text-blue" @tap="onOpenCalendar">
<text>{{orderInfo.contractDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
</view>
</view>
</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 v-if="orderInfo.projCode" class="flex-row">
<button class="cu-btn bg-green sm">选择合同</button>
<button v-if="['1','2'].includes(orderInfo.contractType)" class="cu-btn bg-green sm">选择签证单</button>
<button v-if="orderInfo.contractType == '2'" class="cu-btn bg-green sm">选择扣款单</button>
</view>
</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>结算依据:</text>
</view>
<view class="">
<u-input v-model="item.settlementBasis" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入结算依据" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>任务名称:</text>
</view>
<view class="">
<u-input v-model="item.taskName" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入任务名称" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>工程内容:</text>
</view>
<view class="">
<u-input v-model="item.engineeringContent" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入工程内容" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结算工程量:</text>
</view>
<view class="">
<u-input v-model="item.thisEngineeringQuantity" @change="onPriceChange($event,k)" color="#0081ff" inputAlign="right" type="number" :border="border" placeholder="请输入工程量" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>累计结算工程量:</text>
</view>
<view class="">
<u-input v-model="item.cumulativeEngineeringQuantity" :disabled="true" color="#0081ff" inputAlign="right" type="number" :border="border" placeholder="请输入工程量" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>单位:</text>
</view>
<view class="">
<u-input v-model="item.unit" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入单位" />
</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.unitPrice" color="#0081ff" inputAlign="right" @change="onPriceChange2($event,k)" type="number" :border="border" placeholder="请输入单价" />
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>合价:</text>
</view>
<view class="text-blue">
<text>{{item.totalPrice || 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.remarks" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入备注" />
</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>
</view>
<u-calendar :show="show2" mode="single" :defaultDate="orderInfo.signingDate" :minDate="minDate" :monthNum='4'
@confirm="onConfirm" @close="onCancel"></u-calendar>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
save
} from "@/api/settlement-doc.js";
export default {
data() {
return {
border: 'none',
show: false,
show2: false,
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行新增扣款单?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: {
reviewStatus:'3',
contractDate: moment().format("YYYY-MM-DD")
},
formList:[],
settlementCategoryList:[
{
value:1,
label: '过程结算'
},
{
value:1,
label: '最终结算'
}
],
settlementCategoryIndex:-1
};
},
methods: {
onTypeChange(e){
let index = Number(e.target.value);
if (this.settlementCategoryIndex === index) return
this.settlementCategoryIndex = index;
},
onPriceChange(e,i){
console.log(e,i,"1")
},
onPriceChange2(e,i){
console.log(e,i,'2')
},
onAddSub(){
if(!this.orderInfo.projCode){
uni.showToast({
icon:"none",
title:"请先选择项目合同"
})
return
}
this.formList.push({
settlementBasis: '',//结算依据
taskName:'', //任务名称
engineeringContent:'',//工程内容
thisEngineeringQuantity:'',//工程结算量
cumulativeEngineeringQuantity:'',//至本次累计结算工程量
unit:'',//单位
unitPrice:'',//单价
totalPrice:"" //合计
})
},
onNavToSelect(){
let that = this;
uni.navigateTo({
url:"/pages/settlement-doc/index",
events:{
acceptDataFromOpenedPage: (data) => {
console.log(data)
that.orderInfo = {
...that.orderInfo,
...data
}
console.log(that.orderInfo,9999)
that.$forceUpdate();
}
}
})
},
onSubmit() {
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onConfirm(e) {
this.orderInfo.contractDate = e[0];
this.onCancel();
},
onSave() {
this.show = false;
if (!this.orderInfo.projCode) {
uni.showToast({
icon: "none",
title: "请选择项目"
})
return
}
if (!this.orderInfo.contractContent) {
uni.showToast({
icon: "none",
title: "请输入扣款事由"
})
return
}
if (!this.orderInfo.totalContractPriceIncluding) {
uni.showToast({
icon: "none",
title: "请输入扣款金额"
})
return
}
uni.showLoading({
title: "加载中..."
})
save({
...this.orderInfo,
contractDate: moment(this.orderInfo.contractDate).format("YYYYMMDD")
}).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;
},
onProjectChange(e) {
let index = Number(e.target.value);
if (this.projectIndex === index) return
this.projectIndex = index;
},
onBack() {
uni.redirectTo({
url: "/pages/settlement-doc/list"
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
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: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
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: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
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-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.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 {
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 280upx;
align-items: center;
}
.text-blue {
white-space: normal;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.header{
display: flex;
justify-content: space-between;
align-items: center;
.flex-row{
.cu-btn{
margin: 0 6upx;
}
}
}
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
.form-content-box:last-child {
margin-bottom: 120upx;
}
}
.sub-item-box {
display: flex;
flex-direction: column;
width: 94%;
margin: 0 auto 8upx;
padding-bottom: 24upx;
.item-form {
position: relative;
z-index: 2;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 0 6upx rgba(0, 0, 0, 0.34);
margin-top: -20upx;
padding: 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;
}
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<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>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="form-content-box margin-bottom">
<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="">
<text>{{orderInfo.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>主合同名称:</text>
</view>
<view class="">
<text>{{orderInfo.contractName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>主合同号:</text>
</view>
<view class="">
<text>{{orderInfo.contractNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>项目编号:</text>
</view>
<view class="">
<text>{{orderInfo.projCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>甲方名称:</text>
</view>
<view class="">
<text>{{orderInfo.partyA}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>乙方名称:</text>
</view>
<view class="">
<text>{{orderInfo.partyB}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>扣款事由:</text>
</view>
<view class="">
<text>{{orderInfo.contractContent}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>扣款金额:</text>
</view>
<view class="">
<text>{{orderInfo.totalContractPriceIncluding}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text v-if="orderInfo.reviewStatus !=3" class="text-xl text-red">*</text>
<text>扣款日期:</text>
</view>
<view v-if="orderInfo.reviewStatus ==3" class="">
<text>{{orderInfo.totalContractPriceIncluding}}</text>
</view>
<view v-else class="text-blue" @tap="onOpenCalendar">
<text>{{orderInfo.signingDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>审批状态:</text>
</view>
<view class="">
<text>{{submitStatusEnum[orderInfo.reviewStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view v-if="orderInfo.reviewStatus && orderInfo.reviewStatus!=3" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit(1)">提交</button>
</view>
<u-calendar :show="show2" mode="single" :defaultDate="orderInfo.signingDate" :minDate="minDate" :monthNum='4'
@confirm="onConfirm" @close="onCancel"></u-calendar>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getParamsData
} from "@/api/product-warehousing.js";
import {
getList,
updateSubmitStatus
} from "@/api/debit-note.js";
export default {
data() {
return {
border: 'none',
show: false,
show2: false,
titleText: '添加',
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行审核操作?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: {},
id: '',
submitStatusEnum:{
3:'已提交',
1:'已提交',
0:"待审核"
}
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.subId = option.subId || ''
this.titleText = option.subId ? '编辑' : '添加'
}
this.onLoading();
},
methods: {
onSubmit(t) {
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onConfirm(e) {
this.orderInfo.signingDate = e[0];
this.onCancel();
},
onSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
updateSubmitStatus({
...this.orderInfo,
reviewStatus:3,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD")
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "提交成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
}
})
},
onBack() {
uni.redirectTo({
url:'/pages/debit-note/list'
})
},
onLoading() {
this.onGetList();
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
id: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.orderInfo = {
...list[0],
signingDate: moment(list[0].signingDate).format("YYYY-MM-DD")
}
}
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
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: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
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: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
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-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.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: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
padding: 1px 10px 1px 30upx;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
}
.sub-item-box {
width: 92%;
padding: 20upx;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34);
margin-bottom: 120upx;
}
.form-item-label {
display: flex;
flex-direction: row;
align-items: center;
.text-blue {
white-space: normal;
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<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
<template>
<view :class="floatBoxStatus? 'page-content-box':'' ">
<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">
<view class="margin-right" @tap="onNavToAdd">
<text class="text-white">录入</text>
</view>
</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-row header-title">
<picker mode="selector" :range="factoryList" v-model="factoryIndex" range-key="label" @change="onFactoryChange">
<view class="flex-row-center factory-name">
<text class="factory-title">{{factoryList.length? factoryList[factoryIndex].label:'厂别'}}</text>
<text class="cuIcon-unfold text-sm"></text>
</view>
</picker>
<view class="flex-1 margin-left-sm">
<u--input placeholder="请输入项目名称" v-model="queryData.projName" suffixIcon="search"
suffixIconStyle="color: #909399" :customStyle="{padding:'3px 6px'}" :fontSize="13" confirmType="search" @blur="onSearchByName"></u--input>
</view>
</view>
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item">
<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 ellipsis">{{item.projName}}</text>
<view class="margin-right text-blue">
<text class="">详情</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">公司名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.companyName}}</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.settlementNumber}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">结算类别</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{settlementTypeEnum[item.settlementType]}}</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.thisSettlementAmount}}</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.thisSettlementTax}}</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.thisPriceTax}}</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.contractDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">审批状态</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{submitStatusEnum[item.reviewStatus]}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="projectDataList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
</view>
</template>
<script>
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import { getParamsList } from "@/api/product-warehousing.js";
import { getList } from "@/api/settlement-doc.js";
export default {
data() {
return {
projectDataList:[],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
showText: false,
target: 60,
modelVale: 100,
value: 0,
title: '生产领料',
eChartData: [],
current:0,
formData: {},
//不良品类
form: {},
factoryIndex:0,
factoryList:[
{
value:"",
label:"全部"
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp:0,
endTimeStamp:0,
factoryEnum:{},
queryData: {},
pageData:{
showCount: "true",
limit:5,
offset:0
},
submitStatusEnum:{
3:'已提交',
2:'未提交',
0:"待审核"
},
settlementTypeEnum:{
1:'部分结算',
2:'最终结算'
}
};
},
onLoad(option) {
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
this.onGetList();
}
},
methods: {
onNavToAdd(){
uni.navigateTo({
url:"/pages/settlement-doc/add"
})
},
onFactoryChange(e){
this.factoryIndex = e.target.value;
this.pageData.offset = 0;
this.onGetList();
},
onBack(){
uni.redirectTo({
url:"/"
})
},
onLoading() {
getParamsList().then(res=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
...this.queryData,
companyCode:this.factoryList[this.factoryIndex].value
},this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns)
if(list && list.length){
list = list.map(item=>{
return {
...item,
contractDate:item.contractDate? moment(item.contractDate).format("YYYY-MM-DD"):''
}
})
}
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'
}
})
},
onChange(e) {
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetList();
},
onChangeTab(e) {
this.current = e.index;
this.pageData.offset = 0;
this.onGetList();
},
onNavToOrderInfo(val){
uni.navigateTo({
url:`/pages/debit-note/edit?id=${val.id}`
})
}
}
}
</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: 0 auto 30upx;
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: 120upx;
.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;
}
}
}
}
.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