Compare commits
3 Commits
852fda1ac2
...
89ebffaf86
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89ebffaf86 | ||
|
|
40f38ef660 | ||
|
|
000af662ee |
@ -17,12 +17,11 @@ export function getDetails(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateFBl(fnumber) {
|
export function updateFBl(data) {
|
||||||
console.log('111',fnumber)
|
|
||||||
return request({
|
return request({
|
||||||
url: '/system/details/updateFBMaterial',
|
url: '/system/details/updateFBMaterial',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: fnumber
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取项目令号列表
|
// 获取项目令号列表
|
||||||
|
|||||||
7
src/api/system/index.js
Normal file
7
src/api/system/index.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
export function indexUrl() {
|
||||||
|
return request({
|
||||||
|
url: '/system/jeecg/getReport',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -114,3 +114,58 @@ export function generatePDFs(rooteProdet) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取物料BOM信息,后端返回物料BOM信息集合
|
||||||
|
export function getBomInfo(materialCode, materialName, productionOrderNo) {
|
||||||
|
return request({
|
||||||
|
url: '/system/route/getBomInfo',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
materialCode,
|
||||||
|
materialName,
|
||||||
|
productionOrderNo // 添加生产订单号参数
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增BOM
|
||||||
|
export function addBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/bom',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改BOM
|
||||||
|
export function updateBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/bom',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除BOM
|
||||||
|
export function deleteBom(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/bom/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索物料
|
||||||
|
export function searchMaterial(params) {
|
||||||
|
return request({
|
||||||
|
url: '/system/material/search',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询物料列表
|
||||||
|
export function listMaterial(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/material/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -18,7 +18,7 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
<el-form-item label="父级图号" prop="partNumber">
|
<el-form-item label="父级图号" prop="fnumber">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.fnumber"
|
v-model="queryParams.fnumber"
|
||||||
placeholder="请输入图号"
|
placeholder="请输入图号"
|
||||||
@ -456,26 +456,30 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加bom明细";
|
this.title = "添加bom明细";
|
||||||
},
|
},
|
||||||
/** 上传bom */
|
|
||||||
updateFBMaterial(row) {
|
updateFBMaterial(row) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.reset();
|
this.reset();
|
||||||
const fnumbers =this.fnumbers
|
|
||||||
console.log(fnumbers)
|
// 获取选中行的数据
|
||||||
updateFBl(fnumbers).then(response => {
|
const selectedData = this.ids.map(id => {
|
||||||
|
const item = this.detailsList.find(row => row.id === id);
|
||||||
|
return {
|
||||||
|
fnumber: item.fnumber, // 物料编码
|
||||||
|
totalWeight: item.totalWeight // 生产令号
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('发送数据:', selectedData);
|
||||||
|
|
||||||
|
// 调用接口
|
||||||
|
updateFBl(selectedData).then(response => {
|
||||||
this.form = response;
|
this.form = response;
|
||||||
const fnumberCount = response.reduce((countMap, item) => {
|
const successCount = response.length;
|
||||||
countMap[item.fnumber] = (countMap[item.fnumber] || 0) + 1;
|
|
||||||
return countMap;
|
|
||||||
}, {});
|
|
||||||
// 获取成功的 fnumber 数量
|
|
||||||
const successCount = Object.keys(fnumberCount).length;
|
|
||||||
//彈窗
|
|
||||||
this.resNotice(successCount);
|
this.resNotice(successCount);
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 弹窗 **/
|
/** 弹窗 **/
|
||||||
resNotice(successCount) {
|
resNotice(successCount) {
|
||||||
this.$alert(`成功上传的条数:${successCount}`, '成功信息', {
|
this.$alert(`成功上传的条数:${successCount}`, '成功信息', {
|
||||||
|
|||||||
@ -136,14 +136,14 @@
|
|||||||
icon="el-icon-folder-opened"
|
icon="el-icon-folder-opened"
|
||||||
@click="handleDetail(scope.row.productionOrderNo)"
|
@click="handleDetail(scope.row.productionOrderNo)"
|
||||||
v-hasPermi="['system:orderPro:view']"
|
v-hasPermi="['system:orderPro:view']"
|
||||||
>查看详情</el-button>
|
>查看工艺</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-folder-opened"
|
icon="el-icon-folder-opened"
|
||||||
@click="handleBOM(scope.row.productionOrderNo)"
|
@click="handleBOM(scope.row.productionOrderNo)"
|
||||||
v-hasPermi="['system:orderPro:view']"
|
v-hasPermi="['system:orderPro:view']"
|
||||||
>查看bom</el-button>
|
>查看BOM</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user