123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <div>
- <el-dialog
- title="订单送达"
- width="50%"
- :close-on-click-modal="false"
- :visible.sync="visible">
- <!-- 表单 -->
- <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
- <el-row class="my-row">
- <el-col :span="12">
- <el-form-item label="订单编码" prop="orderCode">
- <el-input v-model="dataForm.orderCode" :disabled="true"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="送达时间" prop="arrivedTime">
- <el-date-picker
- v-model="dataForm.arrivedTime"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="datetime">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row class="my-row">
- <el-form-item label="客户反馈" prop="customerFeedback">
- <el-input type="textarea" v-model="dataForm.customerFeedback" placeholder="客户反馈"></el-input>
- </el-form-item>
- </el-row>
- <el-row class="my-row">
- <upload-component :display="false" :title="'证明附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
- </el-row>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="visible = false">取消</el-button>
- <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import UploadComponent from '../common/upload-component'
- export default {
- name: 'dispatch-arrived',
- components: { UploadComponent },
- data () {
- return {
- visible: false,
- fileList: [],
- dataForm: {},
- dataRule: {
- customerFeedback: [{ required: true, message: '客户反馈不能为空', trigger: 'blur' }],
- arrivedTime: [{ required: true, message: '送达时间不能为空', trigger: 'change' }]
- }
- }
- },
- methods: {
- async init (orderId, orderCode) {
- if (!orderId) return
- this.fileList = []
- this.dataForm = {
- orderId: orderId,
- orderCode: orderCode
- }
- this.visible = true
- },
- uploadSuccess (fileList) {
- this.fileList = fileList
- },
- validateField (type) {
- this.$refs.dataForm.validateField(type)
- },
- // 表单提交
- dataFormSubmit () {
- this.$refs['dataForm'].validate((valid) => {
- if (valid) {
- // 附件检查
- let fList = this.fileList
- if (fList.length > 0) {
- this.dataForm.attachList = []
- for (let i = 0; i < fList.length; i++) {
- this.dataForm.attachList.push({
- fileName: fList[i].name,
- url: fList[i].url
- })
- }
- } else {
- this.$message.error('请上传文件')
- return
- }
- this.$http({
- url: this.$http.adornUrl(`/biz-service/order/arrived`),
- method: 'post',
- data: this.$http.adornData({...this.dataForm})
- }).then(({data}) => {
- if (data && data.code === '200') {
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {
- this.visible = false
- this.$emit('refreshDataList')
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- }
- })
- }
- }
- }
- </script>
- <style scoped>
- </style>
|