4月26日提交

master
rosehan 2 years ago
parent 050608f21b
commit 97d036401c
  1. 1
      api/traceability/company.js
  2. 1
      pages/mine/index.vue
  3. 42
      static/scss/v-layout.scss
  4. 35
      sunPages/mine/base/index.vue
  5. 39
      sunPages/mine/business/index.vue
  6. 1
      sunPages/traceability-product/loss/lossEdit.vue
  7. 6
      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) {
return request({
url: '/traceability/company/update',
method: 'put',

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

@ -299,7 +299,7 @@ $v-muted: #dddddd;
margin-bottom: 20rpx;
.v-materials-list-box {
background-color: rgba(0, 0, 0, 0.02);
padding: 20rpx;
padding: 20rpx 20rpx 10rpx 20rpx;
text-align: left;
.v-materials-name {
font-size: 32rpx;
@ -541,7 +541,6 @@ $v-muted: #dddddd;
.v-form {
.v-form-item {
position: relative;
padding: 4rpx 40rpx 4rpx 40rpx;
margin: 20rpx 0;
@ -556,24 +555,15 @@ $v-muted: #dddddd;
}
}
}
.label-120{
.uni-forms-item__label{width: 240rpx; }
}
.label-120 {
.uni-forms-item__label {
font-size: 28rpx;
width: 240rpx;
}
.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__label {
font-size: 28rpx;
}
.uni-forms-item__content {
position: relative;
text-align: right;
@ -623,6 +613,26 @@ $v-muted: #dddddd;
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 {
width: 100%;
padding: 0 40rpx 0 0;

@ -37,10 +37,10 @@
<input v-model="formData.baseAddress" placeholder="请输入基地地址" class="m-form-small" />
</uni-forms-item>
<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 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 label="联系电话" name="basePhone">
<input v-model="formData.basePhone" placeholder="请输入联系电话" type="digit" class="m-form-small" />
@ -199,10 +199,9 @@
try {
await this.getCompany()
await this.getAddressList()
const res = await BaseApi.getBase(this.baseId)
this.formData = res.data
console.log('lai',this.formData)
//
this.CompanyList.map((item, index, arr) => {
@ -230,8 +229,11 @@
this.LocalData.provinceCode = this.formData.province
this.LocalData.cityCode = this.formData.city
this.LocalData.areaCode = this.formData.district
if(this.formData.baseImage==""){
this.imgList=[]
}else{
this.imgList[0]=this.formData.baseImage
}
} finally {}
},
@ -244,20 +246,16 @@
await this.$refs['formRef'].validate()
const data = this.formData
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({
title: `保存成功`,
icon: 'success',
duration: 2000,
complete: function() {
setTimeout(function() {
that.$store.dispatch('changeBaseName',that.formData.baseName)
that.$store.dispatch('changeBaseLeader',that.formData.baseLeader)
uni.redirectTo({
url: '/pages/mine/index'
});
}, 2000);
}
})
} catch (err) {
@ -317,12 +315,27 @@
}
},
ceshiImgDelete(e, num) {
this.imgList=[]
this.formData.baseImage=""
console.log('ceshiImgDelete', e);
},
ceshiUploadFail(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>

@ -16,7 +16,7 @@
<input v-model="formData.companyPhone" placeholder="请输入联系电话" class="m-form-small" />
</uni-forms-item>
<uni-forms-item label="主体类型" name="companyType">
<picker @change="CompanyTypeChange" v-model="formData.companyType" mode='selector'
<picker @change="CompanyTypeChange"
:value="CurrentCompanyType" :range="CompanyTypePickerList">
<view class="uni-input" v-if="CompanyTypePickerList[CurrentCompanyType]">
{{CompanyTypePickerList[CurrentCompanyType]}}
@ -26,7 +26,7 @@
</picker>
</uni-forms-item>
<uni-forms-item label="所属行业" name="companyIndustry">
<picker @change="CompanyIndustryChange" v-model="formData.companyIndustry" mode='selector'
<picker @change="CompanyIndustryChange"
:value="CurrentCompanyIndustry" :range="CompanyIndustryPickerList">
<view class="uni-input" v-if="CompanyIndustryPickerList[CurrentCompanyIndustry]">
{{CompanyIndustryPickerList[CurrentCompanyIndustry]}}
@ -46,11 +46,9 @@
<uni-easyinput v-model="formData.companyLicense" class="not-show" placeholder=" " />
</uni-forms-item>
<uni-forms-item label="证书" name="companyCertificate">
<image class="v-base-img" :src="formData.companyCertificate" v-if="formData.companyCertificate">
</image>
<htz-image-upload v-else v-model="imgList1" :action="baseUrls" :chooseNum="1" :compress="false"
<htz-image-upload v-model="imgList1" :action="baseUrls" :chooseNum="1" :compress="false"
: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>
<uni-easyinput v-model="formData.companyCertificate" class="not-show" placeholder=" " />
</uni-forms-item>
@ -169,12 +167,23 @@
this.getCompanyType()
const res = await CompanyApi.getCompanyPage(this.queryParams)
this.formData = res.data.list[0]
console.log(this.formData)
console.log("lai",this.formData)
this.queryParams.total = res.data.total;
this.CurrentCompanyType = this.CompanyTypeList.findIndex(item => Number(item.value) ===
Number(this.formData.companyType))
this.CurrentCompanyIndustry = this.CompanyIndustryList.findIndex(item => Number(item
.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 {}
},
@ -182,8 +191,7 @@
async submitForm() {
//
try {
this.formData.companyType = this.CompanyTypeList[this.currenCustomerType].value
this.formData.companyIndustry = this.CompanyIndustryList[this.CurrentCompanyIndustry].value
console.log(this.formData)
await this.$refs['formRef'].validate()
const data = this.formData
await CompanyApi.updateCompany(data)
@ -192,15 +200,13 @@
icon: 'success',
duration: 2000,
complete: function() {
setTimeout(function() {
uni.redirectTo({
url: '/pages/mine/index'
});
}, 2000);
}
})
} catch (err) {
console.log("验证未通过",err)
console.log("验证未通过", err)
} finally {}
},
@ -218,6 +224,7 @@
//
CompanyIndustryChange(e) {
this.CurrentCompanyIndustry = e.detail.value
this.formData.companyIndustry = this.CompanyIndustryList[this.CurrentCompanyIndustry].value
},
//
@ -233,6 +240,7 @@
//
CompanyTypeChange(e) {
this.CurrentCompanyType = e.detail.value
this.formData.companyType = this.CompanyTypeList[this.CurrentCompanyType].value
},
ceshiUploadSuccess(res) {
@ -254,6 +262,13 @@
}
},
ceshiImgDelete(e, num) {
this.imgList = []
this.formData.companyCertificate = ""
console.log('ceshiImgDelete', e);
},
ceshiImgDelete1(e, num) {
this.imgList1 = []
this.formData.companyCertificate = ""
console.log('ceshiImgDelete', e);
},
ceshiUploadFail(err) {

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

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

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

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

Loading…
Cancel
Save