|
@@ -165,144 +165,144 @@
|
|
|
<router-view />
|
|
|
|
|
|
<script>
|
|
|
-import { getauth, postauth, putauth, deleteauth } from "boot/axios_request";
|
|
|
-import { date, LocalStorage } from "quasar";
|
|
|
+import { getauth, postauth, putauth, deleteauth } from 'boot/axios_request'
|
|
|
+import { date, LocalStorage } from 'quasar'
|
|
|
|
|
|
export default {
|
|
|
- name: "PageTask",
|
|
|
- data() {
|
|
|
+ name: 'PageTask',
|
|
|
+ data () {
|
|
|
return {
|
|
|
- createDate1: "",
|
|
|
- createDate2: "",
|
|
|
- date_range: "",
|
|
|
- proxyDate: "",
|
|
|
- date: "",
|
|
|
- goods_code: "",
|
|
|
- goods_desc: "",
|
|
|
- openid: "",
|
|
|
- login_name: "",
|
|
|
- authin: "0",
|
|
|
- searchUrl: "",
|
|
|
- pathname: "bound/batch/count/",
|
|
|
- pathname_previous: "",
|
|
|
- pathname_next: "",
|
|
|
- separator: "cell",
|
|
|
+ createDate1: '',
|
|
|
+ createDate2: '',
|
|
|
+ date_range: '',
|
|
|
+ proxyDate: '',
|
|
|
+ date: '',
|
|
|
+ goods_code: '',
|
|
|
+ goods_desc: '',
|
|
|
+ openid: '',
|
|
|
+ login_name: '',
|
|
|
+ authin: '0',
|
|
|
+ searchUrl: '',
|
|
|
+ pathname: 'bound/batch/count/',
|
|
|
+ pathname_previous: '',
|
|
|
+ pathname_next: '',
|
|
|
+ separator: 'cell',
|
|
|
loading: false,
|
|
|
- height: "",
|
|
|
+ height: '',
|
|
|
viewForm: false,
|
|
|
|
|
|
table_list: [],
|
|
|
columns: [
|
|
|
{
|
|
|
- name: "expand",
|
|
|
- label: "",
|
|
|
- align: "left",
|
|
|
- headerStyle: "width: 50px",
|
|
|
+ name: 'expand',
|
|
|
+ label: '',
|
|
|
+ align: 'left',
|
|
|
+ headerStyle: 'width: 50px'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- name: "goods_code",
|
|
|
- label: "存货编码",
|
|
|
- field: "goods_code",
|
|
|
- align: "center",
|
|
|
+ name: 'goods_code',
|
|
|
+ label: '存货编码',
|
|
|
+ field: 'goods_code',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- name: "goods_desc",
|
|
|
- label: "存货名称",
|
|
|
- field: "goods_desc",
|
|
|
- align: "center",
|
|
|
+ name: 'goods_desc',
|
|
|
+ label: '存货名称',
|
|
|
+ field: 'goods_desc',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- name: "total_quantity",
|
|
|
- label: "在库数目",
|
|
|
- field: "total_quantity",
|
|
|
- align: "center",
|
|
|
+ name: 'total_quantity',
|
|
|
+ label: '在库数目',
|
|
|
+ field: 'total_quantity',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- name: "goods_unit",
|
|
|
- label: "单位",
|
|
|
- field: "goods_unit",
|
|
|
- align: "center",
|
|
|
- headerStyle: "width: 20px",
|
|
|
- },
|
|
|
+ name: 'goods_unit',
|
|
|
+ label: '单位',
|
|
|
+ field: 'goods_unit',
|
|
|
+ align: 'center',
|
|
|
+ headerStyle: 'width: 20px'
|
|
|
+ }
|
|
|
],
|
|
|
- filter: "",
|
|
|
+ filter: '',
|
|
|
pagination: {
|
|
|
page: 1,
|
|
|
- rowsPerPage: 11,
|
|
|
+ rowsPerPage: 11
|
|
|
},
|
|
|
current: 1,
|
|
|
max: 0,
|
|
|
total: 0,
|
|
|
paginationIpt: 1,
|
|
|
containers: {},
|
|
|
- timer: null,
|
|
|
- };
|
|
|
+ timer: null
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
- interval() {
|
|
|
+ interval () {
|
|
|
return (
|
|
|
- this.$t("download_center.start") +
|
|
|
- " - " +
|
|
|
- this.$t("download_center.end")
|
|
|
- );
|
|
|
- },
|
|
|
+ this.$t('download_center.start') +
|
|
|
+ ' - ' +
|
|
|
+ this.$t('download_center.end')
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- class_to_name(class_id) {
|
|
|
+ class_to_name (class_id) {
|
|
|
const class_map = {
|
|
|
- 1: "整盘",
|
|
|
- 2: "托盘组",
|
|
|
- 3: "零盘",
|
|
|
- };
|
|
|
- return class_map[class_id];
|
|
|
+ 1: '整盘',
|
|
|
+ 2: '托盘组',
|
|
|
+ 3: '零盘'
|
|
|
+ }
|
|
|
+ return class_map[class_id]
|
|
|
},
|
|
|
- handle_row_expand(row) {
|
|
|
- const _this = this;
|
|
|
- row.expand = !row.expand;
|
|
|
+ handle_row_expand (row) {
|
|
|
+ const _this = this
|
|
|
+ row.expand = !row.expand
|
|
|
if (row.expand) {
|
|
|
// 添加行级 loading 状态
|
|
|
- _this.$set(row, "loading", true);
|
|
|
- getauth("bound/batch/count/" + row.id + "/", {})
|
|
|
+ _this.$set(row, 'loading', true)
|
|
|
+ getauth('bound/batch/count/' + row.id + '/', {})
|
|
|
.then((res) => {
|
|
|
- _this.$set(row, "batch_items", res.batch_items);
|
|
|
- console.log("当前的", row.batch_items);
|
|
|
+ _this.$set(row, 'batch_items', res.batch_items)
|
|
|
+ console.log('当前的', row.batch_items)
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- _this.$q.notify({ message: err.detail, color: "negative" });
|
|
|
+ _this.$q.notify({ message: err.detail, color: 'negative' })
|
|
|
})
|
|
|
.finally(() => {
|
|
|
- row.loading = false; // 关闭加载状态
|
|
|
- });
|
|
|
+ row.loading = false // 关闭加载状态
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- getlog() {
|
|
|
+ getlog () {
|
|
|
// console.log(this.table_list)
|
|
|
- console.log("当前loading状态:", this.loading);
|
|
|
+ console.log('当前loading状态:', this.loading)
|
|
|
},
|
|
|
- getList(params = {}) {
|
|
|
- var _this = this;
|
|
|
- _this.loading = true;
|
|
|
+ getList (params = {}) {
|
|
|
+ var _this = this
|
|
|
+ _this.loading = true
|
|
|
// 合并基础参数
|
|
|
const baseParams = {
|
|
|
page: _this.current,
|
|
|
- page_size: _this.pagination.rowsPerPage,
|
|
|
- };
|
|
|
+ page_size: _this.pagination.rowsPerPage
|
|
|
+ }
|
|
|
|
|
|
// 创建URLSearchParams处理参数
|
|
|
const queryParams = new URLSearchParams({
|
|
|
...baseParams,
|
|
|
- ...params,
|
|
|
- });
|
|
|
- console.log(queryParams);
|
|
|
+ ...params
|
|
|
+ })
|
|
|
+ console.log(queryParams)
|
|
|
// 过滤空值参数
|
|
|
Array.from(queryParams.entries()).forEach(([key, value]) => {
|
|
|
- if (value === "" || value === null || value === undefined) {
|
|
|
- queryParams.delete(key);
|
|
|
+ if (value === '' || value === null || value === undefined) {
|
|
|
+ queryParams.delete(key)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
|
|
|
getauth(`${_this.pathname}?${queryParams}`)
|
|
|
.then((res) => {
|
|
@@ -310,170 +310,170 @@ export default {
|
|
|
...item,
|
|
|
expand: false,
|
|
|
batch_items: [],
|
|
|
- loading: false,
|
|
|
- }));
|
|
|
- _this.total = res.count;
|
|
|
- _this.max = Math.ceil(res.count / _this.pagination.rowsPerPage) || 0;
|
|
|
- _this.pathname_previous = res.previous;
|
|
|
- _this.pathname_next = res.next;
|
|
|
+ loading: false
|
|
|
+ }))
|
|
|
+ _this.total = res.count
|
|
|
+ _this.max = Math.ceil(res.count / _this.pagination.rowsPerPage) || 0
|
|
|
+ _this.pathname_previous = res.previous
|
|
|
+ _this.pathname_next = res.next
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
_this.$q.notify({
|
|
|
message: err.detail,
|
|
|
- icon: "close",
|
|
|
- color: "negative",
|
|
|
- });
|
|
|
+ icon: 'close',
|
|
|
+ color: 'negative'
|
|
|
+ })
|
|
|
})
|
|
|
.finally(() => {
|
|
|
- _this.loading = false;
|
|
|
- });
|
|
|
+ _this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
- changePageEnter() {
|
|
|
+ changePageEnter () {
|
|
|
if (Number(this.paginationIpt) < 1) {
|
|
|
- this.current = 1;
|
|
|
- this.paginationIpt = 1;
|
|
|
+ this.current = 1
|
|
|
+ this.paginationIpt = 1
|
|
|
} else if (Number(this.paginationIpt) > this.max) {
|
|
|
- this.current = this.max;
|
|
|
- this.paginationIpt = this.max;
|
|
|
+ this.current = this.max
|
|
|
+ this.paginationIpt = this.max
|
|
|
} else {
|
|
|
- this.current = Number(this.paginationIpt);
|
|
|
+ this.current = Number(this.paginationIpt)
|
|
|
}
|
|
|
- this.getSearchList(this.current);
|
|
|
+ this.getSearchList(this.current)
|
|
|
},
|
|
|
|
|
|
// 带搜索条件加载
|
|
|
- getSearchList(page = 1) {
|
|
|
- this.current = page;
|
|
|
- this.paginationIpt = page;
|
|
|
+ getSearchList (page = 1) {
|
|
|
+ this.current = page
|
|
|
+ this.paginationIpt = page
|
|
|
this.getList({
|
|
|
goods_desc__icontains: this.filter,
|
|
|
- create_time__range: this.date_range,
|
|
|
- });
|
|
|
+ create_time__range: this.date_range
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
- getListPrevious() {
|
|
|
- var _this = this;
|
|
|
- if (LocalStorage.has("auth")) {
|
|
|
+ getListPrevious () {
|
|
|
+ var _this = this
|
|
|
+ if (LocalStorage.has('auth')) {
|
|
|
getauth(_this.pathname_previous, {})
|
|
|
.then((res) => {
|
|
|
- _this.table_list = res.results;
|
|
|
- _this.pathname_previous = res.previous;
|
|
|
- _this.pathname_next = res.next;
|
|
|
+ _this.table_list = res.results
|
|
|
+ _this.pathname_previous = res.previous
|
|
|
+ _this.pathname_next = res.next
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
_this.$q.notify({
|
|
|
message: err.detail,
|
|
|
- icon: "close",
|
|
|
- color: "negative",
|
|
|
- });
|
|
|
- });
|
|
|
+ icon: 'close',
|
|
|
+ color: 'negative'
|
|
|
+ })
|
|
|
+ })
|
|
|
} else {
|
|
|
}
|
|
|
},
|
|
|
- getListNext() {
|
|
|
- var _this = this;
|
|
|
- if (LocalStorage.has("auth")) {
|
|
|
+ getListNext () {
|
|
|
+ var _this = this
|
|
|
+ if (LocalStorage.has('auth')) {
|
|
|
getauth(_this.pathname_next, {})
|
|
|
.then((res) => {
|
|
|
- _this.table_list = res.results;
|
|
|
+ _this.table_list = res.results
|
|
|
|
|
|
- _this.pathname_previous = res.previous;
|
|
|
- _this.pathname_next = res.next;
|
|
|
+ _this.pathname_previous = res.previous
|
|
|
+ _this.pathname_next = res.next
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
_this.$q.notify({
|
|
|
message: err.detail,
|
|
|
- icon: "close",
|
|
|
- color: "negative",
|
|
|
- });
|
|
|
- });
|
|
|
+ icon: 'close',
|
|
|
+ color: 'negative'
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- reFresh() {
|
|
|
- var _this = this;
|
|
|
- _this.getSearchList();
|
|
|
+ reFresh () {
|
|
|
+ var _this = this
|
|
|
+ _this.getSearchList()
|
|
|
},
|
|
|
|
|
|
- updateProxy() {
|
|
|
- var _this = this;
|
|
|
- _this.proxyDate = _this.date;
|
|
|
- },
|
|
|
+ updateProxy () {
|
|
|
+ var _this = this
|
|
|
+ _this.proxyDate = _this.date
|
|
|
+ }
|
|
|
},
|
|
|
- created() {
|
|
|
- var _this = this;
|
|
|
- if (LocalStorage.has("openid")) {
|
|
|
- _this.openid = LocalStorage.getItem("openid");
|
|
|
+ created () {
|
|
|
+ var _this = this
|
|
|
+ if (LocalStorage.has('openid')) {
|
|
|
+ _this.openid = LocalStorage.getItem('openid')
|
|
|
} else {
|
|
|
- _this.openid = "";
|
|
|
- LocalStorage.set("openid", "");
|
|
|
+ _this.openid = ''
|
|
|
+ LocalStorage.set('openid', '')
|
|
|
}
|
|
|
- if (LocalStorage.has("login_name")) {
|
|
|
- _this.login_name = LocalStorage.getItem("login_name");
|
|
|
+ if (LocalStorage.has('login_name')) {
|
|
|
+ _this.login_name = LocalStorage.getItem('login_name')
|
|
|
} else {
|
|
|
- _this.login_name = "";
|
|
|
- LocalStorage.set("login_name", "");
|
|
|
+ _this.login_name = ''
|
|
|
+ LocalStorage.set('login_name', '')
|
|
|
}
|
|
|
- if (LocalStorage.has("auth")) {
|
|
|
- const timeStamp = Date.now();
|
|
|
- const formattedString = date.formatDate(timeStamp, "YYYY/MM/DD");
|
|
|
- _this.date = formattedString;
|
|
|
- console.log(_this.date);
|
|
|
- _this.authin = "1";
|
|
|
- _this.getList();
|
|
|
+ if (LocalStorage.has('auth')) {
|
|
|
+ const timeStamp = Date.now()
|
|
|
+ const formattedString = date.formatDate(timeStamp, 'YYYY/MM/DD')
|
|
|
+ _this.date = formattedString
|
|
|
+ console.log(_this.date)
|
|
|
+ _this.authin = '1'
|
|
|
+ _this.getList()
|
|
|
} else {
|
|
|
- _this.authin = "0";
|
|
|
+ _this.authin = '0'
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
- var _this = this;
|
|
|
+ mounted () {
|
|
|
+ var _this = this
|
|
|
if (_this.$q.platform.is.electron) {
|
|
|
- _this.height = String(_this.$q.screen.height - 290) + "px";
|
|
|
+ _this.height = String(_this.$q.screen.height - 290) + 'px'
|
|
|
} else {
|
|
|
- _this.height = _this.$q.screen.height - 290 + "" + "px";
|
|
|
+ _this.height = _this.$q.screen.height - 290 + '' + 'px'
|
|
|
}
|
|
|
// _this.timer = setInterval(() => {
|
|
|
// _this.getlog()
|
|
|
// }, 1000)
|
|
|
},
|
|
|
- updated() {},
|
|
|
- destroyed() {},
|
|
|
+ updated () {},
|
|
|
+ destroyed () {},
|
|
|
// 在 watch 或方法中添加调试代码
|
|
|
watch: {
|
|
|
- createDate1(val) {
|
|
|
+ createDate1 (val) {
|
|
|
if (val) {
|
|
|
if (val.to) {
|
|
|
- this.createDate2 = `${val.from} - ${val.to}`;
|
|
|
- this.date_range = `${val.from},${val.to} `;
|
|
|
+ this.createDate2 = `${val.from} - ${val.to}`
|
|
|
+ this.date_range = `${val.from},${val.to} `
|
|
|
|
|
|
// this.downloadhUrl = this.pathname + 'filelist/?' + 'document_date__range=' + this.date_range
|
|
|
} else {
|
|
|
- this.createDate2 = `${val}`;
|
|
|
- this.dateArray = val.split("/");
|
|
|
+ this.createDate2 = `${val}`
|
|
|
+ this.dateArray = val.split('/')
|
|
|
this.searchUrl =
|
|
|
this.pathname +
|
|
|
- "?" +
|
|
|
- "document_date__year=" +
|
|
|
+ '?' +
|
|
|
+ 'document_date__year=' +
|
|
|
this.dateArray[0] +
|
|
|
- "&" +
|
|
|
- "document_date__month=" +
|
|
|
+ '&' +
|
|
|
+ 'document_date__month=' +
|
|
|
this.dateArray[1] +
|
|
|
- "&" +
|
|
|
- "document_date__day=" +
|
|
|
- this.dateArray[2];
|
|
|
+ '&' +
|
|
|
+ 'document_date__day=' +
|
|
|
+ this.dateArray[2]
|
|
|
// this.downloadhUrl = this.pathname + 'filelist/?' + 'document_date__year=' + this.dateArray[0] + '&' + 'document_date__month=' + this.dateArray[1] + '&' + 'document_date__day=' + this.dateArray[2]
|
|
|
}
|
|
|
- this.date_range = this.date_range.replace(/\//g, "-");
|
|
|
+ this.date_range = this.date_range.replace(/\//g, '-')
|
|
|
|
|
|
- this.getSearchList();
|
|
|
- this.$refs.qDateProxy.hide();
|
|
|
+ this.getSearchList()
|
|
|
+ this.$refs.qDateProxy.hide()
|
|
|
} else {
|
|
|
- this.createDate2 = "";
|
|
|
- this.date_range = "";
|
|
|
- this.getSearchList();
|
|
|
+ this.createDate2 = ''
|
|
|
+ this.date_range = ''
|
|
|
+ this.getSearchList()
|
|
|
}
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
/* 添加在 <style> 中 */
|