|
|
|
@ -6,11 +6,11 @@ |
|
|
|
|
<uni-forms-item label="产品名称" name="processingName" required> |
|
|
|
|
<input v-model="formData.processingName" placeholder="请输入产品名称" /> |
|
|
|
|
</uni-forms-item> |
|
|
|
|
<uni-forms-item label="生产数量" name="processingProduction" required> |
|
|
|
|
<uni-forms-item label="生产数量(公斤)" name="processingProduction" required> |
|
|
|
|
<input v-model="formData.processingProduction" type="digit" placeholder="请输入生产数量" /> |
|
|
|
|
</uni-forms-item> |
|
|
|
|
<uni-forms-item label="加工车间" name="workshopId" required> |
|
|
|
|
<picker @change="WorkShopChange" v-model="formData.workshopId" mode='selector' |
|
|
|
|
<picker @change="WorkShopChange" v-model="formData.workshopId" |
|
|
|
|
:value="CurrenWorkShop" :range="WorkShopPickerList"> |
|
|
|
|
<view class="uni-input" v-if="WorkShopPickerList[CurrenWorkShop]"> |
|
|
|
|
{{WorkShopPickerList[CurrenWorkShop]}} |
|
|
|
@ -33,7 +33,7 @@ |
|
|
|
|
|
|
|
|
|
<view class="v-form-item"> |
|
|
|
|
<uni-forms-item label="认证类型" name="authenticationType"> |
|
|
|
|
<picker @change="AuthenticationTypeChange" v-model="formData.authenticationType" mode='selector' |
|
|
|
|
<picker @change="AuthenticationTypeChange" |
|
|
|
|
:value="CurrenAuthenticationType" :range="AuthenticationTypePickerList"> |
|
|
|
|
<view class="uni-input" v-if="AuthenticationTypePickerList[CurrenAuthenticationType]"> |
|
|
|
|
{{AuthenticationTypePickerList[CurrenAuthenticationType]}} |
|
|
|
@ -41,6 +41,7 @@ |
|
|
|
|
<view v-else class="placeholder">请选择质检结论</view> |
|
|
|
|
<uni-icons type="down" size="14" class="v-icon"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
|
|
|
|
|
</uni-forms-item> |
|
|
|
|
<uni-forms-item label="认证图片" name="authenticationPic"> |
|
|
|
|
<htz-image-upload v-model="imgList" :action="baseUrls" :chooseNum="1" :compress="false" |
|
|
|
@ -52,7 +53,7 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="v-form-item"> |
|
|
|
|
<uni-forms-item label="质检情况" name="qualityInspection" required> |
|
|
|
|
<picker @change="QualityInspectionChange" v-model="formData.qualityInspection" mode='selector' |
|
|
|
|
<picker @change="QualityInspectionChange" |
|
|
|
|
:value="CurrenQualityInspection" :range="QualityInspectionPickerList"> |
|
|
|
|
<view class="uni-input" v-if="QualityInspectionPickerList[CurrenQualityInspection]"> |
|
|
|
|
{{QualityInspectionPickerList[CurrenQualityInspection]}} |
|
|
|
@ -62,7 +63,7 @@ |
|
|
|
|
</picker> |
|
|
|
|
</uni-forms-item> |
|
|
|
|
<uni-forms-item label="质检结论" name="qualityResult" required> |
|
|
|
|
<picker @change="QualityResultChange" v-model="formData.qualityResult" mode='selector' |
|
|
|
|
<picker @change="QualityResultChange" |
|
|
|
|
:value="CurrenQualityResult" :range="QualityResultPickerList"> |
|
|
|
|
<view class="uni-input" v-if="QualityResultPickerList[CurrenQualityResult]"> |
|
|
|
|
{{QualityResultPickerList[CurrenQualityResult]}} |
|
|
|
@ -153,18 +154,17 @@ |
|
|
|
|
WorkShopPickerList: [], //加工车间列表 |
|
|
|
|
WorkshopList: [], //加工车间选择列表 |
|
|
|
|
|
|
|
|
|
CurrenQualityInspection: -1, //当前质检情况 |
|
|
|
|
CurrenQualityInspection: 0, //当前质检情况 |
|
|
|
|
QualityInspectionPickerList: [], //质检情况列表 |
|
|
|
|
QualityInspectionList: [], //质检情况选择列表 |
|
|
|
|
|
|
|
|
|
CurrenQualityResult: 1, //当前质检结论 |
|
|
|
|
CurrenQualityResult: 0, //当前质检结论 |
|
|
|
|
QualityResultPickerList: [], //质检结论列表 |
|
|
|
|
QualityResultList: [], //质检结论选择列表 |
|
|
|
|
|
|
|
|
|
CurrenAuthenticationType: 1, //当前认证类型 |
|
|
|
|
CurrenAuthenticationType: 0, //当前认证类型 |
|
|
|
|
AuthenticationTypePickerList: [], //认证类型列表 |
|
|
|
|
AuthenticationTypeList: [], //认证类型选择列表 |
|
|
|
|
|
|
|
|
|
formData: { |
|
|
|
|
id: undefined, |
|
|
|
|
cropperId: undefined, |
|
|
|
@ -174,10 +174,10 @@ |
|
|
|
|
workshopId: undefined, |
|
|
|
|
processingTime: undefined, |
|
|
|
|
processingProjection: undefined, |
|
|
|
|
authenticationType: undefined, |
|
|
|
|
authenticationType: 1, |
|
|
|
|
authenticationPic: undefined, |
|
|
|
|
qualityInspection: undefined, |
|
|
|
|
qualityResult: undefined, |
|
|
|
|
qualityInspection: 1, |
|
|
|
|
qualityResult: 1, |
|
|
|
|
qualityImage: undefined, |
|
|
|
|
certificateNumber: undefined, |
|
|
|
|
husbandryImage: undefined, |
|
|
|
@ -248,10 +248,10 @@ |
|
|
|
|
onLoad(options) { |
|
|
|
|
if (options.params) { |
|
|
|
|
this.formData = JSON.parse(decodeURIComponent(options.params)); |
|
|
|
|
console.log("回",this.formData) |
|
|
|
|
this.formData.processingTime=this.formData.processingTime |
|
|
|
|
this.CurrenWorkShop = this.formData.CurrenWorkShop |
|
|
|
|
this.CurrenQualityInspection = this.formData.CurrenQualityInspection |
|
|
|
|
this.CurrenQualityResult = this.formData.CurrenAuthenticationType |
|
|
|
|
this.CurrenQualityResult = this.formData.CurrenQualityResult |
|
|
|
|
this.CurrenAuthenticationType = this.formData.CurrenAuthenticationType |
|
|
|
|
if (this.formData.authenticationPic) { |
|
|
|
|
this.imgList[0] = this.formData.authenticationPic |
|
|
|
@ -259,7 +259,6 @@ |
|
|
|
|
if (this.formData.qualityImage) { |
|
|
|
|
this.imgList1[0] = this.formData.qualityImage |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.formData = { |
|
|
|
|
id: undefined, |
|
|
|
@ -270,10 +269,10 @@ |
|
|
|
|
workshopId: undefined, |
|
|
|
|
processingTime: undefined, |
|
|
|
|
processingProjection: undefined, |
|
|
|
|
authenticationType: undefined, |
|
|
|
|
authenticationType: 1, |
|
|
|
|
authenticationPic: undefined, |
|
|
|
|
qualityInspection: undefined, |
|
|
|
|
qualityResult: undefined, |
|
|
|
|
qualityInspection: 1, |
|
|
|
|
qualityResult: 1, |
|
|
|
|
qualityImage: undefined, |
|
|
|
|
certificateNumber: undefined, |
|
|
|
|
husbandryImage: undefined, |
|
|
|
@ -292,14 +291,11 @@ |
|
|
|
|
onReady() { |
|
|
|
|
// 设置自定义表单校验规则,必须在节点渲染完毕后执行 |
|
|
|
|
this.$refs.formRef.setRules(this.formRules) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.formData.processingTime = new Date().valueOf() |
|
|
|
|
}, 500) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
/** 提交按钮 */ |
|
|
|
|
async submitForm() { |
|
|
|
|
// 校验主表 |
|
|
|
|
// 校验主表 |
|
|
|
|
try { |
|
|
|
|
await this.$refs['formRef'].validate() |
|
|
|
|
const data = this.formData |
|
|
|
@ -311,7 +307,7 @@ |
|
|
|
|
complete: function() { |
|
|
|
|
setTimeout(function() { |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url: '/pages/index' |
|
|
|
|
url: '/pages/traceability-product/machining/index' |
|
|
|
|
}); |
|
|
|
|
}, 2000); |
|
|
|
|
} |
|
|
|
@ -324,7 +320,6 @@ |
|
|
|
|
// 获取加工时间 |
|
|
|
|
changeLog(e) { |
|
|
|
|
this.formData.processingTime = e |
|
|
|
|
console.log("变",this.formData.processingTime) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 获取销售类型 |
|
|
|
@ -383,6 +378,17 @@ |
|
|
|
|
this.formData.qualityInspection = this.QualityInspectionList[this.CurrenQualityInspection].value |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//获取报损类型列表 |
|
|
|
|
getLossType() { |
|
|
|
|
//报损类型 数据字典查询 |
|
|
|
|
let newData = this.getDictDatas(DICT_TYPE.LOSS_TYPE); |
|
|
|
|
this.LossTypeList = newData |
|
|
|
|
this.LossTypePickerList = newData.map((item) => { |
|
|
|
|
return item.label |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取质检结论列表 |
|
|
|
|
getQualityResult() { |
|
|
|
|
//质检结论情况 数据字典查询 |
|
|
|
@ -420,7 +426,6 @@ |
|
|
|
|
|
|
|
|
|
// 跳转加工材料 |
|
|
|
|
goMaterials() { |
|
|
|
|
console.log('走', this.formData) |
|
|
|
|
const data = encodeURIComponent(JSON.stringify(this.formData)); |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url: '/pages/traceability-product/machining/materialsList?params=' + data |
|
|
|
@ -444,7 +449,6 @@ |
|
|
|
|
ceshiUploadSuccess(res) { |
|
|
|
|
//上传成功 |
|
|
|
|
var _res = JSON.parse(res.data); |
|
|
|
|
console.log('_res', _res); |
|
|
|
|
if (_res.code == 0) { |
|
|
|
|
this.imgList.push(_res.data); |
|
|
|
|
this.formData.authenticationPic = _res.data; |
|
|
|
@ -453,7 +457,6 @@ |
|
|
|
|
ceshiUploadSuccess1(res) { |
|
|
|
|
//上传成功 |
|
|
|
|
var _res = JSON.parse(res.data); |
|
|
|
|
console.log('_res', _res); |
|
|
|
|
if (_res.code == 0) { |
|
|
|
|
this.imgList1.push(_res.data); |
|
|
|
|
this.formData.qualityImage = _res.data; |
|
|
|
@ -469,4 +472,4 @@ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
</script> |
|
|
|
|