|
@@ -235,16 +235,16 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="订单来源" prop="source">
|
|
|
- <el-select v-model="queryParams.source" placeholder="请选择是否支付" clearable size="small">
|
|
|
- <el-option
|
|
|
- v-for="dict in sourceOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="订单来源" prop="source">
|
|
|
+ <el-select v-model="queryParams.source" placeholder="请选择是否支付" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in sourceOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item label="下单时间" prop="createTime">
|
|
|
<el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"></el-date-picker>
|
|
@@ -265,123 +265,162 @@
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- plain
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- :loading="exportLoading"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['his:storeOrder:export']"
|
|
|
- >财务导出</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- plain
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- :loading="exportLoading"
|
|
|
- @click="handleOrderExport"
|
|
|
- v-hasPermi="['store:storeOrder:export']"
|
|
|
- >导出订单</el-button>
|
|
|
+ </el-form>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['his:storeOrder:export']"
|
|
|
+ >财务导出</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- plain
|
|
|
- icon="el-icon-upload2"
|
|
|
- size="mini"
|
|
|
- @click="handleImport"
|
|
|
- v-hasPermi="['his:storeOrder:exportDeliver']"
|
|
|
- >导入发货</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- plain
|
|
|
- icon="el-icon-upload2"
|
|
|
- size="mini"
|
|
|
- @click="handleImportExpress"
|
|
|
- v-hasPermi="['store:storeOrder:importExpress']"
|
|
|
- >导入银行回单</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>
|
|
|
- <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
|
|
|
- <el-tab-pane label="全部订单" name="10"></el-tab-pane>
|
|
|
- <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- <el-table height="500" v-loading="loading" border :data="orderList" @selection-change="handleSelectionChange" >
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="处方单编号" align="center" prop="prescribeCode" width="180px"/>
|
|
|
- <el-table-column label="药品订单号" align="center" prop="orderCode" width="180px"/>
|
|
|
- <el-table-column label="所属公司" align="center" prop="companyName" />
|
|
|
- <el-table-column label="员工" align="center" prop="companyUserName" />
|
|
|
- <el-table-column label="店铺名称" align="center" prop="storeName" />
|
|
|
- <el-table-column label="就诊人" align="center" prop="patientName" />
|
|
|
- <el-table-column label="收货人" align="center" prop="userName" />
|
|
|
- <el-table-column label="套餐名称" align="center" prop="packageName" />
|
|
|
- <el-table-column label="套餐别名" align="center" prop="packageSecondName" width="100px"/>
|
|
|
- <el-table-column label="应收金额" align="center" prop="payPrice" />
|
|
|
- <el-table-column label="实收金额" align="center" prop="payMoney" />
|
|
|
- <el-table-column label="支付方式" align="center" prop="payType" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="PayOptions" :value="scope.row.payType"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
|
|
|
- <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
|
|
|
- <el-table-column label="订单状态" align="center" prop="status" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="orderOptions" :value="scope.row.status"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="订单来源" align="center" prop="source" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="sourceOptions" :value="scope.row.source"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="deliveryStatusOptions" :value="scope.row.deliveryStatus"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="结算状态" align="center" prop="deliveryPayStatus" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="deliveryPayStatusOptions" :value="scope.row.deliveryPayStatus"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100px">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleOrderExport"
|
|
|
+ v-hasPermi="['store:storeOrder:export']"
|
|
|
+ >导出订单</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ type="info"
|
|
|
+ plain
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ size="mini"
|
|
|
+ @click="handleImport"
|
|
|
+ v-hasPermi="['his:storeOrder:exportDeliver']"
|
|
|
+ >导入发货</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ plain
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ size="mini"
|
|
|
+ @click="handleImportExpress"
|
|
|
+ v-hasPermi="['store:storeOrder:importExpress']"
|
|
|
+ >导入银行回单</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5" v-if="orderStatus == 5"> <!--待推送erp-->
|
|
|
+ <el-tooltip content="默认erp推送手机号" placement="top">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-phone"
|
|
|
+ size="mini"
|
|
|
+ @click="handleErpPhone"
|
|
|
+ v-hasPermi="['store:storeOrder:erpphone']"
|
|
|
+ >推送手机号码</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5" v-if="orderStatus == 5">
|
|
|
+ <el-tooltip content="批量设置erp推送手机号" placement="top">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-phone"
|
|
|
size="mini"
|
|
|
- type="text"
|
|
|
- @click="handledetails(scope.row)"
|
|
|
- >查看
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- <el-drawer
|
|
|
- :with-header="false"
|
|
|
- size="75%"
|
|
|
- :title="show.title" :visible.sync="show.open">
|
|
|
- <storeOrderDetails ref="Details" />
|
|
|
- </el-drawer>
|
|
|
- <!-- 用户导入对话框 -->
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="setErpPhone"
|
|
|
+ v-hasPermi="['his:storeOrder:createErpOrder']"
|
|
|
+ >设置推送手机</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5" v-if="orderStatus == 5">
|
|
|
+ <el-tooltip content="批量推送erp" placement="top">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-s-cooperation"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="createErpOrder"
|
|
|
+ v-hasPermi="['his:storeOrder:createErpOrder']"
|
|
|
+ >创建erp</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+ <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
|
|
|
+ <el-tab-pane label="全部订单" name="10"></el-tab-pane>
|
|
|
+ <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-table height="500" v-loading="loading" border :data="orderList" @selection-change="handleSelectionChange" >
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="处方单编号" align="center" prop="prescribeCode" width="180px"/>
|
|
|
+ <el-table-column label="药品订单号" align="center" prop="orderCode" width="180px"/>
|
|
|
+ <el-table-column label="所属公司" align="center" prop="companyName" />
|
|
|
+ <el-table-column label="员工" align="center" prop="companyUserName" />
|
|
|
+ <el-table-column label="店铺名称" align="center" prop="storeName" />
|
|
|
+ <el-table-column label="就诊人" align="center" prop="patientName" />
|
|
|
+ <el-table-column label="收货人" align="center" prop="userName" />
|
|
|
+ <el-table-column label="套餐名称" align="center" prop="packageName" />
|
|
|
+ <el-table-column label="套餐别名" align="center" prop="packageSecondName" width="100px"/>
|
|
|
+ <el-table-column label="应收金额" align="center" prop="payPrice" />
|
|
|
+ <el-table-column label="实收金额" align="center" prop="payMoney" />
|
|
|
+ <el-table-column label="支付方式" align="center" prop="payType" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="PayOptions" :value="scope.row.payType"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
|
|
|
+ <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
|
|
|
+ <el-table-column label="订单状态" align="center" prop="status" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="orderOptions" :value="scope.row.status"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="订单来源" align="center" prop="source" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="sourceOptions" :value="scope.row.source"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="deliveryStatusOptions" :value="scope.row.deliveryStatus"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="结算状态" align="center" prop="deliveryPayStatus" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="deliveryPayStatusOptions" :value="scope.row.deliveryPayStatus"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="ERP电话" align="center" prop="erpPhone" v-if="orderStatus == 5"/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handledetails(scope.row)"
|
|
|
+ >查看
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ <el-drawer
|
|
|
+ :with-header="false"
|
|
|
+ size="75%"
|
|
|
+ :title="show.title" :visible.sync="show.open">
|
|
|
+ <storeOrderDetails ref="Details" />
|
|
|
+ </el-drawer>
|
|
|
+ <!-- 用户导入对话框 -->
|
|
|
|
|
|
- <el-dialog :title="importExpress.title" :visible.sync="importExpress.open" width="400px" append-to-body>
|
|
|
+ <el-dialog :title="importExpress.title" :visible.sync="importExpress.open" width="400px" append-to-body>
|
|
|
<el-upload
|
|
|
ref="importExpress"
|
|
|
:limit="1"
|
|
@@ -398,7 +437,7 @@
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
<div class="el-upload__tip text-center" slot="tip">
|
|
|
<div class="el-upload__tip" slot="tip">
|
|
|
- <!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据 -->
|
|
|
+ <!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据 -->
|
|
|
</div>
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplateExpress">下载模板</el-link>
|
|
@@ -410,41 +449,104 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
- <el-upload
|
|
|
- ref="upload"
|
|
|
- :limit="1"
|
|
|
- accept=".xlsx, .xls"
|
|
|
- :headers="upload.headers"
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
- :disabled="upload.isUploading"
|
|
|
- :on-progress="handleFileUploadProgress"
|
|
|
- :on-success="handleFileSuccess"
|
|
|
- :auto-upload="false"
|
|
|
- drag
|
|
|
- >
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
- <div class="el-upload__tip text-center" slot="tip">
|
|
|
- <div class="el-upload__tip" slot="tip">
|
|
|
+ <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
+ <el-upload
|
|
|
+ ref="upload"
|
|
|
+ :limit="1"
|
|
|
+ accept=".xlsx, .xls"
|
|
|
+ :headers="upload.headers"
|
|
|
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
+ :disabled="upload.isUploading"
|
|
|
+ :on-progress="handleFileUploadProgress"
|
|
|
+ :on-success="handleFileSuccess"
|
|
|
+ :auto-upload="false"
|
|
|
+ drag
|
|
|
+ >
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
+ <div class="el-upload__tip" slot="tip">
|
|
|
+ </div>
|
|
|
+ <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
+ <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
</div>
|
|
|
- <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
- <el-button @click="upload.open = false">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ </el-upload>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 设置推送手机对话框 -->
|
|
|
+ <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
|
|
|
+ <div style="margin-bottom: 20px;">
|
|
|
+ <el-button type="primary" size="small" @click="handleAddPhone">新增手机号</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="phoneList" border style="width: 100%">
|
|
|
+ <el-table-column prop="phone" label="手机号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-if="scope.row.editing"
|
|
|
+ v-model="scope.row.phone"
|
|
|
+ placeholder="请输入手机号"
|
|
|
+ @blur="validatePhone(scope.row)"
|
|
|
+ @keyup.enter.native="handleSavePhone(scope.$index)"
|
|
|
+ />
|
|
|
+ <span v-else>{{ scope.row.phone }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.editing"
|
|
|
+ type="success"
|
|
|
+ size="mini"
|
|
|
+ @click="handleSavePhone(scope.$index)"
|
|
|
+ >保存</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.editing"
|
|
|
+ type="info"
|
|
|
+ size="mini"
|
|
|
+ @click="handleCancelEdit(scope.$index)"
|
|
|
+ >取消</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="!scope.row.editing"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="handleEditPhone(scope.$index)"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ size="mini"
|
|
|
+ @click="handleDeletePhone(scope.$index)"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="handleSavePhoneList">确 定</el-button>
|
|
|
+ <el-button @click="handleCancelPhoneDialog">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog :title="erpPhone.title" :visible.sync="setPhoneOpen" width="600px" append-to-body>
|
|
|
+ <el-select v-model="erpPhoneValue" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in phoneList"
|
|
|
+ :key="item.phone"
|
|
|
+ :label="item.phone"
|
|
|
+ :value="item.phone">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitErpPhone">确 定</el-button>
|
|
|
+ <el-button @click="handleCancelErpPhone">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listOrder, getOrder, delOrder, addOrder,importExpressTemplate, updateOrder, exportOrder,importTemplate,exportOrder2 } from "@/api/his/storeOrder";
|
|
|
+import { listOrder, getOrder, delOrder, addOrder,importExpressTemplate, updateOrder, exportOrder,importTemplate,exportOrder2,queryErpPhone,saveErpPhone,editErpPhone,batchCreateErpOrder } from "@/api/his/storeOrder";
|
|
|
import storeOrderDetails from '../../components/his/storeOrderDetails.vue';
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import {listStore} from "@/api/his/storeProduct";
|
|
@@ -463,6 +565,15 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ erpPhoneValue:null,
|
|
|
+ setPhoneOpen:false,
|
|
|
+ erpPhone:{
|
|
|
+ open:false,
|
|
|
+ title:"设置推送手机号"
|
|
|
+ },
|
|
|
+ phoneList: [], // 手机号列表
|
|
|
+ originalPhoneList: [], // 原始手机号列表,用于取消时恢复
|
|
|
+ orderStatus:null,
|
|
|
scheduleOptions:[],
|
|
|
companys:[],
|
|
|
deptOptions:[],
|
|
@@ -673,6 +784,165 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ createErpOrder(){
|
|
|
+ this.$confirm('确认创建erp?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ batchCreateErpOrder(this.ids).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.$message.success('创建成功');
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCancelErpPhone(){
|
|
|
+ this.erpPhoneValue = null;
|
|
|
+ this.setPhoneOpen = false;
|
|
|
+ },
|
|
|
+ submitErpPhone(){
|
|
|
+ const param = {orderIds:this.ids,erpPhone:this.erpPhoneValue};
|
|
|
+ editErpPhone(param).then(response=>{
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.setPhoneOpen = false;
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setErpPhone(){
|
|
|
+ this.getErpPhoneList();
|
|
|
+ this.setPhoneOpen = true;
|
|
|
+ },
|
|
|
+ // 设置推送手机相关方法
|
|
|
+ handleErpPhone(){
|
|
|
+ //查询配置手机号
|
|
|
+ this.getErpPhoneList();
|
|
|
+ this.erpPhone.open = true
|
|
|
+ },
|
|
|
+ getErpPhoneList(){
|
|
|
+ queryErpPhone().then(response =>{
|
|
|
+ if(response.data && response.data != null && response.data.length >0){
|
|
|
+ const phones = response.data.filter(phone => phone.trim());
|
|
|
+ this.phoneList = phones.map(phone => ({
|
|
|
+ phone: phone.trim(),
|
|
|
+ editing: false,
|
|
|
+ originalPhone: phone.trim()
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存原始数据用于取消操作
|
|
|
+ this.originalPhoneList = this.phoneList;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 新增手机号
|
|
|
+ handleAddPhone() {
|
|
|
+ this.phoneList.push({
|
|
|
+ phone: '',
|
|
|
+ editing: true,
|
|
|
+ originalPhone: '',
|
|
|
+ isNew: true
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 编辑手机号
|
|
|
+ handleEditPhone(index) {
|
|
|
+ this.$set(this.phoneList[index], 'editing', true);
|
|
|
+ this.$set(this.phoneList[index], 'originalPhone', this.phoneList[index].phone);
|
|
|
+ },
|
|
|
+ // 保存手机号
|
|
|
+ handleSavePhone(index) {
|
|
|
+ const phone = this.phoneList[index].phone.trim();
|
|
|
+ if (!phone) {
|
|
|
+ this.$message.error('手机号不能为空');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.validatePhoneFormat(phone)) {
|
|
|
+ this.$message.error('请输入正确的手机号格式');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 检查是否重复
|
|
|
+ const duplicateIndex = this.phoneList.findIndex((item, idx) =>
|
|
|
+ idx !== index && item.phone === phone
|
|
|
+ );
|
|
|
+ if (duplicateIndex !== -1) {
|
|
|
+ this.$message.error('手机号已存在');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$set(this.phoneList[index], 'editing', false);
|
|
|
+ this.$set(this.phoneList[index], 'isNew', false);
|
|
|
+ },
|
|
|
+ // 取消编辑
|
|
|
+ handleCancelEdit(index) {
|
|
|
+ if (this.phoneList[index].isNew) {
|
|
|
+ // 如果是新增的,直接删除
|
|
|
+ this.phoneList.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ // 如果是编辑的,恢复原值
|
|
|
+ this.$set(this.phoneList[index], 'phone', this.phoneList[index].originalPhone);
|
|
|
+ this.$set(this.phoneList[index], 'editing', false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 删除手机号
|
|
|
+ handleDeletePhone(index) {
|
|
|
+ this.$confirm('确认删除该手机号?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.phoneList.splice(index, 1);
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 验证手机号格式
|
|
|
+ validatePhoneFormat(phone) {
|
|
|
+ const phoneRegex = /^1[3-9]\d{9}$/;
|
|
|
+ return phoneRegex.test(phone);
|
|
|
+ },
|
|
|
+ // 验证手机号
|
|
|
+ validatePhone(row) {
|
|
|
+ if (row.phone && !this.validatePhoneFormat(row.phone)) {
|
|
|
+ this.$message.error('请输入正确的手机号格式');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 保存手机号列表
|
|
|
+ handleSavePhoneList() {
|
|
|
+ // 检查是否有正在编辑的项
|
|
|
+ const editingItem = this.phoneList.find(item => item.editing);
|
|
|
+ if (editingItem) {
|
|
|
+ this.$message.error('请先保存正在编辑的手机号');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查是否有空的手机号
|
|
|
+ const emptyPhone = this.phoneList.find(item => !item.phone.trim());
|
|
|
+ if (emptyPhone) {
|
|
|
+ this.$message.error('存在空的手机号,请删除或填写完整');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 构造手机号列表
|
|
|
+ const phoneList = this.phoneList.map(item => item.phone);
|
|
|
+
|
|
|
+ // 调用保存接口
|
|
|
+ saveErpPhone(phoneList).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ this.erpPhone.open = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg || '保存失败');
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('保存失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消手机号对话框
|
|
|
+ handleCancelPhoneDialog() {
|
|
|
+ // 恢复原始数据
|
|
|
+ this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
|
|
|
+ this.erpPhone.open = false;
|
|
|
+ },
|
|
|
+
|
|
|
handleImportExpress() {
|
|
|
this.importExpress.title = "导入";
|
|
|
this.importExpress.open = true;
|
|
@@ -843,6 +1113,7 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
handleClickX(tab, event) {
|
|
|
+ this.orderStatus = tab.name;
|
|
|
if(tab.name=="10"){
|
|
|
this.queryParams.status=null;
|
|
|
}else{
|
|
@@ -1114,4 +1385,4 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
};
|
|
|
-</script>
|
|
|
+</script>
|