feat(testing): 增加质检报告独立编辑与详情页面,不再使用弹窗
这个提交包含在:
@@ -1,9 +1,10 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/granary-site'], function ($, undefined, Backend, Table, Form, SiteMixin) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
var vue = new Vue({
|
||||
el: '#vue',
|
||||
mixins: [SiteMixin],
|
||||
data: {
|
||||
contentType: 'one',
|
||||
varietiesType: 'one',
|
||||
@@ -212,6 +213,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}],
|
||||
// 搜索字段
|
||||
search: {
|
||||
site: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
keyword: '',
|
||||
@@ -239,6 +241,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
message: '请您输入粮仓名称',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
site: [{
|
||||
required: true, message: '请选择所属库区', trigger: 'change'
|
||||
}],
|
||||
storage: [{
|
||||
required: true,
|
||||
message: '请您输入仓库储存点',
|
||||
@@ -263,6 +268,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
this.loadData(this.search.keyword, this.currentPage, this.pageSize, this.search.sort);
|
||||
},
|
||||
methods: {
|
||||
changeSite(site) {
|
||||
const selected = this.siteOptions.find(s => s.id === site);
|
||||
this.formData.storage = selected ? selected.storage : '';
|
||||
this.formData.screenPosition = '';
|
||||
this.changeGranaryType(site === 'xishui' ? 3 : 2);
|
||||
},
|
||||
// 直达中心库大屏
|
||||
openCenterScreen() {
|
||||
window.open('/screen/index.html', '_blank');
|
||||
@@ -274,6 +285,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
// 刷新页面
|
||||
refreshPage() {
|
||||
this.search = {
|
||||
site: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
keyword: '',
|
||||
@@ -291,7 +303,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
if (isNaN(num)) return;
|
||||
this.formData.num = num;
|
||||
if (this.title === '添加' && this.formData.granary_type !== 3) {
|
||||
this.formData.granary_type = num > 18 ? 2 : 1;
|
||||
this.formData.granary_type = this.formData.site === 'xishui' ? (num <= 8 ? 3 : 2) : (num > 18 ? 2 : 1);
|
||||
this.changeGranaryType(this.formData.granary_type);
|
||||
}
|
||||
},
|
||||
@@ -397,15 +409,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
id: 0,
|
||||
name: '',
|
||||
image: '',
|
||||
storage: '成都直属库有限公司本部',
|
||||
site: this.search.site || (this.siteOptions[0] || {}).id || '',
|
||||
storage: '',
|
||||
num: '',
|
||||
screenPosition: '',
|
||||
granary_type: 1,
|
||||
varieties: '菜籽油',
|
||||
content: []
|
||||
};
|
||||
this.contentType = 'one';
|
||||
this.varietiesType = 'one';
|
||||
this.changeSite(this.formData.site);
|
||||
} else {
|
||||
this.title = '编辑';
|
||||
let isPreset = ['菜籽油', '大豆油', '稻谷', '小麦', '玉米'].indexOf(item.varieties) !== -1;
|
||||
@@ -416,6 +428,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
image: item.image,
|
||||
site: item.site,
|
||||
storage: item.storage,
|
||||
num: item.num,
|
||||
screenPosition: (item.content || {}).screenPosition || '',
|
||||
@@ -433,7 +446,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
this.contentType = 'two';
|
||||
}
|
||||
|
||||
if (this.formData.granary_type == 1) {
|
||||
if (Number(this.formData.granary_type) === 1) {
|
||||
this.varietiesType = 'one';
|
||||
} else {
|
||||
this.varietiesType = 'two';
|
||||
@@ -463,6 +476,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
this.listLoading = true;
|
||||
$.getJSON('granary/index', {
|
||||
keyword: key,
|
||||
site: this.search.site,
|
||||
type: this.search.type,
|
||||
start_time: this.search.startTime,
|
||||
end_time: this.search.endTime,
|
||||
|
||||
在新工单中引用
屏蔽一个用户