diff --git a/src/views/Need/components/EditView.vue b/src/views/Need/components/EditView.vue
index e29209e..8349849 100644
--- a/src/views/Need/components/EditView.vue
+++ b/src/views/Need/components/EditView.vue
@@ -1,18 +1,23 @@
-
+
+
+
保存
-
半成品编号:
描述:
+ 固定项
+
-
-
-
@@ -103,11 +105,13 @@
} from "/src/api/api/materialType";
import OperateLog from "./OperateLog.vue";
import FormulaView from "./FormulaView.vue";
+ import FreezingColumnSetting from './FreezingColumnSetting.vue';
export default {
components: {
OperateLog,
- FormulaView
+ FormulaView,
+ FreezingColumnSetting
},
setup() {
const dataColumn = ref([]);
@@ -134,7 +138,10 @@
const visible2 = ref(false)
const changeVisible2 = function() {
visible2.value = !visible2.value
- }
+ };
+ const showFreezingColumnSettingBox = ref(false);
+ const freezingColumnSetting = ref([]);
+ const tmpDataColumn = ref([]);
return {
dataColumn,
dataList,
@@ -149,7 +156,10 @@
isShow: false,
isBomShow :false,
visible2,
- changeVisible2
+ changeVisible2,
+ showFreezingColumnSettingBox,
+ freezingColumnSetting,
+ tmpDataColumn
};
},
props: {
@@ -167,7 +177,6 @@
},
methods: {
async getUserPower() {
- console.log('this.dataInfoObj', this.dataInfoObj);
if (this.dataInfoObj.FCanEdit != 2) {
this.userPower[0] = (await getBasicRoleList({
FRoleType: 40,
@@ -260,6 +269,7 @@
this.editColumn = editColumn;
this.dataList = _data.rows;
this.dataColumn = dataColumn;
+
setTimeout(function() {
layer.close(idx);
}, 500);
@@ -346,6 +356,54 @@
layer.close(idx);
layer.msg('您没有做任何更改')
}
+ },
+ _clickFreezingColumnSetting() {
+ this.tmpDataColumn = this.dataColumn;
+ this.dataColumn = ref([]);
+ this.showFreezingColumnSettingBox = true;
+ console.log('before', this.tmpDataColumn);
+ },
+ setFreezingColumns() {
+ let freezingColumns = [];
+ if (this.freezingColumnSetting && this.freezingColumnSetting.length > 0) {
+ this.freezingColumnSetting.forEach(column => {
+ let colIndex = this.tmpDataColumn.findIndex(d => d.key === column);
+ if (colIndex >= 0) {
+ let proxyFc = this.tmpDataColumn.splice(colIndex, 1)[0];
+ const {proxy, revoke} = Proxy.revocable(proxyFc, {});
+ const fc = {...proxy};
+ revoke();
+ console.log('fc', fc);
+ if (fc) {
+ fc.fixed = "left";
+ freezingColumns.push(fc);
+ }
+ }
+ })
+ }
+
+ if (freezingColumns && freezingColumns.length > 0) {
+ for(let i=freezingColumns.length-1; i>=0; i--) {
+ this.tmpDataColumn.unshift(freezingColumns[i]);
+ }
+
+ // freezingColumns = freezingColumns.concat(this.tmpDataColumn);
+ this.dataColumn = this.tmpDataColumn;
+ console.log('after', this.dataColumn);
+ } else {
+ this.dataColumn = this.tmpDataColumn;
+ }
+ },
+ setFreezingColumnsSetting(fcs) {
+ if (fcs && fcs.length > 0) {
+ this.freezingColumnSetting = fcs;
+ // this.freezingColumnSetting = ["FTestCode", "FMaterialGroup", "FWorkCenter"];
+ this.setFreezingColumns();
+ } else {
+ this.dataColumn = this.tmpDataColumn;
+ }
+
+ this.showFreezingColumnSettingBox = false;
}
}
}
diff --git a/src/views/Need/components/FormulaView.vue b/src/views/Need/components/FormulaView.vue
index f92f2d3..58c751d 100644
--- a/src/views/Need/components/FormulaView.vue
+++ b/src/views/Need/components/FormulaView.vue
@@ -80,9 +80,6 @@
}];
let dataList = [];
- console.log('this.teamId', this.teamId);
- console.log('this.halfId', this.halfId);
-
let postData = {
FTeamID: this.teamId,
FViewType: 2,
@@ -95,7 +92,6 @@
let formulaList = result["List1"]
if (formulaList) {
- console.log('formulaList', formulaList);
for (let key in formulaList[0]) {
let width = (key.indexOf("描述") != -1 || key == "文本" || key == "物料") ? "300px" :
"130px";
diff --git a/src/views/Need/components/FreezingColumnSetting.vue b/src/views/Need/components/FreezingColumnSetting.vue
new file mode 100644
index 0000000..7071ac4
--- /dev/null
+++ b/src/views/Need/components/FreezingColumnSetting.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file