|
@@ -310,7 +310,7 @@
|
|
|
<el-form-item label="ERP账户" prop="erpAccount" v-if="SFDFopen">
|
|
|
<el-select v-model="queryParams.erpAccount" placeholder="ERP账户" clearable size="small">
|
|
|
<el-option
|
|
|
- v-for="dict in erpAccountList"
|
|
|
+ v-for="dict in erpAccountQueryList"
|
|
|
:key="dict"
|
|
|
:label="dict"
|
|
|
:value="dict"
|
|
@@ -364,6 +364,16 @@
|
|
|
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="handleImportStatus"
|
|
|
+ v-hasPermi="['his:storeOrder:editImport']"
|
|
|
+ >导入订单状态</el-button>
|
|
|
+ </el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="info"
|
|
@@ -589,6 +599,34 @@
|
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="uploadStatus.title" :visible.sync="uploadStatus.open" width="400px" append-to-body>
|
|
|
+ <el-upload
|
|
|
+ ref="uploadStatus"
|
|
|
+ :limit="1"
|
|
|
+ accept=".xlsx, .xls"
|
|
|
+ :headers="uploadStatus.headers"
|
|
|
+ :action="uploadStatus.url + '?updateSupport=' + upload.updateSupport"
|
|
|
+ :disabled="uploadStatus.isUploading"
|
|
|
+ :on-progress="handleFileUploadProgressOrder"
|
|
|
+ :on-success="handleFileSuccessOrder"
|
|
|
+ :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="importUpdateOrderTemplate">下载模板</el-link>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitOrderStatusFileForm">确 定</el-button>
|
|
|
+ <el-button @click="uploadStatus.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 设置推送手机对话框 -->
|
|
|
<el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
|
|
@@ -721,7 +759,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { listOrder, getOrder, delOrder, addOrder,importExpressTemplate, updateOrder, exportOrder,importTemplate,exportOrder2,queryErpPhone,
|
|
|
- saveErpPhone,editErpPhone,batchCreateErpOrder,getErpAccount,batchSetErpOrder } from "@/api/his/storeOrder";
|
|
|
+ saveErpPhone,editErpPhone,batchCreateErpOrder,getErpAccount,batchSetErpOrder,importUpdateOrderTemplate } from "@/api/his/storeOrder";
|
|
|
import storeOrderDetails from '../../components/his/storeOrderDetails.vue';
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import {listStore} from "@/api/his/storeProduct";
|
|
@@ -738,13 +776,6 @@ export default {
|
|
|
// 监听deptId
|
|
|
'deptId': 'currDeptChange'
|
|
|
},
|
|
|
- // computed: {
|
|
|
- // // 计算选中账户的详细信息
|
|
|
- // selectedAccountInfo() {
|
|
|
- // if (!this.erpAccountForm.selectedAccount) return null;
|
|
|
- // return this.erpAccountList.find(account => account.id === this.erpAccountForm.selectedAccount);
|
|
|
- // }
|
|
|
- // },
|
|
|
data() {
|
|
|
return {
|
|
|
// 新增排序相关数据
|
|
@@ -784,6 +815,7 @@ export default {
|
|
|
submitting: false
|
|
|
},
|
|
|
erpAccountList: [], // ERP账户列表
|
|
|
+ erpAccountQueryList:[], // ERP账户查询条件列表
|
|
|
erpAccountForm: {
|
|
|
selectedAccount: null // 选中的账户ID
|
|
|
},
|
|
@@ -837,6 +869,20 @@ export default {
|
|
|
// 上传的地址
|
|
|
url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importData"
|
|
|
},
|
|
|
+ uploadStatus: {
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/his/storeOrder/importOrderStatusData"
|
|
|
+ },
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 导出遮罩层
|
|
@@ -924,7 +970,7 @@ export default {
|
|
|
isFirst:null,
|
|
|
source:null,
|
|
|
companyId:null,
|
|
|
- companyIds:null
|
|
|
+ companyIds:null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
@@ -1008,7 +1054,6 @@ export default {
|
|
|
this.deliveryStatusOptions = response.data;
|
|
|
});
|
|
|
this.getErpAccountList();
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
// 新增排序处理方法
|
|
@@ -1243,32 +1288,33 @@ export default {
|
|
|
// 设置erp账户
|
|
|
showErpAccountSetDialog() {
|
|
|
this.erpAccountDialog.open = true;
|
|
|
- // this.erpAccountDialog.loading = true;
|
|
|
this.erpSettingType = 'set'
|
|
|
- // this.getErpAccountList();
|
|
|
this.calculateOrderSummary();
|
|
|
},
|
|
|
//显示ERP账户选择对话框
|
|
|
showErpAccountDialog() {
|
|
|
this.erpAccountDialog.open = true;
|
|
|
- // this.erpAccountDialog.loading = true;
|
|
|
this.erpSettingType = 'push'
|
|
|
- // this.getErpAccountList();
|
|
|
this.calculateOrderSummary();
|
|
|
},
|
|
|
|
|
|
//获取ERP账户列表
|
|
|
async getErpAccountList() {
|
|
|
- // getErpAccountList() {
|
|
|
try {
|
|
|
const response = await getErpAccount();
|
|
|
- // const response = getErpAccount();
|
|
|
if (response.code === 200) {
|
|
|
- this.erpAccountList = response.data || [];
|
|
|
+ const list = response.data || [];
|
|
|
+ this.erpAccountList = [...list];
|
|
|
+ this.erpAccountQueryList = [...list, '未分拣'];
|
|
|
+ // 设置默认值:第一条真实账户
|
|
|
+ if (list.length && !this.queryParams.erpAccount) {
|
|
|
+ this.$set(this.queryParams, 'erpAccount', list[0]);
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$message.error(response.msg || '获取ERP账户列表失败');
|
|
|
this.erpAccountList = [];
|
|
|
}
|
|
|
+
|
|
|
} catch (error) {
|
|
|
console.error('获取ERP账户列表失败:', error);
|
|
|
this.$message.error('获取ERP账户列表失败');
|
|
@@ -1663,6 +1709,10 @@ export default {
|
|
|
handleFileUploadProgressExpress(event, file, fileList) {
|
|
|
this.upload.isUploading = true;
|
|
|
},
|
|
|
+ // 文件上传中处理
|
|
|
+ handleFileUploadProgressOrder(event, file, fileList) {
|
|
|
+ this.uploadStatus.isUploading = true;
|
|
|
+ },
|
|
|
// 文件上传成功处理
|
|
|
handleFileSuccessExpress(response, file, fileList) {
|
|
|
this.importExpress.open = false;
|
|
@@ -1671,14 +1721,26 @@ export default {
|
|
|
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
this.getList();
|
|
|
},
|
|
|
+ // 文件上传成功处理
|
|
|
+ handleFileSuccessOrder(response, file, fileList) {
|
|
|
+ this.uploadStatus.open = false;
|
|
|
+ this.uploadStatus.isUploading = false;
|
|
|
+ this.$refs.uploadStatus.clearFiles();
|
|
|
+ this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+
|
|
|
// 提交上传文件
|
|
|
submitFileFormExpress() {
|
|
|
this.$refs.importExpress.submit();
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- /** 导入按钮操作 */
|
|
|
- handleImport() {
|
|
|
+ handleImportStatus() {
|
|
|
+ this.uploadStatus.title = "导入";
|
|
|
+ this.uploadStatus.open = true;
|
|
|
+ },
|
|
|
+ /** 导入按钮操作 */
|
|
|
+ handleImport() {
|
|
|
this.upload.title = "导入";
|
|
|
this.upload.open = true;
|
|
|
},
|
|
@@ -1689,6 +1751,11 @@ export default {
|
|
|
this.download(response.msg);
|
|
|
});
|
|
|
},
|
|
|
+ importUpdateOrderTemplate(){
|
|
|
+ importUpdateOrderTemplate().then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ });
|
|
|
+ },
|
|
|
// 文件上传中处理
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
this.upload.isUploading = true;
|
|
@@ -1705,6 +1772,9 @@ export default {
|
|
|
submitFileForm() {
|
|
|
this.$refs.upload.submit();
|
|
|
},
|
|
|
+ submitOrderStatusFileForm(){
|
|
|
+ this.$refs.uploadStatus.submit();
|
|
|
+ },
|
|
|
handledetails(row){
|
|
|
this.show.open=true;
|
|
|
setTimeout(() => {
|