parent
003e35039e
commit
fef82dd348
@ -0,0 +1,677 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack" />审核
|
||||
<div class="options">
|
||||
<!-- <el-dropdown class="dropdown" placement="bottom">
|
||||
<el-button style="width:70px">
|
||||
更 多<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<template v-if="dataForm.id">
|
||||
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
|
||||
{{ '上一条' }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="next" :disabled='nextDis'>
|
||||
{{ '下一条' }}
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" :loading="continueBtnLoading" :disabled='btnLoading'>
|
||||
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
|
||||
:disabled='continueBtnLoading'>
|
||||
通过</el-button>
|
||||
<el-button type="success" @click="dataFormEdit()" :loading="btnLoading"
|
||||
:disabled='continueBtnLoading'>
|
||||
纠正</el-button>
|
||||
<el-button @click="goBack"> 取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="设备编码" prop="deviceCode">
|
||||
<JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode"
|
||||
placeholder="请选择" propsValue="device_code" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='device_name' field='deviceCode'
|
||||
interfaceId="564713894723988869" :pageSize="20"
|
||||
:columnOptions="deviceCodecolumnOptions" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="桶编码" prop="bucketCode">
|
||||
<JnpfInput v-model="dataForm.bucketCode" @change="changeData('bucketCode', -1)"
|
||||
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="门号" prop="doorNum">
|
||||
<JnpfInput v-model="dataForm.doorNum" @change="changeData('doorNum', -1)"
|
||||
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="回收品大类" prop="productCode">
|
||||
<JnpfRadio v-model="dataForm.productCode" @change="changeData('productCode', -1)"
|
||||
optionType="default" direction="horizontal" size="small"
|
||||
:options="productCodeOptions" :props="productCodeProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="回收品子类" prop="productSubCode">
|
||||
<JnpfRadio v-model="dataForm.productSubCode" @change="changeData('productSubCode', -1)"
|
||||
optionType="default" direction="horizontal" size="small"
|
||||
:options="productSubCodeOptions" :props="productSubCodeProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="机柜清运单号" prop="deviceOrderNo">
|
||||
<JnpfInput v-model="dataForm.deviceOrderNo" @change="changeData('deviceOrderNo', -1)"
|
||||
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="单价" prop="price">
|
||||
<JnpfInputNumber v-model="dataForm.price" @change="changeData('price', -1)"
|
||||
placeholder="数字文本" :precision="2" :step="1" :disabled="true">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="清运重量" prop="weight">
|
||||
<JnpfInputNumber v-model="dataForm.weight" @change="changeData('weight', -1)"
|
||||
placeholder="数字文本" :precision="2" :step="1" :disabled="true">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="总价" prop="totalPrice">
|
||||
<JnpfInputNumber v-model="dataForm.totalPrice" @change="changeData('totalPrice', -1)"
|
||||
placeholder="数字文本" :precision="2" :step="1" :disabled="true">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核后重量" prop="adjustWeight">
|
||||
<JnpfInputNumber v-model="dataForm.adjustWeight"
|
||||
@change="changeData('adjustWeight', -1)" placeholder="数字文本" :precision="2" :step="1"
|
||||
@input="updateAdjustPrice">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核后总价" prop="adjustPrice">
|
||||
<JnpfInputNumber v-model="dataForm.adjustPrice" @change="changeData('adjustPrice', -1)"
|
||||
placeholder="数字文本" :precision="2" :step="1" :disabled="true">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="清运员" prop="cleanUserId">
|
||||
<JnpfUserSelect v-model="dataForm.cleanUserId" @change="changeData('cleanUserId', -1)"
|
||||
placeholder="请选择" selectType="all" :ableIds="ableAll.cleanUserIdableIds" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfUserSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="清运员手机号" prop="phone">
|
||||
<JnpfInput v-model="dataForm.phone" @change="changeData('phone', -1)" placeholder="请输入"
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="入库状态" prop="entryStatus">
|
||||
<JnpfRadio v-model="dataForm.entryStatus" @change="changeData('entryStatus', -1)"
|
||||
optionType="default" direction="horizontal" size="small"
|
||||
:options="entryStatusOptions" :props="entryStatusProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="垃圾袋号" prop="bagNo">
|
||||
<JnpfInput v-model="dataForm.bagNo" @change="changeData('bagNo', -1)" placeholder="请输入"
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核状态" prop="adjustStatus">
|
||||
<JnpfRadio v-model="dataForm.adjustStatus" @change="changeData('adjustStatus', -1)"
|
||||
optionType="default" direction="horizontal" size="small"
|
||||
:options="adjustStatusOptions" :props="adjustStatusProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核说明" prop="adjustComm">
|
||||
<JnpfInput v-model="dataForm.adjustComm" @change="changeData('adjustComm', -1)"
|
||||
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="租户id" prop="tenantId">
|
||||
<JnpfOrganizeSelect v-model="dataForm.tenantId" @change="changeData('tenantId', -1)"
|
||||
placeholder="请选择" selectType="all" :ableIds="ableAll.tenantIdableIds" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfOrganizeSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="24">
|
||||
<jnpf-form-tip-item label="抓拍图片" prop="photo">
|
||||
<JnpfUploadImg v-model="dataForm.photo" @change="changeData('photo', -1)" :fileSize="10"
|
||||
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0">
|
||||
</JnpfUploadImg>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
||||
@select="addForSelect" @close="selectDialogVisible = false" />
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from "vuex";
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
||||
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
orderNo: undefined,
|
||||
deviceCode: undefined,
|
||||
bucketCode: undefined,
|
||||
doorNum: undefined,
|
||||
productCode: undefined,
|
||||
productSubCode: undefined,
|
||||
deviceOrderNo: undefined,
|
||||
price: undefined,
|
||||
weight: undefined,
|
||||
totalPrice: undefined,
|
||||
adjustWeight: undefined,
|
||||
adjustPrice: undefined,
|
||||
cleanUserId: undefined,
|
||||
phone: undefined,
|
||||
entryStatus: undefined,
|
||||
bagNo: undefined,
|
||||
adjustStatus: undefined,
|
||||
adjustComm: undefined,
|
||||
tenantId: [],
|
||||
photo: [],
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule:
|
||||
{
|
||||
},
|
||||
deviceCodecolumnOptions: [{ "label": "设备编码", "value": "device_code" }, { "label": "设备名称", "value": "device_name" },],
|
||||
productCodeOptions: [],
|
||||
productCodeProps: { "label": "name", "value": "id" },
|
||||
productSubCodeOptions: [],
|
||||
productSubCodeProps: { "label": "name", "value": "id" },
|
||||
entryStatusOptions: [{ "fullName": "未入库", "id": "0" }, { "fullName": "已入库", "id": "1" }],
|
||||
entryStatusProps: { "label": "fullName", "value": "id" },
|
||||
adjustStatusOptions: [{ "fullName": "未审核", "id": "0" }, { "fullName": "已审核", "id": "1" }],
|
||||
adjustStatusProps: { "label": "fullName", "value": "id" },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
orderNo: [],
|
||||
deviceCode: [],
|
||||
bucketCode: [],
|
||||
doorNum: [],
|
||||
productCode: [],
|
||||
productSubCode: [{ "dataType": "varchar", "defaultValue": "", "field": "parent_id", "fieldName": "", "id": "ZBu5m72", "jnpfKey": "radio", "relationField": "productCode", "required": "0" }],
|
||||
deviceOrderNo: [],
|
||||
price: [],
|
||||
weight: [],
|
||||
totalPrice: [],
|
||||
adjustWeight: [],
|
||||
adjustPrice: [],
|
||||
cleanUserId: [],
|
||||
phone: [],
|
||||
entryStatus: [],
|
||||
bagNo: [],
|
||||
adjustStatus: [],
|
||||
adjustComm: [],
|
||||
tenantId: [],
|
||||
photo: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
updateAdjustPrice() {
|
||||
this.dataForm.adjustPrice = this.dataForm.adjustWeight * this.dataForm.price;
|
||||
},
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
this.nextDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
this.prevDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/scm/RecycleCleanOrder/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
this.getproductCodeOptions();
|
||||
this.getproductSubCodeOptions();
|
||||
},
|
||||
getproductCodeOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productCode))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('565507078836203205', template).then(res => {
|
||||
let data = res.data
|
||||
this.productCodeOptions = data
|
||||
this.changeDataFormData(1, 'productCode', 'productCode', index, '')
|
||||
})
|
||||
},
|
||||
getproductSubCodeOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productSubCode))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('565508644465028805', template).then(res => {
|
||||
let data = res.data
|
||||
this.productSubCodeOptions = data
|
||||
this.changeDataFormData(1, 'productSubCode', 'productSubCode', index, '')
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/scm/RecycleCleanOrder/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.updateAdjustPrice();
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormEdit(type) {
|
||||
this.updateAdjustPrice();
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.requestEdit()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
_data.adjustStatus = "1";
|
||||
_data.lastModifyTime = null;
|
||||
if (_data.adjustWeight == 0) {
|
||||
this.$message.error('审核后重量不能为 0');
|
||||
return;
|
||||
}
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
request({
|
||||
url: '/api/scm/RecycleCleanOrder/audit',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
},
|
||||
requestEdit() {
|
||||
let _data = this.dataList()
|
||||
_data.adjustStatus = "2";
|
||||
_data.lastModifyTime = null;
|
||||
if (_data.adjustWeight == 0) {
|
||||
this.$message.error('审核后重量不能为 0');
|
||||
return;
|
||||
}
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
request({
|
||||
url: '/api/scm/RecycleCleanOrder/audit',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
},
|
||||
openSelectDialog(key) {
|
||||
this.currTableConf = this.addTableConf[key]
|
||||
this.currVmodel = key
|
||||
this.selectDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectDialog.init()
|
||||
})
|
||||
},
|
||||
addForSelect(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let t = data[i]
|
||||
if (this['get' + this.currVmodel]) {
|
||||
this['get' + this.currVmodel](t)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||
let timeDataValue = null
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
previousDate = getLaterTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,974 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack" />审核
|
||||
<div class="options">
|
||||
<!-- <el-dropdown class="dropdown" placement="bottom">
|
||||
<el-button style="width:70px">
|
||||
更 多<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<template v-if="dataForm.id">
|
||||
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
|
||||
{{ '上一条' }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="next" :disabled='nextDis'>
|
||||
{{ '下一条' }}
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
|
||||
:loading="continueBtnLoading" :disabled='btnLoading'>
|
||||
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
|
||||
:disabled='continueBtnLoading'>
|
||||
通过</el-button>
|
||||
<el-button type="success" @click="dataFormEdit()" :loading="btnLoading"
|
||||
:disabled='continueBtnLoading'>
|
||||
纠正</el-button>
|
||||
<el-button @click="goBack"> 取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="150px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<!-- <el-col :span="24"> -->
|
||||
<!-- <el-collapse :accordion="false" v-model="activeripxar" class="mb-20">
|
||||
<el-collapse-item title="投递情况" name="1">
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="投递单号" prop="orderNo">
|
||||
<JnpfInput v-model="dataForm.orderNo" @change="changeData('orderNo', -1)"
|
||||
placeholder="系统自动生成" readonly :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="投递机柜" prop="deviceCode">
|
||||
<JnpfSelect v-model="dataForm.deviceCode"
|
||||
@change="changeData('deviceCode', -1)" placeholder="请选择" clearable
|
||||
:style='{ "width": "100%" }' :options="deviceCodeOptions"
|
||||
:props="deviceCodeProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="投递人手机" prop="phone">
|
||||
<JnpfInput v-model="dataForm.phone" @change="changeData('phone', -1)"
|
||||
placeholder="投递员手机" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="桶编号" prop="doorNum">
|
||||
<JnpfSelect v-model="dataForm.doorNum" @change="changeData('doorNum', -1)"
|
||||
placeholder="请选择" clearable :style='{ "width": "100%" }'
|
||||
:options="doorNumOptions" :props="doorNumProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="回收品大类" prop="productCode">
|
||||
<JnpfSelect v-model="dataForm.productCode"
|
||||
@change="changeData('productCode', -1)" placeholder="请选择" clearable
|
||||
:style='{ "width": "100%" }' :options="productCodeOptions"
|
||||
:props="productCodeProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="回收品子类" prop="productSubCode">
|
||||
<JnpfCascader v-model="dataForm.productSubCode"
|
||||
@change="changeData('productSubCode', -1)" placeholder="请选择"
|
||||
show-all-levels clearable :style='{ "width": "100%" }' separator="/"
|
||||
:options="productSubCodeOptions" :props="productSubCodeProps">
|
||||
</JnpfCascader>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="上报重量" prop="reportWeight">
|
||||
<JnpfInput v-model="dataForm.reportWeight"
|
||||
@change="changeData('reportWeight', -1)" placeholder="请输入"
|
||||
addonAfter="KG" :style='{ "width": "100%" }' :disabled="true">
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="单价" prop="price">
|
||||
<JnpfInput v-model="dataForm.price" @change="changeData('price', -1)"
|
||||
placeholder="请输入" addonAfter="元" clearable :style='{ "width": "100%" }' :disabled="true">
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="总价" prop="totalPrice">
|
||||
<JnpfInput v-model="dataForm.totalPrice"
|
||||
@change="changeData('totalPrice', -1)" placeholder="审核后本单总价"
|
||||
addonAfter="元" clearable :style='{ "width": "100%" }' :disabled="true">
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="桶内原重" prop="originalWeight">
|
||||
<JnpfInput v-model="dataForm.originalWeight"
|
||||
@change="changeData('originalWeight', -1)" placeholder="投递前桶内重量"
|
||||
addonAfter="KG" :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核重量" prop="adjustWeight">
|
||||
<JnpfInputNumber v-model="dataForm.adjustWeight"
|
||||
@change="changeData('adjustWeight', -1)"placeholder="数字文本" :precision="2" :step="1" @input="updateAdjustPrice"
|
||||
>
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核总价" prop="adjustPrice">
|
||||
<JnpfInput v-model="dataForm.adjustPrice"
|
||||
@change="changeData('adjustPrice', -1)" placeholder="审核后本单总价"
|
||||
addonAfter="元" clearable :style='{ "width": "100%" }' :disabled="true">
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核状态 " prop="adjustStatus">
|
||||
<JnpfRadio v-model="dataForm.adjustStatus"
|
||||
@change="changeData('adjustStatus', -1)" optionType="button"
|
||||
direction="horizontal" size="small" :options="adjustStatusOptions"
|
||||
:props="adjustStatusProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="审核设置" prop="adjustSet">
|
||||
<JnpfRadio v-model="dataForm.adjustSet" @change="changeData('adjustSet', -1)"
|
||||
disabled optionType="button" direction="horizontal" size="small"
|
||||
:options="adjustSetOptions" :props="adjustSetProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="审核说明" prop="adjustComm">
|
||||
<JnpfTextarea v-model="dataForm.adjustComm"
|
||||
@change="changeData('adjustComm', -1)" placeholder="请输入"
|
||||
:style='{ "width": "100%" }' true type="textarea"
|
||||
:autosize='{ "minRows": 1, "maxRows": 4 }'>
|
||||
</JnpfTextarea>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24">
|
||||
<jnpf-form-tip-item label="投递照片" prop="photo">
|
||||
<JnpfUploadImg v-model="dataForm.photo" @change="changeData('photo', -1)"
|
||||
disabled :fileSize="2" sizeUnit="MB" :limit="4" pathType="defaultPath"
|
||||
:isAccount="0">
|
||||
</JnpfUploadImg>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="桶编号" prop="bucketCode">
|
||||
<JnpfCascader v-model="dataForm.bucketCode"
|
||||
@change="changeData('bucketCode', -1)" placeholder="请选择" show-all-levels
|
||||
clearable :style='{ "width": "100%" }' separator="/"
|
||||
:options="bucketCodeOptions" :props="bucketCodeProps">
|
||||
</JnpfCascader>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="垃圾袋编号" prop="bagNo">
|
||||
<JnpfInput v-model="dataForm.bagNo" @change="changeData('bagNo', -1)"
|
||||
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="机柜单号" prop="deviceOrderNo">
|
||||
<JnpfInput v-model="dataForm.deviceOrderNo"
|
||||
@change="changeData('deviceOrderNo', -1)" placeholder="请输入" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="登录方式" prop="loginType">
|
||||
<JnpfRadio v-model="dataForm.loginType" @change="changeData('loginType', -1)"
|
||||
optionType="button" direction="horizontal" size="small"
|
||||
:options="loginTypeOptions" :props="loginTypeProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<!-- </el-collapse-item> -->
|
||||
<el-collapse-item title="清运情况" name="2">
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="清运单号" prop="cleanNo">
|
||||
<JnpfInput v-model="dataForm.cleanNo" @change="changeData('cleanNo', -1)"
|
||||
placeholder="请输入" readonly clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="清运员手机号" prop="cleanerPhone">
|
||||
<JnpfInput v-model="dataForm.cleanerPhone"
|
||||
@change="changeData('cleanerPhone', -1)" placeholder="请输入" readonly
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="清运状态" prop="cleanStatus">
|
||||
<JnpfRadio v-model="dataForm.cleanStatus"
|
||||
@change="changeData('cleanStatus', -1)" optionType="button"
|
||||
direction="horizontal" size="small" :options="cleanStatusOptions"
|
||||
:props="cleanStatusProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="公司id" prop="companyId">
|
||||
<JnpfOpenData v-model="dataForm.companyId"
|
||||
@change="changeData('companyId', -1)" placeholder="系统自动生成" readonly
|
||||
:style='{ "width": "100%" }' type="currOrganize" showLevel="all">
|
||||
</JnpfOpenData>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="修改时间" prop="lastModifyTime">
|
||||
<JnpfInput v-model="dataForm.lastModifyTime"
|
||||
@change="changeData('lastModifyTime', -1)" placeholder="系统自动生成" readonly
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="修改用户" prop="lastModifyUserId">
|
||||
<JnpfInput v-model="dataForm.lastModifyUserId"
|
||||
@change="changeData('lastModifyUserId', -1)" placeholder="系统自动生成"
|
||||
readonly :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="组织JSONID" prop="organizeJsonId">
|
||||
<JnpfOpenData v-model="dataForm.organizeJsonId"
|
||||
@change="changeData('organizeJsonId', -1)" placeholder="系统自动生成" readonly
|
||||
:style='{ "width": "100%" }' type="currOrganize" showLevel="all">
|
||||
</JnpfOpenData>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</el-collapse-item>
|
||||
<!-- </el-collapse>
|
||||
</el-col> -->
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
||||
@select="addForSelect" @close="selectDialogVisible = false" />
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from "vuex";
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
||||
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
orderNo: undefined,
|
||||
deviceCode: undefined,
|
||||
phone: undefined,
|
||||
doorNum: undefined,
|
||||
productCode: "542988676150333899",
|
||||
productSubCode: [],
|
||||
reportWeight: undefined,
|
||||
price: undefined,
|
||||
totalPrice: undefined,
|
||||
originalWeight: undefined,
|
||||
adjustWeight: undefined,
|
||||
adjustPrice: undefined,
|
||||
adjustStatus: undefined,
|
||||
adjustSet: undefined,
|
||||
deliverId: undefined,
|
||||
adjustComm: undefined,
|
||||
photo: [],
|
||||
bucketCode: [],
|
||||
bagNo: undefined,
|
||||
deviceOrderNo: undefined,
|
||||
loginType: undefined,
|
||||
cleanNo: undefined,
|
||||
cleanerPhone: undefined,
|
||||
cleanStatus: undefined,
|
||||
companyId: undefined,
|
||||
lastModifyTime: undefined,
|
||||
lastModifyUserId: undefined,
|
||||
organizeJsonId: undefined,
|
||||
creatorTime: undefined,
|
||||
creatorUserId: undefined,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
activeripxar: ["1", "2"],
|
||||
dataRule:
|
||||
{
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
message: '投递员手机',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
doorNum: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
productCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
reportWeight: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
price: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||
message: '请输入正确的金额',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
totalPrice: [
|
||||
{
|
||||
required: true,
|
||||
message: '审核后本单总价',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||
message: '请输入正确的重量',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
originalWeight: [
|
||||
{
|
||||
required: true,
|
||||
message: '投递前桶内重量',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
adjustWeight: [
|
||||
{
|
||||
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||
message: '请输入正确的重量',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
adjustPrice: [
|
||||
{
|
||||
required: true,
|
||||
message: '审核后本单总价',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||
message: '请输入正确的重量',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
adjustStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
bucketCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
bagNo: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
deviceOrderNo: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
cleanerPhone: [
|
||||
{
|
||||
pattern: /^1[3456789]\d{9}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
cleanStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
deviceCodeOptions: [],
|
||||
deviceCodeProps: { "label": "device_name", "value": "device_code" },
|
||||
doorNumOptions: [{ "fullName": "1号", "id": "1" }, { "fullName": "2号", "id": "2" }, { "fullName": "3号", "id": "3" }, { "fullName": "4号", "id": "4" }, { "fullName": "5号", "id": "5" }, { "fullName": "6号", "id": "6" }, { "fullName": "7号", "id": "7" }, { "fullName": "8号", "id": "8" }, { "fullName": "9号", "id": "9" }, { "fullName": "10号", "id": "10" }, { "fullName": "11号", "id": "11" }, { "fullName": "12号", "id": "12" }],
|
||||
doorNumProps: { "label": "fullName", "value": "id" },
|
||||
productCodeOptions: [],
|
||||
productCodeProps: { "label": "name", "value": "id" },
|
||||
productSubCodeOptions: [],
|
||||
productSubCodeProps: { "label": "name", "value": "id", "children": "children" },
|
||||
adjustStatusOptions: [],
|
||||
adjustStatusProps: { "label": "fullName", "value": "enCode" },
|
||||
adjustSetOptions: [],
|
||||
adjustSetProps: { "label": "fullName", "value": "enCode" },
|
||||
bucketCodeOptions: [],
|
||||
bucketCodeProps: { "label": "show_name", "value": "bucket_code", "children": "children" },
|
||||
loginTypeOptions: [{ "fullName": "扫码", "id": "1" }, { "fullName": "手机号", "id": "2" }],
|
||||
loginTypeProps: { "label": "fullName", "value": "id" },
|
||||
cleanStatusOptions: [{ "fullName": "未清运", "id": "0" }, { "fullName": "已清运", "id": "1" }],
|
||||
cleanStatusProps: { "label": "fullName", "value": "id" },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
orderNo: [],
|
||||
deviceCode: [],
|
||||
phone: [],
|
||||
doorNum: [],
|
||||
productCode: [],
|
||||
productSubCode: [{ "dataType": "varchar", "defaultValue": "", "field": "parent_id", "fieldName": "", "id": "ZBu5m72", "jnpfKey": "select", "relationField": "productCode", "required": "0" }],
|
||||
reportWeight: [],
|
||||
price: [],
|
||||
totalPrice: [],
|
||||
originalWeight: [],
|
||||
adjustWeight: [],
|
||||
adjustPrice: [],
|
||||
adjustStatus: [],
|
||||
adjustSet: [],
|
||||
deliverId: [],
|
||||
adjustComm: [],
|
||||
photo: [],
|
||||
bucketCode: [{ "dataType": "varchar", "defaultValue": "", "field": "device_code", "fieldName": "", "id": "ow3vw72", "jnpfKey": "select", "relationField": "deviceCode", "required": "0" }],
|
||||
bagNo: [],
|
||||
deviceOrderNo: [],
|
||||
loginType: [],
|
||||
cleanNo: [],
|
||||
cleanerPhone: [],
|
||||
cleanStatus: [],
|
||||
companyId: [],
|
||||
lastModifyTime: [],
|
||||
lastModifyUserId: [],
|
||||
organizeJsonId: [],
|
||||
creatorTime: [],
|
||||
creatorUserId: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
updateAdjustPrice() {
|
||||
this.dataForm.adjustPrice = this.dataForm.adjustWeight * this.dataForm.price;
|
||||
},
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
this.nextDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
this.prevDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/scm/RecycleDeliveryOrder/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
this.getdeviceCodeOptions();
|
||||
this.getproductCodeOptions();
|
||||
this.getproductSubCodeOptions();
|
||||
this.getadjustStatusOptions();
|
||||
this.getadjustSetOptions();
|
||||
this.getbucketCodeOptions();
|
||||
},
|
||||
getdeviceCodeOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.deviceCode))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('564713894723988869', template).then(res => {
|
||||
let data = res.data
|
||||
this.deviceCodeOptions = data
|
||||
this.changeDataFormData(1, 'deviceCode', 'deviceCode', index, '')
|
||||
})
|
||||
},
|
||||
getproductCodeOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productCode))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('565507078836203205', template).then(res => {
|
||||
let data = res.data
|
||||
this.productCodeOptions = data
|
||||
this.changeDataFormData(1, 'productCode', 'productCode', index, '542988676150333899')
|
||||
})
|
||||
},
|
||||
getproductSubCodeOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productSubCode))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('565508644465028805', template).then(res => {
|
||||
let data = res.data
|
||||
this.productSubCodeOptions = data
|
||||
this.changeDataFormData(1, 'productSubCode', 'productSubCode', index, [])
|
||||
})
|
||||
},
|
||||
getadjustStatusOptions() {
|
||||
getDictionaryDataSelector('565908107083911685').then(res => {
|
||||
this.adjustStatusOptions = res.data.list
|
||||
})
|
||||
},
|
||||
getadjustSetOptions() {
|
||||
getDictionaryDataSelector('565907359503749637').then(res => {
|
||||
this.adjustSetOptions = res.data.list
|
||||
})
|
||||
},
|
||||
getbucketCodeOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.bucketCode))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('565524506681020549', template).then(res => {
|
||||
let data = res.data
|
||||
this.bucketCodeOptions = data
|
||||
this.changeDataFormData(1, 'bucketCode', 'bucketCode', index, [])
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/scm/RecycleDeliveryOrder/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.updateAdjustPrice();
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormEdit(type) {
|
||||
this.updateAdjustPrice();
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.requestEdit()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
_data.adjustStatus = "1";
|
||||
_data.lastModifyTime = null;
|
||||
if (_data.adjustWeight == 0) {
|
||||
this.$message.error('审核后重量不能为 0');
|
||||
return;
|
||||
}
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
request({
|
||||
url: '/api/scm/RecycleDeliveryOrder/audit',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
},
|
||||
requestEdit() {
|
||||
let _data = this.dataList()
|
||||
_data.adjustStatus = "2";
|
||||
_data.lastModifyTime = null;
|
||||
if (_data.adjustWeight == 0) {
|
||||
this.$message.error('审核后重量不能为 0');
|
||||
return;
|
||||
}
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
request({
|
||||
url: '/api/scm/RecycleDeliveryOrder/audit',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
},
|
||||
openSelectDialog(key) {
|
||||
this.currTableConf = this.addTableConf[key]
|
||||
this.currVmodel = key
|
||||
this.selectDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectDialog.init()
|
||||
})
|
||||
},
|
||||
addForSelect(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let t = data[i]
|
||||
if (this['get' + this.currVmodel]) {
|
||||
this['get' + this.currVmodel](t)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||
let timeDataValue = null
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
previousDate = getLaterTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
Loading…
Reference in new issue