界面调整

master
zhaoxiaolin 7 months ago
parent f9604db1b7
commit c2b0842300

@ -59,3 +59,15 @@ export function syncSAP() {
method: 'post' method: 'post'
}); });
} }
//同步制定产品的sap工艺
export function syncProductSAP(productCodes) {
const data = {
productCodes
}
return request({
url: '/technology/pro/proroute/syncProductSAP',
method: 'post',
data: data
})
}

@ -582,7 +582,7 @@
</el-row> </el-row>
<!-- 主数据 --> <!-- 主数据 -->
<el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" <el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table"
:data="printData.workTable" border style="width: 100%"> :data="printData.workTable" border style="width: 100%" :summary-method="getRKSummaries" show-summary>
<el-table-column type="index" label="序号" width="50"></el-table-column> <el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column prop="workorderCodeSap" label="订单号" width="130" <el-table-column prop="workorderCodeSap" label="订单号" width="130"
:formatter="orderCodeFormate" /> :formatter="orderCodeFormate" />
@ -1598,6 +1598,38 @@ export default {
item.remark = remark; item.remark = remark;
}); });
}, },
getRKSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "";
return;
}
const values = data.map((item) => Number(item[column.property]));
if (!values.every((value) => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += "";
if (sums[index] > 1000000) {
sums[index] = "";
}
} else{
sums[index] = ""; //N/A
}
if(column.label == "批次"){
sums[index] = "合计";
}
});
return sums;
},
}, },
}; };
</script> </script>

@ -102,6 +102,18 @@
v-hasPermi="['mes:pro:proroute:import']" v-hasPermi="['mes:pro:proroute:import']"
>批量上传附件</el-button> >批量上传附件</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-download"
:disabled="multiple"
size="mini"
@click="handleSyncProductSAP"
v-hasPermi="['mes:pro:order:add']"
>同步物料工艺
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -116,7 +128,9 @@
>{{scope.row.routeCode}}</el-button> >{{scope.row.routeCode}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="产品编码" align="center" prop="productCode" width="250"/> <el-table-column label="产品编码" align="center" prop="productCode" width="130"
:formatter="productCodeFormate"
/>
<el-table-column label="工艺路线名称" align="center" prop="routeName" width="250"/> <el-table-column label="工艺路线名称" align="center" prop="routeName" width="250"/>
<el-table-column label="工艺路线说明" align="center" prop="routeDesc" width="250"/> <el-table-column label="工艺路线说明" align="center" prop="routeDesc" width="250"/>
<el-table-column label="工艺路线版本" align="center" prop="routeVersion" width="100"/> <el-table-column label="工艺路线版本" align="center" prop="routeVersion" width="100"/>
@ -327,7 +341,7 @@
</template> </template>
<script> <script>
import { listProroute, getProroute, delProroute, addProroute, updateProroute,syncSAP,importProroute } from "@/api/technology/proroute"; import { listProroute, getProroute, delProroute, addProroute, updateProroute,syncSAP,importProroute,syncProductSAP } from "@/api/technology/proroute";
import Routeprocess from "./routeprocess"; import Routeprocess from "./routeprocess";
import Routeprodproduct from "./routeprodproduct"; import Routeprodproduct from "./routeprodproduct";
export default { export default {
@ -341,6 +355,7 @@ export default {
loading: true, loading: true,
// //
ids: [], ids: [],
productCodes:[],
// //
single: true, single: true,
// //
@ -391,6 +406,12 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
//
productCodeFormate(row, column, cellValue){
if(cellValue !=null){
return cellValue.slice(7,18); //
}
},
/** 查询工艺路线列表 */ /** 查询工艺路线列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -441,6 +462,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.routeId) this.ids = selection.map(item => item.routeId)
this.productCodes = selection.map(item => item.productCode)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
@ -594,6 +616,11 @@ export default {
this.$modal.msgSuccess('同步成功') this.$modal.msgSuccess('同步成功')
}).catch(() => { }).catch(() => {
}) })
},
/**选择产品进行工艺同步**/
handleSyncProductSAP(){
const productCodes = this.productCodes;
return syncProductSAP(productCodes);
} }
} }
}; };

Loading…
Cancel
Save