代码更新
This commit is contained in:
@@ -45,6 +45,7 @@ public class PrintServiceImpl implements PrintService {
|
||||
public JSONObject customerPrint(JSONObject whereJson) {
|
||||
JSONObject jo = new JSONObject();
|
||||
WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo");
|
||||
WQLObject custTab = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
@@ -87,6 +88,13 @@ public class PrintServiceImpl implements PrintService {
|
||||
//储存条件
|
||||
String storage_conditions = "";
|
||||
|
||||
// 根据客户条件选择对应模板
|
||||
JSONObject jsonCust = custTab.query("cust_code = '" + box_jo.getString("customer_name") + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCust)) throw new BadRequestException("客户不存在或未启用");
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonCust.getString("bz_print_no"))) throw new BadRequestException("请先设置客户打印模板");
|
||||
String bz_print_no = jsonCust.getString("bz_print_no");
|
||||
|
||||
double weight = 0;
|
||||
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(0);
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
@@ -107,9 +115,10 @@ public class PrintServiceImpl implements PrintService {
|
||||
fw = new FileWriter(filePath);
|
||||
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||
BufferedWriter bw = new BufferedWriter(write);
|
||||
bw.write("package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight\n");
|
||||
bw.write("bz_print_no,package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight,customer_name,customer_description,thickness,mass_per_unit_area,length,box_type,sap_pcsn,box_length,box_width,box_high\n");
|
||||
|
||||
bw.write(package_box_sn1 + ","
|
||||
bw.write(bz_print_no + ","
|
||||
+package_box_sn1 + ","
|
||||
+ package_box_sn2 + ","
|
||||
+ sale_order_name + ","
|
||||
+ product_description + ","
|
||||
@@ -123,7 +132,17 @@ public class PrintServiceImpl implements PrintService {
|
||||
+ quality_guaran_period + ","
|
||||
+ nspector + ","
|
||||
+ storage_conditions + ","
|
||||
+ NumberUtil.round(weight,2).toString() + ",\n"
|
||||
+ NumberUtil.round(weight,2).toString() + ","
|
||||
+ box_jo.getString("customer_name") + ","
|
||||
+ box_jo.getString("customer_description") + ","
|
||||
+ box_jo.getString("thickness") + ","
|
||||
+ box_jo.getString("mass_per_unit_area") + ","
|
||||
+ box_jo.getString("length") + ","
|
||||
+ box_jo.getString("box_type") + ","
|
||||
+ box_jo.getString("sap_pcsn") + ","
|
||||
+ box_jo.getString("box_length") + ","
|
||||
+ box_jo.getString("box_width") + ","
|
||||
+ box_jo.getString("box_high") + "\n"
|
||||
);
|
||||
|
||||
bw.close();
|
||||
|
||||
@@ -152,17 +152,7 @@
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
sub.package_box_sn,
|
||||
sub.quanlity_in_box,
|
||||
sub.box_weight,
|
||||
sub.sale_order_name,
|
||||
sub.product_name,
|
||||
sub.product_description,
|
||||
sub.width,
|
||||
sub.container_name,
|
||||
sub.net_weight,
|
||||
sub.date_of_FG_inbound,
|
||||
sub.date_of_production
|
||||
*
|
||||
FROM
|
||||
pdm_bi_subpackagerelation sub
|
||||
WHERE
|
||||
|
||||
@@ -109,9 +109,32 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 600px;" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="包装打印模板:">
|
||||
<el-select
|
||||
v-model="form.bz_print_no"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.print_temple"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 550px;" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
@@ -127,14 +150,15 @@
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="cust_code" label="客户编码" />
|
||||
<el-table-column prop="cust_code" label="客户编码" show-overflow-tooltip />
|
||||
<el-table-column prop="cust_name" label="客户名称 " show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="cust_simple_name" label="客户简称 " show-overflow-tooltip />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" />
|
||||
<el-table-column prop="corp_address" label="公司地址" />
|
||||
<el-table-column prop="jurid_name" label="法人代表" />
|
||||
<el-table-column prop="shd_print_no" label="送货单打印模板路径" width="150px" show-overflow-tooltip/>
|
||||
<el-table-column prop="shd_dtl_num" label="送货单明细数" />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" show-overflow-tooltip />
|
||||
<el-table-column prop="corp_address" label="公司地址" show-overflow-tooltip />
|
||||
<el-table-column prop="jurid_name" label="法人代表" show-overflow-tooltip />
|
||||
<el-table-column prop="bz_print_no" label="包装打印模板" width="150px" :formatter="printTemple" show-overflow-tooltip />
|
||||
<el-table-column prop="shd_print_no" label="送货单打印模板路径" width="180px" show-overflow-tooltip/>
|
||||
<el-table-column prop="shd_dtl_num" label="送货单明细数" width="150px" show-overflow-tooltip />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
@@ -219,7 +243,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Customerbase',
|
||||
dicts: ['is_used'],
|
||||
dicts: ['is_used', 'print_temple'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
@@ -342,6 +366,9 @@ export default {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
printTemple(row) {
|
||||
return this.dict.label.print_temple[row.bz_print_no]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user