| | |
| | | <script lang="ts" setup> |
| | | import {onMounted, reactive, ref, watch} from "vue" |
| | | import {nextTick, onMounted, reactive, ref, watch} from "vue" |
| | | import {useRouter,useRoute} from "vue-router" |
| | | import * as XLXS from "xlsx" |
| | | import {ElMessage, ElMessageBox} from "element-plus" |
| | |
| | | trigger: 'dblclick', |
| | | mode: 'cell', |
| | | showStatus: true, |
| | | showIcon:false |
| | | showIcon:false, |
| | | },//表头参数 |
| | | columns:[ |
| | | {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 }, |
| | |
| | | request.post(`/order/getOrderById/${str}`).then((res) => { |
| | | if(res.code==200){ |
| | | titleUploadData.value = res.data.order |
| | | const customer = titleSelectJson.value.customer.filter(item => item.id === titleUploadData.value.customerId) |
| | | projects.value = customer[0].projectList |
| | | newOrderId.value=titleUploadData.value.orderId |
| | | if(history.state.orderId!=null){ |
| | | titleUploadData.value.orderId='' |
| | |
| | | request.post(`/order/saveOrderTitle`,order).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path:'/main/order/selectOrder'}) |
| | | router.push({path:'/main/order/createOrder',query:{ |
| | | orderId:titleUploadData.value.orderId, |
| | | random:Math.random()}}) |
| | | }else { |
| | | ElMessage.error(res.msg) |
| | | } |
| | |
| | | reviewOrder(2) |
| | | } |
| | | |
| | | let projects = ref([]) |
| | | |
| | | const changeProject = (item) => { |
| | | if(typeof item === 'string'){ |
| | | titleUploadData.value.project = item |
| | | return |
| | | } |
| | | titleUploadData.value.project = item.project |
| | | titleUploadData.value.salesmanId = item.salesmanId |
| | | titleUploadData.value.salesman = item.salesman |
| | | titleUploadData.value.contacts = item.contacts |
| | | titleUploadData.value.contactNumber = item.contactNumber |
| | | } |
| | | |
| | | const changeCustomer = () => { |
| | | const changedCustomerId = titleUploadData.value.customerId |
| | | const customer = titleSelectJson.value.customer.filter(item => item.id === changedCustomerId) |
| | |
| | | titleUploadData.value.project = customer[0].project |
| | | titleUploadData.value.salesmanId = customer[0].salesmanId |
| | | titleUploadData.value.salesman = customer[0].salesman |
| | | titleUploadData.value.contacts = customer[0].contacts |
| | | titleUploadData.value.contactNumber = customer[0].contactNumber |
| | | projects.value = customer[0].projectList |
| | | } |
| | | |
| | | const changeSaleMan = () => { |
| | | const changedSaleManId = titleUploadData.value.salesmanId |
| | | const SaleMan = titleSelectJson.value.saleMan.filter(item => item.id === changedSaleManId) |
| | | titleUploadData.value.salesman = SaleMan[0].basicName |
| | | titleUploadData.value.salesman = SaleMan[0]['basicName'] |
| | | } |
| | | |
| | | const area = (row) => { |
| | |
| | | //行单元格修改修改触发此事件 |
| | | const editClosedEvent = ({ row, column }) => { |
| | | |
| | | |
| | | //判断修改相应的数值修改面积与金额 |
| | | if (['width', 'height', 'quantity', 'price'].includes(column.property)) { |
| | | if(titleUploadData.value?.orderReview!==2){ |
| | |
| | | // } |
| | | // } |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //表格回车,在表格最后一行添加一行空数据 |
| | | const handleKeyDown = (evnt) =>{ |
| | | const handleKeyDown =async (evnt) =>{ |
| | | //判断表示是否为筛选状态 |
| | | if(xGrid.value.isFilter()){ |
| | | return |
| | |
| | | break; |
| | | case 'quantity': |
| | | if(nextRowIndex === length){ |
| | | xGrid.value.insertAt({}, xGrid.value.getTableData.length || -1) |
| | | await editClosedEvent({row,column}) |
| | | xGrid.value.clearEdit() |
| | | let rowNext = row |
| | | delete rowNext._X_ROW_KEY |
| | | xGrid.value.insertAt(rowNext, xGrid.value.getTableData.length || -1) |
| | | //xGrid.value.insertAt({}, xGrid.value.getTableData.length || -1) |
| | | } |
| | | const nextRow = xGrid.value.getTableData().fullData[nextRowIndex] |
| | | xGrid.value.setCurrentRow(nextRow) |
| | |
| | | <div class="order-primary" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>*{{$t('order.project')}}:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model.trim="titleUploadData.project"/></el-col> |
| | | <el-col :span="2"> |
| | | <!-- <el-input v-model.trim="titleUploadData.project"/>--> |
| | | <el-select v-model.trim="titleUploadData.project" |
| | | @change="changeProject" |
| | | clearable placeholder=" " allow-create filterable > |
| | | <el-option v-for="item in projects" |
| | | :label="item.project" |
| | | :value="item"/> |
| | | </el-select> |
| | | |
| | | |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*{{$t('order.customers')}}:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.customerId" |
| | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | <el-dialog v-model="dialogTableVisible" :title="$t('order.processingNote')" style="width: 60%;height:75% "> |
| | | <el-dialog v-model="dialogTableVisible" :draggable="true" :title="$t('order.processingNote')" style="width: 60%;height:75% "> |
| | | <el-input |
| | | v-model="titleUploadData.processingNote" |
| | | type="textarea" |