4月26日提交

master
rosehan 2 years ago
parent 050608f21b
commit 97d036401c
  1. 1
      api/traceability/company.js
  2. 3
      pages/mine/index.vue
  3. 42
      static/scss/v-layout.scss
  4. 47
      sunPages/mine/base/index.vue
  5. 53
      sunPages/mine/business/index.vue
  6. 1
      sunPages/traceability-product/loss/lossEdit.vue
  7. 14
      sunPages/traceability-product/machining/index.vue
  8. 1
      sunPages/traceability-product/machining/materialsList.vue
  9. 1
      sunPages/traceability-product/sales/salesEdit.vue

@ -12,6 +12,7 @@ export function getCompanyPage(params) {
// 更新企业信息 // 更新企业信息
export function updateCompany(data) { export function updateCompany(data) {
return request({ return request({
url: '/traceability/company/update', url: '/traceability/company/update',
method: 'put', method: 'put',

@ -97,7 +97,6 @@
this.$tab.navigateTo('/sunPages/mine/info/edit') this.$tab.navigateTo('/sunPages/mine/info/edit')
}, },
handleToSetting() { handleToSetting() {
console.log('32')
this.$tab.navigateTo('/sunPages/mine/setting/index') this.$tab.navigateTo('/sunPages/mine/setting/index')
}, },
handleToLogin() { handleToLogin() {
@ -235,4 +234,4 @@
} }
} }
} }
</style> </style>

@ -299,7 +299,7 @@ $v-muted: #dddddd;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.v-materials-list-box { .v-materials-list-box {
background-color: rgba(0, 0, 0, 0.02); background-color: rgba(0, 0, 0, 0.02);
padding: 20rpx; padding: 20rpx 20rpx 10rpx 20rpx;
text-align: left; text-align: left;
.v-materials-name { .v-materials-name {
font-size: 32rpx; font-size: 32rpx;
@ -541,7 +541,6 @@ $v-muted: #dddddd;
.v-form { .v-form {
.v-form-item { .v-form-item {
position: relative; position: relative;
padding: 4rpx 40rpx 4rpx 40rpx; padding: 4rpx 40rpx 4rpx 40rpx;
margin: 20rpx 0; margin: 20rpx 0;
@ -556,24 +555,15 @@ $v-muted: #dddddd;
} }
} }
} }
.label-120{ .label-120 {
.uni-forms-item__label{width: 240rpx; } .uni-forms-item__label {
width: 240rpx;
}
} }
.uni-forms-item__label { .uni-forms-item__label {
font-size: 28rpx; font-size: 28rpx;
} }
.total-input {
border: 1px solid #ccc;
margin-left: 10rpx;
align-items: center;
padding: 0 10rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 40rpx;
input {
line-height: 58rpx;
}
}
.uni-forms-item__content { .uni-forms-item__content {
position: relative; position: relative;
text-align: right; text-align: right;
@ -623,6 +613,26 @@ $v-muted: #dddddd;
padding-right: 0; padding-right: 0;
} }
} }
.no-right {
.uni-forms-item__content {
padding-right: 0;
.total-input {
align-items: center;
padding: 0 10rpx;
border: 1px solid #ccc;
border-radius: 40rpx;
}
.unit{font-size: 24rpx;}
input {
margin-left: 10rpx;
height: 60rpx;
line-height: 54rpx !important;
}
}
}
.uni-forms-item__error { .uni-forms-item__error {
width: 100%; width: 100%;
padding: 0 40rpx 0 0; padding: 0 40rpx 0 0;

@ -37,10 +37,10 @@
<input v-model="formData.baseAddress" placeholder="请输入基地地址" class="m-form-small" /> <input v-model="formData.baseAddress" placeholder="请输入基地地址" class="m-form-small" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="基地面积(亩)" name="baseArea":label-width="120"> <uni-forms-item label="基地面积(亩)" name="baseArea":label-width="120">
<input v-model="formData.baseArea" placeholder="请输入联系电话" class="m-form-small" /> <input v-model="formData.baseArea" placeholder="请输入基地面积" class="m-form-small" type="digit" @blur="handlerInput($event,index)" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="负责人" name="baseLeader"> <uni-forms-item label="负责人" name="baseLeader">
<input v-model="formData.baseLeader" placeholder="请输入联系电话" class="m-form-small" /> <input v-model="formData.baseLeader" placeholder="请输入负责人" class="m-form-small" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="联系电话" name="basePhone"> <uni-forms-item label="联系电话" name="basePhone">
<input v-model="formData.basePhone" placeholder="请输入联系电话" type="digit" class="m-form-small" /> <input v-model="formData.basePhone" placeholder="请输入联系电话" type="digit" class="m-form-small" />
@ -199,10 +199,9 @@
try { try {
await this.getCompany() await this.getCompany()
await this.getAddressList() await this.getAddressList()
const res = await BaseApi.getBase(this.baseId) const res = await BaseApi.getBase(this.baseId)
this.formData = res.data this.formData = res.data
console.log('lai',this.formData)
// //
this.CompanyList.map((item, index, arr) => { this.CompanyList.map((item, index, arr) => {
@ -230,8 +229,11 @@
this.LocalData.provinceCode = this.formData.province this.LocalData.provinceCode = this.formData.province
this.LocalData.cityCode = this.formData.city this.LocalData.cityCode = this.formData.city
this.LocalData.areaCode = this.formData.district this.LocalData.areaCode = this.formData.district
this.imgList[0]=this.formData.baseImage if(this.formData.baseImage==""){
this.imgList=[]
}else{
this.imgList[0]=this.formData.baseImage
}
} finally {} } finally {}
}, },
@ -242,22 +244,18 @@
try { try {
const that = this const that = this
await this.$refs['formRef'].validate() await this.$refs['formRef'].validate()
const data = this.formData const data = this.formData
await BaseApi.updateBase(data) await BaseApi.updateBase(data)
console.log(this.formData) await this.$store.dispatch('changeBaseName',that.formData.baseName)
await this.$store.dispatch('changeBaseLeader',that.formData.baseLeader)
uni.showToast({ uni.showToast({
title: `保存成功`, title: `保存成功`,
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
complete: function() { complete: function() {
setTimeout(function() { uni.redirectTo({
that.$store.dispatch('changeBaseName',that.formData.baseName) url: '/pages/mine/index'
that.$store.dispatch('changeBaseLeader',that.formData.baseLeader) });
uni.redirectTo({
url: '/pages/mine/index'
});
}, 2000);
} }
}) })
} catch (err) { } catch (err) {
@ -317,12 +315,27 @@
} }
}, },
ceshiImgDelete(e, num) { ceshiImgDelete(e, num) {
this.imgList=[]
this.formData.baseImage=""
console.log('ceshiImgDelete', e); console.log('ceshiImgDelete', e);
}, },
ceshiUploadFail(err) { ceshiUploadFail(err) {
// //
console.log('err', err); console.log('err', err);
}, },
//
handlerInput(event, index) {
this.$nextTick(() => {
const num = parseFloat(event.target.value).toFixed(2)
if (isNaN(num)) {
this.formData.productLoss = undefined
} else {
this.formData.productLoss = num
}
this.$forceUpdate()
})
},
} }
} }
</script> </script>

@ -16,7 +16,7 @@
<input v-model="formData.companyPhone" placeholder="请输入联系电话" class="m-form-small" /> <input v-model="formData.companyPhone" placeholder="请输入联系电话" class="m-form-small" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="主体类型" name="companyType"> <uni-forms-item label="主体类型" name="companyType">
<picker @change="CompanyTypeChange" v-model="formData.companyType" mode='selector' <picker @change="CompanyTypeChange"
:value="CurrentCompanyType" :range="CompanyTypePickerList"> :value="CurrentCompanyType" :range="CompanyTypePickerList">
<view class="uni-input" v-if="CompanyTypePickerList[CurrentCompanyType]"> <view class="uni-input" v-if="CompanyTypePickerList[CurrentCompanyType]">
{{CompanyTypePickerList[CurrentCompanyType]}} {{CompanyTypePickerList[CurrentCompanyType]}}
@ -26,7 +26,7 @@
</picker> </picker>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="所属行业" name="companyIndustry"> <uni-forms-item label="所属行业" name="companyIndustry">
<picker @change="CompanyIndustryChange" v-model="formData.companyIndustry" mode='selector' <picker @change="CompanyIndustryChange"
:value="CurrentCompanyIndustry" :range="CompanyIndustryPickerList"> :value="CurrentCompanyIndustry" :range="CompanyIndustryPickerList">
<view class="uni-input" v-if="CompanyIndustryPickerList[CurrentCompanyIndustry]"> <view class="uni-input" v-if="CompanyIndustryPickerList[CurrentCompanyIndustry]">
{{CompanyIndustryPickerList[CurrentCompanyIndustry]}} {{CompanyIndustryPickerList[CurrentCompanyIndustry]}}
@ -35,7 +35,7 @@
<uni-icons type="down" size="14" class="v-icon"></uni-icons> <uni-icons type="down" size="14" class="v-icon"></uni-icons>
</picker> </picker>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="社会信用代码" :labelWidth='140' name="companyCode"> <uni-forms-item label="社会信用代码" :labelWidth='140' name="companyCode">
<input v-model="formData.companyCode" placeholder="请输入社会信用代码" /> <input v-model="formData.companyCode" placeholder="请输入社会信用代码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="营业执照" name="companyLicense"> <uni-forms-item label="营业执照" name="companyLicense">
@ -46,11 +46,9 @@
<uni-easyinput v-model="formData.companyLicense" class="not-show" placeholder=" " /> <uni-easyinput v-model="formData.companyLicense" class="not-show" placeholder=" " />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="证书" name="companyCertificate"> <uni-forms-item label="证书" name="companyCertificate">
<image class="v-base-img" :src="formData.companyCertificate" v-if="formData.companyCertificate"> <htz-image-upload v-model="imgList1" :action="baseUrls" :chooseNum="1" :compress="false"
</image>
<htz-image-upload v-else v-model="imgList1" :action="baseUrls" :chooseNum="1" :compress="false"
:headers="headers" :max="1" :quality="80" :remove="true" :sourceType="['album', 'camera']" :headers="headers" :max="1" :quality="80" :remove="true" :sourceType="['album', 'camera']"
class="m-img-upload" mediaType="image" @imgDelete="ceshiImgDelete" class="m-img-upload" mediaType="image" @imgDelete="ceshiImgDelete1"
@uploadFail="ceshiUploadFail" @uploadSuccess="ceshiUploadSuccess1"></htz-image-upload> @uploadFail="ceshiUploadFail" @uploadSuccess="ceshiUploadSuccess1"></htz-image-upload>
<uni-easyinput v-model="formData.companyCertificate" class="not-show" placeholder=" " /> <uni-easyinput v-model="formData.companyCertificate" class="not-show" placeholder=" " />
</uni-forms-item> </uni-forms-item>
@ -166,24 +164,34 @@
async getListData() { async getListData() {
try { try {
this.getCompanyIndustry() this.getCompanyIndustry()
this.getCompanyType() this.getCompanyType()
const res = await CompanyApi.getCompanyPage(this.queryParams) const res = await CompanyApi.getCompanyPage(this.queryParams)
this.formData = res.data.list[0] this.formData = res.data.list[0]
console.log(this.formData) console.log("lai",this.formData)
this.queryParams.total = res.data.total; this.queryParams.total = res.data.total;
this.CurrentCompanyType = this.CompanyTypeList.findIndex(item => Number(item.value) === this.CurrentCompanyType = this.CompanyTypeList.findIndex(item => Number(item.value) ===
Number(this.formData.companyType)) Number(this.formData.companyType))
this.CurrentCompanyIndustry = this.CompanyIndustryList.findIndex(item => Number(item this.CurrentCompanyIndustry = this.CompanyIndustryList.findIndex(item => Number(item
.value) === Number(this.formData.companyIndustry)) .value) === Number(this.formData.companyIndustry))
if (this.formData.companyLicense == "") {
this.imgList = []
} else {
this.imgList[0] = this.formData.companyLicense
}
if (this.formData.companyCertificate == "") {
this.imgList1 = []
} else {
this.imgList1[0] = this.formData.companyCertificate
}
} finally {} } finally {}
}, },
/** 提交按钮 */ /** 提交按钮 */
async submitForm() { async submitForm() {
// //
try { try {
this.formData.companyType = this.CompanyTypeList[this.currenCustomerType].value console.log(this.formData)
this.formData.companyIndustry = this.CompanyIndustryList[this.CurrentCompanyIndustry].value
await this.$refs['formRef'].validate() await this.$refs['formRef'].validate()
const data = this.formData const data = this.formData
await CompanyApi.updateCompany(data) await CompanyApi.updateCompany(data)
@ -192,15 +200,13 @@
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
complete: function() { complete: function() {
setTimeout(function() { uni.redirectTo({
uni.redirectTo({ url: '/pages/mine/index'
url: '/pages/mine/index' });
});
}, 2000);
} }
}) })
} catch (err) { } catch (err) {
console.log("验证未通过",err) console.log("验证未通过", err)
} finally {} } finally {}
}, },
@ -218,6 +224,7 @@
// //
CompanyIndustryChange(e) { CompanyIndustryChange(e) {
this.CurrentCompanyIndustry = e.detail.value this.CurrentCompanyIndustry = e.detail.value
this.formData.companyIndustry = this.CompanyIndustryList[this.CurrentCompanyIndustry].value
}, },
// //
@ -233,6 +240,7 @@
// //
CompanyTypeChange(e) { CompanyTypeChange(e) {
this.CurrentCompanyType = e.detail.value this.CurrentCompanyType = e.detail.value
this.formData.companyType = this.CompanyTypeList[this.CurrentCompanyType].value
}, },
ceshiUploadSuccess(res) { ceshiUploadSuccess(res) {
@ -254,6 +262,13 @@
} }
}, },
ceshiImgDelete(e, num) { ceshiImgDelete(e, num) {
this.imgList = []
this.formData.companyCertificate = ""
console.log('ceshiImgDelete', e);
},
ceshiImgDelete1(e, num) {
this.imgList1 = []
this.formData.companyCertificate = ""
console.log('ceshiImgDelete', e); console.log('ceshiImgDelete', e);
}, },
ceshiUploadFail(err) { ceshiUploadFail(err) {
@ -265,4 +280,4 @@
</script> </script>
<style> <style>
</style> </style>

@ -108,7 +108,6 @@
try { try {
this.formData.lossType = this.LossTypeList[this.CurrenLossType].value this.formData.lossType = this.LossTypeList[this.CurrenLossType].value
console.log(this.formData)
await this.$refs['formRef'].validate() await this.$refs['formRef'].validate()
const data = this.formData const data = this.formData
await LossApi.createLoss(data) await LossApi.createLoss(data)

@ -85,8 +85,8 @@
<uni-forms-item label="生产原材料" label-width="100px" name="materialsList" required> <uni-forms-item label="生产原材料" label-width="100px" name="materialsList" required>
<view @click="goMaterials()">选择生产原料<uni-icons type="right" size="14"></uni-icons></view> <view @click="goMaterials()">选择生产原料<uni-icons type="right" size="14"></uni-icons></view>
</uni-forms-item> </uni-forms-item>
<view class="v-materials-list no-label" v-if="formData.materialsList.length>0"> <view class="v-materials-list no-label no-right" v-if="formData.materialsList.length>0">
<uni-forms-item required :label-width="0" :name="['materialsList',i,'productUsed']" <uni-forms-item required :label-width="0" :name="['materialsList',i,'productUsed']"
:key="cell.cropperId" :rules="cell.rules" v-for="(cell,i) in formData.materialsList"> :key="cell.cropperId" :rules="cell.rules" v-for="(cell,i) in formData.materialsList">
<view class="v-materials-list-item"> <view class="v-materials-list-item">
<view class="v-materials-list-box row"> <view class="v-materials-list-box row">
@ -105,7 +105,7 @@
<input class="border" v-model="formData.materialsList[i].productUsed" <input class="border" v-model="formData.materialsList[i].productUsed"
placeholder="总用量" type="digit" /> placeholder="总用量" type="digit" />
</view> </view>
<view>公斤</view> <view class="unit">公斤</view>
</view> </view>
</view> </view>
</view> </view>
@ -312,11 +312,9 @@ import {parseTime} from "@/utils/ruoyi.js";
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
complete: function() { complete: function() {
setTimeout(function() { uni.redirectTo({
uni.redirectTo({ url: '/pages/index'
url: '/pages/index' });
});
}, 2000);
} }
}) })
} catch (err) { } catch (err) {

@ -76,7 +76,6 @@
return item.cropperId return item.cropperId
}) })
this.saveData=this.reviceData.materialsList this.saveData=this.reviceData.materialsList
console.log(this.selectData)
} }
} else { } else {
this.reviceData = null; this.reviceData = null;

@ -198,7 +198,6 @@
// //
ClientChange(e) { ClientChange(e) {
this.CurrenClient = e.detail.value this.CurrenClient = e.detail.value
console.log(this.CurrenClient)
this.formData.customId = this.ClientList[this.CurrenClient].id this.formData.customId = this.ClientList[this.CurrenClient].id
this.formData.customAddress = this.ClientList[this.CurrenClient].address this.formData.customAddress = this.ClientList[this.CurrenClient].address
this.formData.contacts = this.ClientList[this.CurrenClient].logisticsLeader this.formData.contacts = this.ClientList[this.CurrenClient].logisticsLeader

Loading…
Cancel
Save