4月26日提交

master
rosehan 2 years ago
parent 56193a3012
commit af2a1feb2a
  1. 4
      config.js
  2. 28
      pages/index.vue
  3. 38
      pages/login.vue
  4. 1
      store/index.js
  5. 17
      store/modules/user.js
  6. 134
      sunPages/mine/base/index.vue
  7. 17
      sunPages/traceability-product/delivery/deliveryEdit.vue
  8. 45
      sunPages/traceability-product/machining/index.vue
  9. 2
      utils/constant.js

@ -1,8 +1,8 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
baseUrl: 'https://sy.hbcjy.com/prod-api', //baseUrl: 'https://sy.hbcjy.com/prod-api',
// baseUrl: 'http://127.0.0.1:48080', // baseUrl: 'http://127.0.0.1:48080',
// baseUrl: 'http://192.168.130.193:48080', baseUrl: 'http://192.168.130.193:48080',
baseApi: '/admin-api', baseApi: '/admin-api',
// 应用信息 // 应用信息
appInfo: { appInfo: {

@ -7,8 +7,8 @@
</image> </image>
<view class="row v-index-top-base"> <view class="row v-index-top-base">
<view class="text"><text class="iconfont icon-farm"></text>{{ BaseInfo.baseName }}</view> <view class="text"><text class="iconfont icon-farm"></text>{{ baseName }}</view>
<view class="text"><text class="iconfont icon-leader"></text>负责人{{ BaseInfo.baseLeader }}</view> <view class="text"><text class="iconfont icon-leader"></text>负责人{{ baseLeader }}</view>
</view> </view>
<view class="v-index-top-nav v-container"> <view class="v-index-top-nav v-container">
@ -178,15 +178,27 @@
baseId: this.$store.state.user.baseId, baseId: this.$store.state.user.baseId,
BaseInfo: null, BaseInfo: null,
ProductData: null, ProductData: null,
ProductCode: null ProductCode: null,
baseName: null,
baseLeader: null,
} }
}, },
watch: { watch: {
"$store.state.user.baseId"(newValue, oldVal) { "$store.state.user.baseId"(newValue, oldVal) {
console.log("AAAA",newValue) this.baseId = newValue
this.baseId=newValue
this.getBaseData() this.getBaseData()
} },
"$store.state.user.baseName": {
handler(newVal) {
this.baseName = newVal
},
},
"$store.state.user.baseLeader": {
handler(newVal) {
this.baseLeader = newVal
},
},
}, },
onLoad: function() { onLoad: function() {
this.getBaseData() this.getBaseData()
@ -195,13 +207,15 @@
}, },
methods: { methods: {
// //
async getBaseData() { async getBaseData() {
try { try {
let params = { let params = {
id: this.baseId id: this.baseId
} }
const res = await indexApi.getAllBaseInfo(params) const res = await indexApi.getAllBaseInfo(params)
this.BaseInfo = res.data this.BaseInfo = res.data
this.baseName = this.BaseInfo.baseName
this.baseLeader = this.BaseInfo.baseLeader
} finally {} } finally {}
}, },

@ -1,9 +1,13 @@
<template> <template>
<view class="normal-login-container"> <view class="normal-login-container">
<view class="logo-content"> <view class="logo-content">
<image src="https://sy.hbcjy.com/prod-api/admin-api/infra/file/23/get/7e06dab83f0c2f4de0f6768f8d2f114aa6d752db73d9cb054dff9f8a13aa2267.png" class="logo-content-bg"></image> <image
src="https://sy.hbcjy.com/prod-api/admin-api/infra/file/23/get/7e06dab83f0c2f4de0f6768f8d2f114aa6d752db73d9cb054dff9f8a13aa2267.png"
class="logo-content-bg"></image>
<view class="title"> <view class="title">
<view class="text">欢迎登录</view><view class="text">溯源管理系统</view></view> <view class="text">欢迎登录</view>
<view class="text">溯源管理系统</view>
</view>
</view> </view>
<view class="login-form-content"> <view class="login-form-content">
<view class="input-item flex align-center"> <view class="input-item flex align-center">
@ -32,7 +36,7 @@
<script> <script>
import verify from "../sunPages/components/verifition/verify" import verify from "../sunPages/components/verifition/verify"
import * as CryptoUtils from '@/utils/cryptoUtils.js'; import * as CryptoUtils from '@/utils/cryptoUtils.js';
import store from "@/store" import store from "@/store"
export default { export default {
name: 'Login', name: 'Login',
@ -44,8 +48,8 @@
captchaEnabled: true, // TODO captchaEnabled: true, // TODO
globalConfig: getApp().globalData.config, globalConfig: getApp().globalData.config,
loginForm: { loginForm: {
username: "", username: "admin",
password: "", password: "cjy@1501!",
captchaVerification: "" captchaVerification: ""
} }
} }
@ -84,13 +88,11 @@
this.$store.dispatch('Login', this.loginForm).then(() => { this.$store.dispatch('Login', this.loginForm).then(() => {
this.$modal.closeLoading() this.$modal.closeLoading()
this.loginSuccess() this.loginSuccess()
this.$store.dispatch('getBaseList').then(res=>{ this.$store.dispatch('getBaseList').then(res => {
console.log(res) // setTimeout(()=>{
this.$store.dispatch('changeBaseId', res[0].id)
// setTimeout(()=>{ // },1500)
this.$store.dispatch('changeBaseId',res[0].id) })
// },1500)
})
}) })
}, },
// //
@ -130,10 +132,14 @@
.title { .title {
position: absolute; position: absolute;
top:30px; top: 30px;
width: 100%; width: 100%;
text-align: center; text-align: center;
.text{font-weight: 600; color: #fff;}
.text {
font-weight: 600;
color: #fff;
}
} }
} }
@ -169,7 +175,7 @@
height: 45px; height: 45px;
background-color: #14c171; background-color: #14c171;
color: #fff; color: #fff;
border-radius: 45px; border-radius: 45px;
} }
.xieyi { .xieyi {
@ -186,4 +192,4 @@
.login-code-img { .login-code-img {
height: 45px; height: 45px;
} }
</style> </style>

@ -19,7 +19,6 @@ const store = new Vuex.Store({
modules: { modules: {
user, user,
dict dict
}, },
getters getters
}) })

@ -16,6 +16,8 @@ const user = {
roles: storage.get(constant.roles), roles: storage.get(constant.roles),
permissions: storage.get(constant.permissions), permissions: storage.get(constant.permissions),
baseId: storage.get(constant.baseId), baseId: storage.get(constant.baseId),
baseName: storage.get(constant.baseName),
baseLeader: storage.get(constant.baseLeader),
// baseList: storage.get(constant.baseList) // baseList: storage.get(constant.baseList)
}, },
@ -43,6 +45,14 @@ const user = {
state.baseId = permissions state.baseId = permissions
storage.set(constant.baseId, permissions) storage.set(constant.baseId, permissions)
}, },
SET_BASENAME: (state, permissions) => {
state.baseName = permissions
storage.set(constant.baseName, permissions)
},
SET_BASELEADER: (state, permissions) => {
state.baseLeader = permissions
storage.set(constant.baseLeader, permissions)
},
CHANGE_BASEID: (state, permissions) => { CHANGE_BASEID: (state, permissions) => {
state.baseId = permissions state.baseId = permissions
storage.set(constant.baseId, permissions) storage.set(constant.baseId, permissions)
@ -125,8 +135,13 @@ const user = {
}) })
}, },
changeBaseId({commit}, state) { changeBaseId({commit}, state) {
console.log(commit,state)
commit('CHANGE_BASEID', state) commit('CHANGE_BASEID', state)
},
changeBaseName({commit}, state) {
commit('SET_BASENAME', state)
},
changeBaseLeader({commit}, state) {
commit('SET_BASELEADER', state)
} }
} }
} }

@ -1,7 +1,7 @@
<template> <template>
<view class="v-pages"> <view class="v-pages">
<view class="v-form v-container"> <view class="v-form v-container" style="padding-bottom: 120rpx;">
<uni-forms :modelValue="formData" ref="formRef" :label-width="120" :rules="formRules"> <uni-forms :modelValue="formData" ref="formRef" :label-width="80" :rules="formRules">
<view class="v-form-item base" @click="goBase()"> <view class="v-form-item base" @click="goBase()">
<view class="row"> <view class="row">
<view class="col">切换基地</view> <view class="col">切换基地</view>
@ -14,8 +14,7 @@
<input v-model="formData.baseName" placeholder="请输入基地名称" /> <input v-model="formData.baseName" placeholder="请输入基地名称" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="所属企业" name="companyId"> <uni-forms-item label="所属企业" name="companyId">
<picker @change="CompanyChange" v-model="formData.companyId" mode='selector' <picker @change="CompanyChange" :value="CurrentCompany" :range="CompanyPickerList">
:value="CurrentCompany" :range="CompanyPickerList">
<view class="uni-input" v-if="CompanyPickerList[CurrentCompany]"> <view class="uni-input" v-if="CompanyPickerList[CurrentCompany]">
{{CompanyPickerList[CurrentCompany]}} {{CompanyPickerList[CurrentCompany]}}
</view> </view>
@ -37,28 +36,31 @@
<uni-forms-item label="基地地址" name="baseAddress"> <uni-forms-item label="基地地址" name="baseAddress">
<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"> <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" />
</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="请输入联系电话" class="m-form-small" /> <input v-model="formData.basePhone" placeholder="请输入联系电话" type="digit" class="m-form-small" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="基地简介" name="baseDescription"> <uni-forms-item label="基地简介" name="baseDescription">
<rich-text :nodes="formData.baseDescription"></rich-text> <rich-text :nodes="formData.baseDescription"></rich-text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="基地图片" name="baseImage"> <uni-forms-item label="基地图片" name="baseImage">
<image class="v-base-img" :src="formData.baseImage"></image> <htz-image-upload v-model="imgList" :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"
@uploadFail="ceshiUploadFail" @uploadSuccess="ceshiUploadSuccess"></htz-image-upload>
<uni-easyinput v-model="formData.companyLicense" class="not-show" placeholder=" " />
</uni-forms-item> </uni-forms-item>
</view> </view>
</uni-forms> </uni-forms>
<!-- 页面 提交 --> <!-- 页面 提交 -->
<view class="sticky fixedBottom"><button class="v-primary-btn large" @click="submitForm()">保存</button> <view class="fixed fixedBottom v-container"><button class="v-primary-btn large" @click="submitForm()">保存</button>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -71,12 +73,26 @@
import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker' import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
import {
getAccessToken
} from '@/utils/auth';
import config from '@/config';
import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue';
export default { export default {
components: { components: {
cityPicker cityPicker,
htzImageUpload
}, },
data() { data() {
return { return {
imgList: [],
baseUrls: config.baseUrl + config.baseApi + '/infra/file/upload',
headers: {
Authorization: 'Bearer ' + getAccessToken()
}, //
defaultValue: '', defaultValue: '',
column: 3, column: 3,
startVisible: false, startVisible: false,
@ -90,7 +106,6 @@
cityCode: null, cityCode: null,
cityCode: null, cityCode: null,
}, },
formData: { formData: {
id: undefined, id: undefined,
baseName: undefined, baseName: undefined,
@ -141,11 +156,17 @@
errorMessage: '请输入基地面积' errorMessage: '请输入基地面积'
}] }]
}, },
baseAddress: {
rules: [{
required: true,
errorMessage: '请输入基地详细地址'
}]
},
basePhone: { basePhone: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请输入联系电话' errorMessage: '请输入联系电话'
}] }, ]
} }
}, },
@ -153,9 +174,13 @@
CurrentCompany: undefined, CurrentCompany: undefined,
CompanyList: [], // CompanyList: [], //
CompanyPickerList: [], // CompanyPickerList: [], //
provinceList: [],
cityList: [],
areaList: [],
} }
}, },
onLoad: function() { onLoad: function() {
this.getListData() this.getListData()
}, },
onReady() { onReady() {
@ -163,36 +188,49 @@
this.$refs.formRef.setRules(this.formRules) this.$refs.formRef.setRules(this.formRules)
}, },
methods: { methods: {
async getCity() { async getAddressList() {
try { try {
const res = await areaApi.getAreaTree() const res = await areaApi.getAreaTree()
this.addressList = res.data this.addressList = res.data
} finally {} } finally {}
}, },
// //
async getListData() { async getListData() {
this.getCity()
try { try {
this.getCompany() await this.getCompany()
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
this.CurrentCompany = this.CompanyList.findIndex(item => Number(item.companyId) ===
Number(this.formData.companyId))
console.log("aaaaa", this.addressList) //
const province=this.addressList.find((item, index) => { this.CompanyList.map((item, index, arr) => {
if (item.companyId === this.formData.companyId) {
this.CurrentCompany = index
}
})
this.provinceList = this.addressList.find((item, index) => {
return item.id == this.formData.province; return item.id == this.formData.province;
}) })
console.log(province)
this.LocalData.provinceName =province.name
this.LocalData.cityName = this.formData.city this.cityList = this.provinceList.children.find((item, index) => {
this.LocalData.areaName = this.formData.district return item.id == this.formData.city;
})
this.areaList = this.cityList.children.find((item, index) => {
return item.id == this.formData.district;
})
this.LocalData.provinceName = this.provinceList.name
this.LocalData.cityName = this.cityList.name
this.LocalData.areaName = this.areaList.name
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
} finally {} } finally {}
@ -201,16 +239,21 @@
/** 提交按钮 */ /** 提交按钮 */
async submitForm() { async submitForm() {
// //
try { try {
await this.$refs['formRef'].validate() const that = this
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)
uni.showToast({ uni.showToast({
title: `保存成功`, title: `保存成功`,
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
complete: function() { complete: function() {
setTimeout(function() { setTimeout(function() {
that.$store.dispatch('changeBaseName',that.formData.baseName)
that.$store.dispatch('changeBaseLeader',that.formData.baseLeader)
uni.redirectTo({ uni.redirectTo({
url: '/pages/mine/index' url: '/pages/mine/index'
}); });
@ -245,6 +288,7 @@
// //
CompanyChange(e) { CompanyChange(e) {
this.CurrentCompany = e.detail.value this.CurrentCompany = e.detail.value
this.formData.companyId = this.CompanyList[this.CurrentCompany].companyId
}, },
// //
@ -252,17 +296,33 @@
this.startVisible = true this.startVisible = true
}, },
startConfirm(val) { startConfirm(val) {
console.log(val)
this.LocalData = val this.LocalData = val
this.startVisible = false this.startVisible = false
this.formData.startRegion = this.LocalData.name this.formData.startRegion = this.LocalData.name
this.formData.startProvince = this.LocalData.provinceCode this.formData.province = this.LocalData.provinceCode
this.formData.startCity = this.LocalData.cityCode this.formData.city = this.LocalData.cityCode
this.formData.startCountry = this.LocalData.areaCode this.formData.district = this.LocalData.areaCode
}, },
startCancel() { startCancel() {
this.startVisible = false this.startVisible = false
}, },
ceshiUploadSuccess(res) {
//
var _res = JSON.parse(res.data);
console.log('_res', _res);
if (_res.code == 0) {
this.imgList.push(_res.data);
this.formData.baseImage = _res.data;
}
},
ceshiImgDelete(e, num) {
console.log('ceshiImgDelete', e);
},
ceshiUploadFail(err) {
//
console.log('err', err);
},
} }
} }
</script> </script>

@ -23,7 +23,8 @@
<uni-forms-item label="配送人" name="deliveryMan" required> <uni-forms-item label="配送人" name="deliveryMan" required>
<input v-model="formData.deliveryMan" placeholder="请输入配送人" /> <input v-model="formData.deliveryMan" placeholder="请输入配送人" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="配送日期" name="deliveryTime"> <uni-forms-item label="配送日期" name="deliveryTime">
<uni-datetime-picker :clear-icon="false" type="date" returnType="timestamp" v-model="formData.deliveryTime" @change="changeLog($event)" /> <uni-datetime-picker :clear-icon="false" type="date" returnType="timestamp" v-model="formData.deliveryTime" @change="changeLog($event)" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="所在地区" name="startRegion" required> <uni-forms-item label="所在地区" name="startRegion" required>
@ -128,43 +129,43 @@
logisticsId: { logisticsId: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '配送公司不能为空' errorMessage: '配送公司不能为空'
}] }]
}, },
deliveryMan: { deliveryMan: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '配送人不能为空' errorMessage: '配送人不能为空'
}] }]
}, },
deliveryTime: { deliveryTime: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '配送日期不能为空' errorMessage: '配送日期不能为空'
}] }]
}, },
startAddress: { startAddress: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '详细地址不能为空' errorMessage: '详细地址不能为空'
}] }]
}, },
endAddress: { endAddress: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '详细地址不能为空' errorMessage: '详细地址不能为空'
}] }]
}, },
startRegion: { startRegion: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '所在区不能为空' errorMessage: '所在区不能为空'
}] }]
}, },
endRegion: { endRegion: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '所在区不能为空' errorMessage: '所在区不能为空'
}] }]
}, },
}, },

@ -1,17 +1,17 @@
<template> <template>
<view class="v-pages"> <view class="v-pages">
<view class="v-form v-container"> <view class="v-form v-container" style="padding-bottom: 120rpx;">
<uni-forms :modelValue="formData" ref="formRef" :label-width="80" :rules="formRules"> <uni-forms :modelValue="formData" ref="formRef" :label-width="80" :rules="formRules">
<view class="v-form-item"> <view class="v-form-item">
<uni-forms-item label="产品名称" name="processingName" required> <uni-forms-item label="产品名称" name="processingName" required>
<input v-model="formData.processingName" placeholder="请输入产品名称" /> <input v-model="formData.processingName" placeholder="请输入产品名称" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="生产数量(公斤)" name="processingProduction" required> <uni-forms-item label="生产数量(公斤)" name="processingProduction" required :label-width="120">
<input v-model="formData.processingProduction" type="digit" placeholder="请输入生产数量" /> <input v-model="formData.processingProduction" type="digit" placeholder="请输入生产数量" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="加工车间" name="workshopId" required> <uni-forms-item label="加工车间" name="workshopId" required>
<picker @change="WorkShopChange" v-model="formData.workshopId" <picker @change="WorkShopChange" v-model="formData.workshopId" :value="CurrenWorkShop"
:value="CurrenWorkShop" :range="WorkShopPickerList"> :range="WorkShopPickerList">
<view class="uni-input" v-if="WorkShopPickerList[CurrenWorkShop]"> <view class="uni-input" v-if="WorkShopPickerList[CurrenWorkShop]">
{{WorkShopPickerList[CurrenWorkShop]}} {{WorkShopPickerList[CurrenWorkShop]}}
</view> </view>
@ -19,9 +19,10 @@
<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="加工日期" name="processingTime"> <uni-forms-item label="加工日期" name="processingTime"> <uni-datetime-picker ref="datetimePicker"
<uni-datetime-picker :clear-icon="false" type="date" returnType="timestamp" v-model="formData.processingTime" :clear-icon="false" returnType="timestamp" type="date">
v-model="formData.processingTime" @change="changeLog($event)" /> {{parseTime(formData.processingTime,'{y}-{m}-{d}')||'请选择加工时间'}} <uni-icons type="calendar"></uni-icons>
</uni-datetime-picker>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="加工项目" name="processingProjection" required> <uni-forms-item label="加工项目" name="processingProjection" required>
<input v-model="formData.processingProjection" placeholder="请输入加工项目" /> <input v-model="formData.processingProjection" placeholder="请输入加工项目" />
@ -33,8 +34,8 @@
<view class="v-form-item"> <view class="v-form-item">
<uni-forms-item label="认证类型" name="authenticationType"> <uni-forms-item label="认证类型" name="authenticationType">
<picker @change="AuthenticationTypeChange" <picker @change="AuthenticationTypeChange" :value="CurrenAuthenticationType"
:value="CurrenAuthenticationType" :range="AuthenticationTypePickerList"> :range="AuthenticationTypePickerList">
<view class="uni-input" v-if="AuthenticationTypePickerList[CurrenAuthenticationType]"> <view class="uni-input" v-if="AuthenticationTypePickerList[CurrenAuthenticationType]">
{{AuthenticationTypePickerList[CurrenAuthenticationType]}} {{AuthenticationTypePickerList[CurrenAuthenticationType]}}
</view> </view>
@ -53,8 +54,8 @@
</view> </view>
<view class="v-form-item"> <view class="v-form-item">
<uni-forms-item label="质检情况" name="qualityInspection" required> <uni-forms-item label="质检情况" name="qualityInspection" required>
<picker @change="QualityInspectionChange" <picker @change="QualityInspectionChange" :value="CurrenQualityInspection"
:value="CurrenQualityInspection" :range="QualityInspectionPickerList"> :range="QualityInspectionPickerList">
<view class="uni-input" v-if="QualityInspectionPickerList[CurrenQualityInspection]"> <view class="uni-input" v-if="QualityInspectionPickerList[CurrenQualityInspection]">
{{QualityInspectionPickerList[CurrenQualityInspection]}} {{QualityInspectionPickerList[CurrenQualityInspection]}}
</view> </view>
@ -63,8 +64,8 @@
</picker> </picker>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="质检结论" name="qualityResult" required> <uni-forms-item label="质检结论" name="qualityResult" required>
<picker @change="QualityResultChange" <picker @change="QualityResultChange" :value="CurrenQualityResult"
:value="CurrenQualityResult" :range="QualityResultPickerList"> :range="QualityResultPickerList">
<view class="uni-input" v-if="QualityResultPickerList[CurrenQualityResult]"> <view class="uni-input" v-if="QualityResultPickerList[CurrenQualityResult]">
{{QualityResultPickerList[CurrenQualityResult]}} {{QualityResultPickerList[CurrenQualityResult]}}
</view> </view>
@ -113,7 +114,7 @@
</view> </view>
</view> </view>
</uni-forms> </uni-forms>
<view class="sticky fixedBottom"> <view class="fixed fixedBottom v-container">
<view class="m-t-large v-primary-btn large" @click="submitForm()">保存</view> <view class="m-t-large v-primary-btn large" @click="submitForm()">保存</view>
</view> </view>
</view> </view>
@ -121,6 +122,8 @@
</template> </template>
<script> <script>
import {parseTime} from "@/utils/ruoyi.js";
import * as ProductApi from "@/api/traceability/product" import * as ProductApi from "@/api/traceability/product"
import * as customApi from "@/api/traceability/custom" import * as customApi from "@/api/traceability/custom"
import mix from '@/utils/mix.js' import mix from '@/utils/mix.js'
@ -248,11 +251,11 @@
onLoad(options) { onLoad(options) {
if (options.params) { if (options.params) {
this.formData = JSON.parse(decodeURIComponent(options.params)); this.formData = JSON.parse(decodeURIComponent(options.params));
this.formData.processingTime=this.formData.processingTime this.formData.processingTime = this.formData.processingTime
this.CurrenWorkShop = this.formData.CurrenWorkShop this.CurrenWorkShop = this.formData.CurrenWorkShop
this.CurrenQualityInspection = this.formData.CurrenQualityInspection this.CurrenQualityInspection = this.formData.CurrenQualityInspection
this.CurrenQualityResult = this.formData.CurrenQualityResult this.CurrenQualityResult = this.formData.CurrenQualityResult
this.CurrenAuthenticationType = this.formData.CurrenAuthenticationType this.CurrenAuthenticationType = this.formData.CurrenAuthenticationType
if (this.formData.authenticationPic) { if (this.formData.authenticationPic) {
this.imgList[0] = this.formData.authenticationPic this.imgList[0] = this.formData.authenticationPic
} }
@ -281,6 +284,7 @@
husbandryNotes: undefined, husbandryNotes: undefined,
materialsList: [] materialsList: []
} }
this.formData.processingTime = new Date().valueOf()
} }
this.getAllWorkShop() this.getAllWorkShop()
@ -293,6 +297,9 @@
this.$refs.formRef.setRules(this.formRules) this.$refs.formRef.setRules(this.formRules)
}, },
methods: { methods: {
parseTime(time, pattern) {
return parseTime(time, pattern);
},
/** 提交按钮 */ /** 提交按钮 */
async submitForm() { async submitForm() {
// //
@ -307,13 +314,13 @@
complete: function() { complete: function() {
setTimeout(function() { setTimeout(function() {
uni.redirectTo({ uni.redirectTo({
url: '/sunPages/traceability-product/machining/index' url: '/pages/index'
}); });
}, 2000); }, 2000);
} }
}) })
} catch (err) { } catch (err) {
console.log("验证未通过") console.log("验证未通过",err)
} finally {} } finally {}
}, },
@ -472,4 +479,4 @@
}, },
}; };
</script> </script>

@ -4,6 +4,8 @@ const constant = {
roles: 'vuex_roles', roles: 'vuex_roles',
permissions: 'vuex_permissions', permissions: 'vuex_permissions',
baseId: 'vuex_baseId', baseId: 'vuex_baseId',
baseName: 'vuex_baseName',
baseLeader: 'vuex_baseLeader',
// baseList: 'vuex_baseList', // baseList: 'vuex_baseList',
} }

Loading…
Cancel
Save