This commit is contained in:
zds
2022-10-16 14:01:48 +08:00
parent 938a3c62d6
commit 4946b89034
5 changed files with 65 additions and 25 deletions

View File

@@ -35,9 +35,9 @@ public class DailyplanController {
@GetMapping
@Log("查询月生产计划")
@ApiOperation("查询月生产计划")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
public ResponseEntity<Object> query(@RequestParam Map whereJson){
return new ResponseEntity<>(dailyplanService.
queryAll(whereJson,page),HttpStatus.OK);
queryAll2(whereJson),HttpStatus.OK);
}
@GetMapping("/queryday")

View File

@@ -24,7 +24,7 @@ public interface DailyplanService {
* @param page 分页参数
* @return Map<String,Object>
*/
Map<String,Object> queryAll(Map whereJson, Pageable page);
Map<String,Object> queryAll2(Map whereJson);
/**
* 查询数据分页
* @param whereJson 条件

View File

@@ -54,7 +54,7 @@ public class DailyplanServiceImpl implements DailyplanService {
private final WorkOrdereService workOrdereService;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
public Map<String, Object> queryAll2(Map whereJson) {
HashMap<String, String> map = new HashMap<>(whereJson);
String material_code = map.get("material_code");
@@ -62,8 +62,7 @@ public class DailyplanServiceImpl implements DailyplanService {
map.put("material_code", "%" + material_code + "%");
}
map.put("flag", "1");
JSONObject jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "pp.planstart_date,pp.plan_code");
JSONArray json = jret.getJSONArray("content");
JSONArray json = WQL.getWO("QPDM_PRODUCTDAILYPLAN").addParamMap(map).process().getResultJSONArray(0);
JSONArray ja = new JSONArray();
for(int i=0;i<json.size();i++){
JSONObject jo = json.getJSONObject(i);
@@ -82,6 +81,7 @@ public class DailyplanServiceImpl implements DailyplanService {
}
ja.add(jo);
}
Map<String, Object> jret = new HashMap<String, Object>();
jret.put("content",ja);
return jret;
}
@@ -210,15 +210,7 @@ public class DailyplanServiceImpl implements DailyplanService {
map.put("material_code", "%" + material_code + "%");
}
map.put("flag", "2");
JSONArray jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN")
.addParamMap(map).process().getResultJSONArray(0);
if(jret.size()>0){
JSONObject form = new JSONObject();
form.put("rows",jret);
form.put("query",whereJson);
this.submit2(form);
}
jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN")
JSONArray jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN")
.addParamMap(map).process().getResultJSONArray(0);
JSONArray ja = new JSONArray();

View File

@@ -51,7 +51,7 @@
##########################################
IF 输入.flag = "1"
PAGEQUERY
QUERY
SELECT
pp.*,
ext.old_mark,
@@ -94,8 +94,9 @@
OPTION 输入.device_id <> ""
pp.device_id = 输入.device_id
ENDOPTION
order by pp.planstart_date,pp.plan_code
ENDSELECT
ENDPAGEQUERY
ENDQUERY
ENDIF
IF 输入.flag = "2"

View File

@@ -148,7 +148,30 @@
</crudOperation>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table ref="table" v-loading="crud.loading" :max-height="590" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column
min-width="115"
label="重排调整"
align="center"
fixed="right"
>
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
icon="el-icon-top"
@click="moveUp(scope.$index, scope.row)"
>
</el-button>
<el-button
type="primary"
size="mini"
icon="el-icon-bottom"
@click="moveDown(scope.$index, scope.row)"
>
</el-button>
</template>
</el-table-column>
<el-table-column
v-permission="['admin','workorder:del','workorder:edit']"
min-width="125"
@@ -165,7 +188,7 @@
/>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" min-width="35" />
<el-table-column fixed="left" :selectable="checkboxT" type="selection" min-width="35" />
<el-table-column prop="plan_code" label="日计划编码" min-width="105" />
<el-table-column :formatter="seriesFormat" min-width="70" prop="product_series_id" label="系列产线" />
<el-table-column prop="device_name" label="关键设备" min-width="80" />
@@ -186,8 +209,6 @@
<el-table-column prop="create_name" label="创建人" min-width="60" />
<el-table-column prop="remark" label="备注" min-width="200" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<StructIvt4 ref="child" :dialog-show.sync="structshow" :rowmst="form" @StructIvtClosed="querytable" />
@@ -223,7 +244,7 @@ export default {
url: 'api/dailyplan',
idField: 'dailyplan_id',
sort: '',
query: { nowstart_date: new Date(),device_id: '', status: '01' },
query: { nowstart_date: new Date(), device_id: '', status: '01' },
crudMethod: { ...dailyplan },
optShow: {
add: true,
@@ -320,14 +341,40 @@ export default {
}
}
},
moveUp(index, item) {
if (index > 0) {
const upDate = this.crud.data[index - 1]
this.crud.data.splice(index - 1, 1)
this.crud.data.splice(index, 0, upDate)
} else {
this.$message.error('已经是第一条,不可上移')
}
},
moveDown(index, item) {
if ((index + 1) === this.crud.data.length) {
this.$message.error('已经是最后一条,不可下移')
} else {
console.log(index)
const downDate = this.crud.data[index + 1]
this.crud.data.splice(index + 1, 1)
this.crud.data.splice(index, 0, downDate)
}
},
save() {
if (this.crud.query.device_id === '' || this.crud.query.device_id === undefined) {
this.crud.notify('请先选择关键设备!')
return false
}
this.form.device_id = this.crud.query.device_id
this.$refs.child.getMsg(this.crud.query.device_id, this.crud.query.nowstart_date, this.crud.query.checked)
this.structshow = true
this.checkrows = this.crud.data
if (this.checkrows.length === 0) {
this.crud.notify('当前页面无可重排数据!')
return false
}
dailyplan.submit2({ query: this.crud.query, rows: this.checkrows }).then(res => {
this.form.device_id = this.crud.query.device_id
this.$refs.child.getMsg(this.crud.query.device_id, this.crud.query.nowstart_date, this.crud.query.checked)
this.structshow = true
})
},
downdtl() {
crud.downloadLoading = true