|
|
@@ -488,7 +488,7 @@
|
|
|
<el-input disabled v-model="scope.row.Gy0_ls" :clearable="false"/>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-slot="scope" align="left" label=车间 width="110" >
|
|
|
- <el-input disabled v-model="scope.row.Gy0_site" :clearable="false"/>
|
|
|
+ <el-input v-model="scope.row.Gy0_site" :clearable="false" @keyup.enter="cjxz"/>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-slot="scope" align="left" label=设备编号 width="100" >
|
|
|
<el-input disabled v-model="scope.row.olds_Gy0_sbbh" :clearable="false"/>
|
|
|
@@ -503,6 +503,18 @@
|
|
|
<!-- </div>-->
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog v-model="cjdisplay" :before-close="()=> cjdisplay = false" style="width: 800px;" :title="'车间选择'" destroy-on-close>
|
|
|
+ <el-tree
|
|
|
+ :data="cjList"
|
|
|
+ :render-after-expand="false"
|
|
|
+ @node-click="selectHandle"
|
|
|
+ :props="{children: 'children',label: 'label', value: 'value'}"
|
|
|
+ style="border: 1px solid #ececec; padding: 10px;height: 400px;overflow: auto;"
|
|
|
+ node-key="value"
|
|
|
+ >
|
|
|
+ </el-tree>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!--核算参数调整-->
|
|
|
<el-dialog v-model="hscstzlist" title="核算参数调整" style="width: 100%;height: 100%;margin: 0;">
|
|
|
<el-button type="" @click="hscstzCancel">取消</el-button>
|
|
|
@@ -2277,6 +2289,10 @@ const fjfpxsCancel = () => {fjfpxslist.value = false;};
|
|
|
const pccstzlist = ref(false);
|
|
|
const pccstztableData = ref([]);
|
|
|
const pccstzformData = reactive({cpdh: '',});
|
|
|
+const cjdisplay = ref(false)
|
|
|
+const cjList = ref([])
|
|
|
+const cjtableData = reactive([]); // 表格数据
|
|
|
+let currentRowIndex = null; // 用于存储当前行的索引
|
|
|
//点击【排产参数调整】按钮
|
|
|
const pccstzClick = () => {
|
|
|
if(_product_code.value == null){
|
|
|
@@ -2337,6 +2353,50 @@ const pccstzConfirm = async () => {
|
|
|
//排产参数调整 放弃
|
|
|
const pccstzCancel = () => {pccstzlist.value = false;};
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+//回车车间选择弹窗
|
|
|
+const cjxz = async (rowIndex) =>{
|
|
|
+ currentRowIndex = rowIndex; // 保存当前行的索引
|
|
|
+ cjdisplay.value = true
|
|
|
+ //车间选择数据
|
|
|
+const apiData = await getDepartName()
|
|
|
+ function transformDataToTreeFormat(data) {
|
|
|
+ return Object.entries(data).map(([key, value]) => {
|
|
|
+ // key是车间名称,value是车间内的操作列表
|
|
|
+ const children = Object.entries(value).map(([workshop, operations]) => ({
|
|
|
+ label: workshop,
|
|
|
+ children: operations.map(operation => ({
|
|
|
+ label: operation,
|
|
|
+ value: operation // 可以根据需要添加更多属性
|
|
|
+ }))
|
|
|
+ }));
|
|
|
+ return { label: key, children };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 使用ref来管理转换后的数据
|
|
|
+ cjList.value = ref(transformDataToTreeFormat(apiData.data));
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+// 将选择的车间赋值
|
|
|
+const selectHandle = (node) => {
|
|
|
+console.log('232323',node)
|
|
|
+ if (currentRowIndex !== null) {
|
|
|
+ // 使用currentRowIndex来找到并更新表格中的对应行
|
|
|
+ const row = tableData[currentRowIndex];
|
|
|
+ if (row) {
|
|
|
+ row.Gy0_site = node.label;
|
|
|
+ console.log(row.Gy0_site);
|
|
|
+ // 如果需要,可以在这里调用其他函数来处理更新后的数据
|
|
|
+ }
|
|
|
+ // 关闭对话框
|
|
|
+ cjdisplay.value = false;
|
|
|
+ currentRowIndex = null; // 重置当前行的索引
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
// =========== 核算参数调整 ===========
|
|
|
const hscstzlist = ref(false);
|
|
|
const hscstztableData = ref([]);
|