|
|
@@ -33,10 +33,16 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="订单状态" prop="productCode">
|
|
|
+ <el-input
|
|
|
+ <el-switch v-model="queryParams.status" :active-value="1" :inactive-value="0" @change="handleQuery"></el-switch>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
<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-button icon="el-icon-refresh" size="mini" @click="resetQueryUnplanned">只显示未排订单</el-button> -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -285,36 +291,34 @@
|
|
|
|
|
|
<!-- 直报系统导入对话框 -->
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
- <el-upload ref="upload" :limit="1" accept=".xlsx, .xls,.csv" :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-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的老数据
|
|
|
- </div>
|
|
|
- <span>仅允许导入xls、xlsx、csv格式文件。</span>
|
|
|
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
|
|
- @click="importTemplate">下载模板</el-link>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ action="#"
|
|
|
+ :show-file-list="false"
|
|
|
+
|
|
|
+ :http-request="uploadFile"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-change="handleChange"
|
|
|
+ ref="uploadFile"
|
|
|
+ >
|
|
|
+ <el-button type="warning" size="mini">批量导入</el-button>
|
|
|
</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>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listSalesorder, getSalesorder, delSalesorder, addSalesorder, updateSalesorder,listSalesorderExpect,occupyRes,listSalesorderOccupyRes,listSalesorderExpectAll,occupyAllRes} from "@/api/aps/presalesorder";
|
|
|
-
|
|
|
+import { importFile, listSalesorder, getSalesorder, delSalesorder, addSalesorder, updateSalesorder,listSalesorderExpect,occupyRes,listSalesorderOccupyRes,listSalesorderExpectAll,occupyAllRes} from "@/api/aps/presalesorder";
|
|
|
+import { API_BASE_URL, TOKEN_HEADER_NAME, LAYOUT_PATH } from '@/config/setting';
|
|
|
+ import { getToken, setToken } from '@/utils/token-util';
|
|
|
|
|
|
export default {
|
|
|
- name: "Salesorder",
|
|
|
+ name: "PreSalesorder",
|
|
|
data() {
|
|
|
return {
|
|
|
+ fileList: [],
|
|
|
isSubmitting:true,
|
|
|
// 用户导入参数
|
|
|
upload: {
|
|
|
@@ -327,11 +331,11 @@ export default {
|
|
|
// 是否更新已经存在的用户数据
|
|
|
updateSupport: 0,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: {
|
|
|
- Authorization: "Bearer " +""
|
|
|
- },
|
|
|
+ // headers: {
|
|
|
+ // Authorization: "Bearer " +getToken()
|
|
|
+ // },
|
|
|
// 上传的地址
|
|
|
- url: process.env.VUE_APP_BASE_API + "/aps/salesorder/importData"
|
|
|
+ url: API_BASE_URL+ "/aps/presalesorder/importData"
|
|
|
},
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
@@ -376,7 +380,8 @@ export default {
|
|
|
materialDescription: null,
|
|
|
materialQuantity: null,
|
|
|
materialUnit: null,
|
|
|
- materialWeightKg: null
|
|
|
+ materialWeightKg: null,
|
|
|
+ status:null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
@@ -392,6 +397,39 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleChange(file, fileList) {
|
|
|
+ this.fileList = fileList;
|
|
|
+ console.log(fileList);
|
|
|
+ },
|
|
|
+
|
|
|
+ //上传限制
|
|
|
+ beforeUpload(file) {
|
|
|
+ const isLt10M = file.size / 1024 / 1024 < 10;
|
|
|
+ if (!isLt10M) {
|
|
|
+ this.$message.error('上传文件大小不能超过 10MB!');
|
|
|
+ }
|
|
|
+ return isLt10M;
|
|
|
+ },
|
|
|
+ //文件上传
|
|
|
+ uploadFile(param) {
|
|
|
+ let fd = new FormData();
|
|
|
+ this.fileList.forEach((item) => {
|
|
|
+ fd.append('importExcel', item.raw);
|
|
|
+ });
|
|
|
+ importFile(fd)
|
|
|
+ .then((res) => {
|
|
|
+ this.$emit('handleQuery', this.queryParams);
|
|
|
+ this.$refs.uploadFile.clearFiles();
|
|
|
+ })
|
|
|
+ .catch((data) => {
|
|
|
+ if (data.code != -1) {
|
|
|
+ this.$message.error(data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.$refs.uploadFile.clearFiles();
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询销售订单列表 */
|
|
|
getList() {
|
|
|
console.log("getList")
|
|
|
@@ -431,7 +469,8 @@ export default {
|
|
|
materialDescription: null,
|
|
|
materialQuantity: null,
|
|
|
materialUnit: null,
|
|
|
- materialWeightKg: null
|
|
|
+ materialWeightKg: null,
|
|
|
+ status:null,
|
|
|
};
|
|
|
//this.resetForm("form");
|
|
|
},
|
|
|
@@ -445,6 +484,12 @@ export default {
|
|
|
//this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+ /** 只显示未排订单按钮操作 */
|
|
|
+ resetQueryUnplanned() {
|
|
|
+ this.queryParams.status = "0";
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
@@ -496,7 +541,7 @@ export default {
|
|
|
const id = this.ids
|
|
|
getSalesorder(id).then(response => {
|
|
|
// console.log(response);
|
|
|
- let saleorder = response;
|
|
|
+ let saleorder = response.data;
|
|
|
if (saleorder.status=="1") {
|
|
|
this.$message.success("已经分配过资源");
|
|
|
return;
|
|
|
@@ -537,9 +582,9 @@ export default {
|
|
|
occupyRes(arr).then(response => {
|
|
|
this.$message.success("占用成功");
|
|
|
|
|
|
- saleorder.data.status = "1";
|
|
|
- console.log(saleorder.data);
|
|
|
- updateSalesorder(saleorder.data).then(response => {
|
|
|
+ saleorder.status = "1";
|
|
|
+ console.log(saleorder);
|
|
|
+ updateSalesorder(saleorder).then(response => {
|
|
|
this.$message.success("修改成功");
|
|
|
this.openExpect = false;
|
|
|
this.getList();
|