bwm 1 год назад
Родитель
Сommit
49855f198a

+ 2
- 2
src/api/costCalculation.js Просмотреть файл

@@ -2,7 +2,7 @@ import request from "@/service/request";
2 2
 
3 3
 /*新增版本号*/
4 4
 export function costStandardVersionAdd(data) {
5
-    return request.post("/costStandardVersion/add", {}, data, {
5
+    return request.post("/costCount/addCostCountTask", {}, data, {
6 6
         message: {
7 7
             success: "生成成功",
8 8
             error: true
@@ -11,7 +11,7 @@ export function costStandardVersionAdd(data) {
11 11
 }
12 12
 // 查询列表
13 13
 export function costStandardList(params) {
14
-    return request.get(`/costStandard/list`, params);
14
+    return request.get(`/costCount/list`, params);
15 15
 }
16 16
 //删除
17 17
 export function deleteCostStandard(data) {

+ 31
- 19
src/api/modelManagement.js Просмотреть файл

@@ -3,30 +3,42 @@ import request from "@/service/request";
3 3
 export function modelList(params) {
4 4
     return request.get(`/cost-model/pageList`, params);
5 5
 }
6
-// /*新增小时费率*/
7
-// export function addHourRate(data) {
8
-//     return request.post("/hourRate/add", {}, data, {
9
-//         message: {
10
-//             success: "新增成功",
11
-//             error: true
12
-//         }
13
-//     });
14
-// }
15
-// /*编辑小时费率*/
16
-// export function editHourRate(data) {
17
-//     return request.post("/hourRate/edit", {}, data, {
18
-//         message: {
19
-//             success: "编辑成功",
20
-//             error: true
21
-//         }
22
-//     });
23
-// }
6
+/*新增*/
7
+export function addModel(data) {
8
+    return request.post("/cost-model/add", {}, data, {
9
+        message: {
10
+            success: "新增成功",
11
+            error: true
12
+        }
13
+    });
14
+}
15
+/*编辑*/
16
+export function editCostModel(data) {
17
+    return request.post("/cost-model/edit", {}, data, {
18
+        message: {
19
+            success: "编辑成功",
20
+            error: true
21
+        }
22
+    });
23
+}
24 24
 /*删除*/
25 25
 export function deleteModel(data) {
26
-    return request.post("/cost-model/delete",{}, data,{
26
+    return request.delete("/cost-model/delete", data,{
27 27
         message: {
28 28
             success: "删除成功",
29 29
             error: true
30 30
         }
31 31
     });
32 32
 }
33
+/*获取流程管理员列表*/
34
+export function listAll() {
35
+    return request.get(`/sys/user/listAll`);
36
+}
37
+/*获取环境配置*/
38
+export function environmentList(params) {
39
+    return request.get(`/api/environment/list`, params);
40
+}
41
+/*获取操作系统租户*/
42
+export function tenantList(params) {
43
+    return request.get(`/api/tenant/list`, params);
44
+}

+ 2
- 2
src/api/singleLineQuery.js Просмотреть файл

@@ -5,8 +5,8 @@ export function costStandardDetailList(params) {
5 5
     return request.get(`/costStandardDetail/list`, params);
6 6
 }
7 7
 /*导出excel*/
8
-export function exportcostStandardDetail(data) {
9
-    return request.get("/costStandardDetail/exportXls", data, {
8
+export function exportcostStandardDetail(params) {
9
+    return request.get("/costStandardDetail/exportXls", params,{ responseType:"blob"}, {
10 10
         message: {
11 11
             success: "导出成功",
12 12
             error: true

+ 18
- 0
src/platform.ts Просмотреть файл

@@ -60,6 +60,24 @@ export const qomoPlatformOptions = {
60 60
           label: "物流费",
61 61
           value: "LogisticsFee"
62 62
         }
63
+      ],
64
+      statusList:[
65
+        {
66
+          label: "未执行",
67
+          value: "0"
68
+        },
69
+        {
70
+          label: "计算中",
71
+          value: "1"
72
+        },
73
+        {
74
+          label: "计算完成",
75
+          value: "2"
76
+        },
77
+        {
78
+          label: "出错中止",
79
+          value: "3"
80
+        },
63 81
       ]
64 82
     },
65 83
     async provider(dictType) {

+ 60
- 0
src/router/index.js Просмотреть файл

@@ -165,6 +165,66 @@ export const constantRoutes = [
165 165
       }
166 166
     ]
167 167
   },
168
+  {
169
+    path: '',
170
+    component: Layout,
171
+    children: [
172
+      {
173
+        path: "standardComparison/index",
174
+        component: () => import("@/views/standardComparison/index"),
175
+        name: "Standardcomparison",
176
+        meta: { title: "标准成本对比", icon: "tree", affix: true }
177
+      }
178
+    ]
179
+  },
180
+  {
181
+    path: '',
182
+    component: Layout,
183
+    children: [
184
+      {
185
+        path: "standardComparison/manHour",
186
+        component: () => import("@/views/standardComparison/component/manHour"),
187
+        name: "ManHour",
188
+        hidden: true,
189
+      }
190
+    ]
191
+  },
192
+  {
193
+    path: '',
194
+    component: Layout,
195
+    children: [
196
+      {
197
+        path: "standardComparison/artificial",
198
+        component: () => import("@/views/standardComparison/component/artificial"),
199
+        name: "Artificial",
200
+        hidden: true,
201
+      }
202
+    ]
203
+  },
204
+  {
205
+    path: '',
206
+    component: Layout,
207
+    children: [
208
+      {
209
+        path: "standardComparison/materials",
210
+        component: () => import("@/views/standardComparison/component/materials"),
211
+        name: "Materials",
212
+        hidden: true,
213
+      }
214
+    ]
215
+  },
216
+  {
217
+    path: '',
218
+    component: Layout,
219
+    children: [
220
+      {
221
+        path: "stageComparison/index",
222
+        component: () => import("@/views/stageComparison/index"),
223
+        name: "StageComparison",
224
+        meta: { title: "阶段成本对比", icon: "tree", affix: true }
225
+      }
226
+    ]
227
+  },
168 228
   // Bom,工序,采购价格
169 229
 ];
170 230
 

+ 150
- 111
src/views/convolution/costCalculation/component/calculate.vue Просмотреть файл

@@ -1,120 +1,159 @@
1 1
 <script lang="tsx">
2 2
 //表格
3 3
 import { defineComponent, ref, watch } from "vue";
4
-import { costStandardVersionAdd } from '@/api/costCalculation';
4
+import { costStandardVersionAdd } from "@/api/costCalculation";
5
+import { modelList } from "@/api/modelManagement";
5 6
 export default defineComponent({
6
-    props: {
7
-        visible: Boolean,
8
-        tableRef: Object,
9
-    },
10
-    setup(props, { emit }) {
11
-        const forecastDialogRef = ref();
12
-        const rileForm = ref();
13
-        const formData = ref({
14
-            figureNumber: '',
15
-            stage: '',
16
-            createTime: '',
17
-            versionNumber: '',
18
-            materialNumber: '',
19
-            versionYear: ''
20
-        });
21
-        // const rules ={
22
-        //     figureNumber: [
23
-        //         { required: true, message: '请输入图号', trigger: ['blur','change'] }
24
-        //     ],
25
-        //     stage: [
26
-        //         { required: true, message: '请选择项目阶段', trigger: ['blur','change'] }
27
-        //     ],
28
-        //     createTime: [
29
-        //         { required: true, message: '请选择项目时间', trigger: ['blur','change'] }
30
-        //     ],
31
-        //     versionNumber: [
32
-        //         { required: true, message: '请生成版本号', trigger: ['blur','change'] }
33
-        //     ]
34
-        // };
35
-        const render = () => {
36
-            return (
37
-                <div>
38
-                    <base-dialog-form
39
-                        ref={forecastDialogRef}
40
-                        v-model={props.visible}
41
-                        title={"生成设置版本号"}
42
-                        width={400}
43
-                        labelWidth={0}
44
-                        confirm={() => {
45
-                            emit('cancelVisible');
46
-                            const year = formData.value.createTime.split("-")[0];
47
-                            formData.value.versionYear = year;
48
-                            costStandardVersionAdd(formData.value).then(res => {
49
-                                props.tableRef.doReload();
50
-                            })
51
-                        }}
52
-                        cancel={() => {
53
-                            emit('cancelVisible');
54
-                        }}
55
-                    >
56
-                        <el-form ref={rileForm} v-model={formData.value} label-width="100px">
57
-                            <el-form-item label="图号" prop="figureNumber">
58
-                                <el-input v-model={formData.value.figureNumber} onChange={splicing} />
59
-                            </el-form-item>
60
-                            <el-form-item label="物料号" prop="figurmaterialNumbereNumber">
61
-                                <el-input v-model={formData.value.materialNumber} />
62
-                            </el-form-item>
63
-                            <el-form-item label="项目阶段" prop="stage">
64
-                                <el-select v-model={formData.value.stage} placeholder="请选择项目阶段" onChange={splicing}>
65
-                                    <el-option label="初始" value="A"></el-option>
66
-                                    <el-option label="量产" value="B"></el-option>
67
-                                    <el-option label="首批" value="C"></el-option>
68
-                                </el-select>
69
-                            </el-form-item>
70
-                            {/* <el-form-item label="年份" prop="versionYear">
71
-                                <el-date-picker
72
-                                    v-model={formData.value.versionYear}
73
-                                    type="year"
74
-                                    value-format="YYYY"
75
-                                    onChange={splicing}
76
-                                    placeholder="选择年份">
77
-                                </el-date-picker>
78
-                            </el-form-item> */}
79
-                            <el-form-item label="创建日期" prop="createTime">
80
-                                <el-date-picker
81
-                                    v-model={formData.value.createTime}
82
-                                    type="datetime"
83
-                                    disabledDate={(time) => {
84
-                                        return time.getTime() > Date.now();
85
-                                    }}
86
-                                    value-format="YYYY-MM-DD HH:MM:ss"
87
-                                    onChange={splicing}
88
-                                    placeholder="选择日期">
89
-                                </el-date-picker>
90
-                            </el-form-item>
91
-                            <el-form-item label="生成版本号" prop="versionNumber">
92
-                                <el-input type="textarea" disabled rows="2" v-model={formData.value.versionNumber} />
93
-                            </el-form-item>
94
-                        </el-form>
95
-                    </base-dialog-form>
96
-                </div>
97
-
98
-            );
99
-        };
100
-        const splicing = () => {
101
-            formData.value.versionNumber = "";
102
-            formData.value.versionNumber = formData.value.figureNumber + '_' + formData.value.stage + '_' + formData.value.createTime;
7
+  props: {
8
+    visible: Boolean,
9
+    tableRef: Object
10
+  },
11
+  setup(props, { emit }) {
12
+    const forecastDialogRef = ref();
13
+    const rileForm = ref();
14
+    const formData = ref({
15
+      drawingNo: "",
16
+      stage: "",
17
+      createTime: "",
18
+      costVersion: "",
19
+      materialNo: "",
20
+      year: "",
21
+      flowDefinitionId: ""
22
+    });
23
+    const modelSelect = ref([]);
24
+    // const rules ={
25
+    //     figureNumber: [
26
+    //         { required: true, message: '请输入图号', trigger: ['blur','change'] }
27
+    //     ],
28
+    //     stage: [
29
+    //         { required: true, message: '请选择项目阶段', trigger: ['blur','change'] }
30
+    //     ],
31
+    //     createTime: [
32
+    //         { required: true, message: '请选择项目时间', trigger: ['blur','change'] }
33
+    //     ],
34
+    //     versionNumber: [
35
+    //         { required: true, message: '请生成版本号', trigger: ['blur','change'] }
36
+    //     ]
37
+    // };
38
+    const render = () => {
39
+      return (
40
+        <div>
41
+          <base-dialog-form
42
+            ref={forecastDialogRef}
43
+            v-model={props.visible}
44
+            title={"生成设置版本号"}
45
+            width={400}
46
+            labelWidth={0}
47
+            confirm={() => {
48
+              emit("cancelVisible");
49
+              const year = formData.value.createTime.split("-")[0];
50
+              formData.value.year = year;
51
+              costStandardVersionAdd(formData.value).then(res => {
52
+                props.tableRef.doReload();
53
+              });
54
+            }}
55
+            cancel={() => {
56
+              emit("cancelVisible");
57
+            }}
58
+          >
59
+            <el-form
60
+              ref={rileForm}
61
+              v-model={formData.value}
62
+              label-width="100px"
63
+            >
64
+              <el-form-item label="图号" prop="drawingNo">
65
+                <el-input
66
+                  v-model={formData.value.drawingNo}
67
+                  onChange={splicing}
68
+                />
69
+              </el-form-item>
70
+              <el-form-item label="物料号" prop="materialNo">
71
+                <el-input v-model={formData.value.materialNo} />
72
+              </el-form-item>
73
+              <el-form-item label="项目阶段" prop="stage">
74
+                <el-select
75
+                  v-model={formData.value.stage}
76
+                  placeholder="请选择项目阶段"
77
+                  onChange={splicing}
78
+                >
79
+                  <el-option label="初始" value="A"></el-option>
80
+                  <el-option label="量产" value="B"></el-option>
81
+                  <el-option label="首批" value="C"></el-option>
82
+                </el-select>
83
+              </el-form-item>
84
+              <el-form-item label="选择模型" prop="stage">
85
+                <el-select
86
+                  v-model={formData.value.flowDefinitionId}
87
+                  placeholder="请选择项目阶段"
88
+                  onChange={splicing}
89
+                >
90
+                  {modelSelect.value.map(item => (
91
+                    <ElOption
92
+                      key={item.value}
93
+                      label={item.label}
94
+                      value={item.value}
95
+                    />
96
+                  ))}
97
+                </el-select>
98
+              </el-form-item>
99
+              <el-form-item label="创建日期" prop="createTime">
100
+                <el-date-picker
101
+                  v-model={formData.value.createTime}
102
+                  type="datetime"
103
+                  disabledDate={time => {
104
+                    return time.getTime() > Date.now();
105
+                  }}
106
+                  value-format="YYYY-MM-DD HH:MM:ss"
107
+                  onChange={splicing}
108
+                  placeholder="选择日期"
109
+                ></el-date-picker>
110
+              </el-form-item>
111
+              <el-form-item label="生成版本号" prop="costVersion">
112
+                <el-input
113
+                  type="textarea"
114
+                  disabled
115
+                  rows="2"
116
+                  v-model={formData.value.costVersion}
117
+                />
118
+              </el-form-item>
119
+            </el-form>
120
+          </base-dialog-form>
121
+        </div>
122
+      );
123
+    };
124
+    const splicing = () => {
125
+      formData.value.costVersion = "";
126
+      formData.value.costVersion =
127
+        formData.value.drawingNo +
128
+        "_" +
129
+        formData.value.stage +
130
+        "_" +
131
+        formData.value.createTime;
132
+    };
133
+    watch(props, (newVal, oldVal) => {
134
+      if (newVal.visible) {
135
+        formData.value = {
136
+          drawingNo: "",
137
+          stage: "",
138
+          createTime: "",
139
+          costVersion: "",
140
+          materialNo: "",
141
+          year: "",
142
+          flowDefinitionId: ""
103 143
         };
104
-        watch(props, (newVal, oldVal) => {
105
-            if (newVal.visible) {
106
-                formData.value = {
107
-                    figureNumber: '',
108
-                    stage: '',
109
-                    createTime: '',
110
-                    versionNumber: '',
111
-                    materialNumber: '',
112
-                    versionYear: ''
113
-                }
114
-            }
144
+        modelList({ pageNo: 1, pageSize: 999, projectId: 49 }).then(res => {
145
+          modelSelect.value = res.records.map(item => {
146
+            return {
147
+              value: item.id,
148
+              label: item.name
149
+            };
150
+          });
151
+          console.log(modelSelect.value, "PPPPPPPPPPPPPPPPPPPPP");
115 152
         });
116
-        return render;
117
-    },
153
+      }
154
+    });
155
+    return render;
156
+  }
118 157
 });
119 158
 </script>
120 159
 <style lang="scss" scoped></style>

+ 4
- 19
src/views/convolution/costCalculation/index.vue Просмотреть файл

@@ -13,27 +13,12 @@ export default defineComponent({
13 13
         //列
14 14
         const columns = ref([
15 15
             { type: "selection" },
16
-            { label: "版本号", prop: "versionNumber" },
17
-            { label: "年份", prop: "versionYear", valueType: "year" },
18
-            { label: "物料编号", prop: "materialNumber" },
19
-            { prop: "bomCost", label: "bom材料费", hideInAddOrEditForm: true, hideInSearchForm: true },
20
-            { label: "包装费", prop: "packingCost", hideInSearchForm: true },
21
-            { label: "辅料费", prop: "auxiliaryCost", hideInSearchForm: true },
22
-            { label: "人工费", prop: "laborCost", hideInSearchForm: true },
23
-            { label: "机器折旧费", prop: "euipDepreciationCost", hideInSearchForm: true },
24
-            { label: "机器料消耗费", prop: "equipConsumeCost", hideInSearchForm: true },
25
-            { label: "水电费", prop: "hydroelectricityCost", hideInSearchForm: true },
26
-            { label: "其他制造费", prop: "otherCost", hideInSearchForm: true },
27
-            { label: "物流费用", prop: "trailCost", hideInSearchForm: true },
28
-            { label: "制造成本", prop: "manufactureCost", hideInSearchForm: true },
29
-            { label: "工装费", prop: "toolingCost", hideInSearchForm: true },
30
-            { label: "检具费", prop: "inspectionCost", hideInSearchForm: true },
31
-            { label: "模具费", prop: "moldCost", hideInSearchForm: true },
32
-            { label: "测试费", prop: "testCost", hideInSearchForm: true },
16
+            { label: "版本号", prop: "costVersion" },
17
+            { label: "年份", prop: "year", valueType: "year" },
18
+            { label: "物料编号", prop: "materialNo" },
33 19
             { label: "创建日期", prop: "createTime", hideInSearchForm: true, valueType: "datetime" },
34 20
             { label: "阶段", prop: "stage", valueType: 'dict-select', extraProps: { dictType: 'stageData' } },
35
-            { label: "版本状态", prop: "versionStatus" },
36
-            { label: "总成本", prop: "totalCost", hideInSearchForm: true },
21
+            { label: "状态", prop: "status",valueType: 'dict-select',extraProps: { dictType: 'statusList' }  },
37 22
             {
38 23
                 type: "operation",
39 24
                 label: "操作",

+ 20
- 13
src/views/convolution/singleLineQuery/index.vue Просмотреть файл

@@ -3,6 +3,7 @@
3 3
 import { defineComponent, ref } from "vue";
4 4
 import { costStandardDetailList,exportcostStandardDetail } from "@/api/singleLineQuery.js";
5 5
 import { transformPageResponse } from "@/utils/qomo";
6
+import { download } from "@qomo-platform/utils";
6 7
 import { ElMessage } from "element-plus";
7 8
 export default defineComponent({
8 9
   setup() {
@@ -14,20 +15,24 @@ export default defineComponent({
14 15
       { label: "版本号", prop: "versionNumber" },
15 16
       { label: "层级", prop: "level", hideInSearchForm: true },
16 17
       { label: "图号", prop: "figureNumber", hideInSearchForm: true },
17
-      { label: "规格", prop: "specification", hideInSearchForm: true },
18 18
       { label: "用量", prop: "dosage", hideInSearchForm: true },
19
-      { label: "bom材料费", prop: "bomCost", hideInSearchForm: true },
20
-      { label: "本阶人工费", prop: "laborCost", hideInSearchForm: true },
21
-      { label: "机器折旧费", prop: "euipDepreciationCost", hideInSearchForm: true },
22
-      { label: "水电费", prop: "hydroelectricityCost", hideInSearchForm: true },
23
-      { label: "本阶辅料费", prop: "auxiliaryCost", hideInSearchForm: true },
24
-      { label: "其他制造费", prop: "otherCost", hideInSearchForm: true },
25
-      // { label: "累计bom材料费", prop: "date123", hideInSearchForm: true  },
26
-      { label: "累计人工费", prop: "totalLaborCost", hideInSearchForm: true },
27
-      // { label: "累计设备费", prop: "date123", hideInSearchForm: true  },
28
-      { label: "累计水电费", prop: "totalHydroelectricityCost", hideInSearchForm: true },
29
-      // { label: "累计辅料费", prop: "date123", hideInSearchForm: true  },
19
+      { label: "单位", prop: "unit", hideInSearchForm: true },
20
+      { label: "本阶物料成本", prop: "materialCost", hideInSearchForm: true },
21
+      { label: "本阶人工成本", prop: "laborCost", hideInSearchForm: true },
22
+      { label: "本阶设备费", prop: "equipmentCost", hideInSearchForm: true },
23
+      { label: "本阶燃动费", prop: "driveCost", hideInSearchForm: true },
24
+      { label: "本阶辅料费", prop: "supplyMaterialCost", hideInSearchForm: true },
25
+      { label: "本阶其他费", prop: "otherCost", hideInSearchForm: true  },
26
+      { label: "本阶物流费", prop: "logisticsCost", hideInSearchForm: true },
27
+      { label: "本阶标准成本", prop: "currentStandardCost", hideInSearchForm: true  },
28
+      { label: "累计物料成本", prop: "totalMaterialCost", hideInSearchForm: true },
29
+      { label: "累计人工成本", prop: "totalLaborCost", hideInSearchForm: true  },
30
+      { label: "累计设备费", prop: "totalEquipmentCost", hideInSearchForm: true },
31
+      { label: "累计燃动费", prop: "totalDriveCost", hideInSearchForm: true },
32
+      { label: "累计辅料费", prop: "totalSupplyMaterialCost", hideInSearchForm: true },
30 33
       { label: "累计其他费", prop: "totalOtherCost", hideInSearchForm: true },
34
+      { label: "累计物流成本", prop: "totalLogisticsCost", hideInSearchForm: true },
35
+      { label: "累计标准成本", prop: "totalCurrentStandardCost", hideInSearchForm: true },
31 36
     ]);
32 37
 
33 38
     const render = () => {
@@ -62,7 +67,9 @@ export default defineComponent({
62 67
       );
63 68
     };
64 69
     const handleExport = () => {
65
-      exportcostStandardDetail(tableRef.value.selectionRows ? {selections:tableRef.value.selectionRows.map(item => item.id).join(',')} : {} )
70
+      exportcostStandardDetail(tableRef.value.selectionRows ? {selections:tableRef.value.selectionRows.map(item => item.id).join(',')} : {} ).then(res=>{
71
+        download(res, '费用预测明细.xlsx');
72
+      })
66 73
     };
67 74
     return render;
68 75
   },

+ 70
- 29
src/views/convolution/treeQuery/index.vue Просмотреть файл

@@ -35,7 +35,6 @@ export default defineComponent({
35 35
                         await queryBomTree({
36 36
                             ...otherSearchParams
37 37
                         }).then((res) => {
38
-                            console.log(res, "PPPPPPPPPPPPPPPPPPP")
39 38
                             treeData.value = addLabelRecursively(res);
40 39
                         });
41 40
                     }}
@@ -48,56 +47,98 @@ export default defineComponent({
48 47
                                 <div class="treeMain-right">
49 48
                                     <el-form v-model={formData.value} label-width="150px" disabled>
50 49
                                         <el-row>
51
-                                            <el-col span="12">
50
+                                            <el-col span="12" v-show={formData.value.materialNumber}>
52 51
                                                 <el-form-item label="物料编号" prop="materialNumber">
53 52
                                                     <el-input v-model={formData.value.materialNumber} />
54 53
                                                 </el-form-item>
55 54
                                             </el-col>
56
-                                            <el-col span="12">
55
+                                            <el-col span="12" v-show={formData.value.figureNumber}>
57 56
                                                 <el-form-item label="图号" prop="figureNumber">
58 57
                                                     <el-input v-model={formData.value.figureNumber} />
59 58
                                                 </el-form-item>
60 59
                                             </el-col>
61
-                                            <el-col span="12">
62
-                                                <el-form-item label="本阶标准成本" prop="standardCost">
63
-                                                    <el-input v-model={formData.value.standardCost} />
60
+                                            <el-col span="12"  v-show={formData.value.materialCost}>
61
+                                                <el-form-item label="本阶物料成本" prop="materialCost">
62
+                                                    <el-input v-model={formData.value.materialCost} />
64 63
                                                 </el-form-item>
65 64
                                             </el-col>
66
-                                            <el-col span="12">
67
-                                                <el-form-item label="累计标准成本" prop="accumulatedStandardCost">
68
-                                                    <el-input v-model={formData.value.accumulatedStandardCost} />
65
+                                            <el-col span="12"  v-show={formData.value.laborCost}>
66
+                                                <el-form-item label="本阶人工成本" prop="laborCost">
67
+                                                    <el-input v-model={formData.value.laborCost} />
69 68
                                                 </el-form-item>
70 69
                                             </el-col>
71
-                                            <el-col span="12">
72
-                                                <el-form-item label="本阶物料成本" prop="materialCost">
73
-                                                    <el-input v-model={formData.value.materialCost} />
70
+                                            <el-col span="12"  v-show={formData.value.equipmentCost}>
71
+                                                <el-form-item label="本阶设备费" prop="equipmentCost">
72
+                                                    <el-input v-model={formData.value.equipmentCost} />
74 73
                                                 </el-form-item>
75 74
                                             </el-col>
76
-                                            <el-col span="12">
77
-                                                <el-form-item label="累计物料成本" prop="accumulatedMaterialCost">
78
-                                                    <el-input v-model={formData.value.accumulatedMaterialCost} />
75
+                                            <el-col span="12"  v-show={formData.value.driveCost}>
76
+                                                <el-form-item label="本阶燃动费" prop="driveCost">
77
+                                                    <el-input v-model={formData.value.driveCost} />
79 78
                                                 </el-form-item>
80 79
                                             </el-col>
81
-                                            <el-col span="12">
82
-                                                <el-form-item label="本阶人工成本" prop="laborCost">
83
-                                                    <el-input v-model={formData.value.laborCost} />
80
+                                            <el-col span="12"  v-show={formData.value.supplyMaterialCost}>
81
+                                                <el-form-item label="本阶辅料费" prop="supplyMaterialCost">
82
+                                                    <el-input v-model={formData.value.supplyMaterialCost} />
84 83
                                                 </el-form-item>
85 84
                                             </el-col>
86
-                                            <el-col span="12">
87
-                                                <el-form-item label="累计人工成本" prop="accumulatedLaborCost">
88
-                                                    <el-input v-model={formData.value.accumulatedLaborCost} />
85
+                                            <el-col span="12"  v-show={formData.value.otherCost}>
86
+                                                <el-form-item label="本阶其他费" prop="otherCost">
87
+                                                    <el-input v-model={formData.value.otherCost} />
89 88
                                                 </el-form-item>
90 89
                                             </el-col>
91
-                                            {/* <el-col span="12">
92
-                                                <el-form-item label="本阶制造费用" prop="figureNumber">
93
-                                                    <el-input v-model={formData.value.figureNumber} />
90
+                                            <el-col span="12"  v-show={formData.value.logisticsCost}>
91
+                                                <el-form-item label="本阶物流费" prop="logisticsCost">
92
+                                                    <el-input v-model={formData.value.logisticsCost} />
94 93
                                                 </el-form-item>
95
-                                            </el-col> */}
96
-                                            {/* <el-col span="12">
97
-                                                <el-form-item label="累计制作费用" prop="figureNumber">
98
-                                                    <el-input v-model={formData.value.figureNumber} />
94
+                                            </el-col>
95
+                                            <el-col span="12"  v-show={formData.value.currentStandardCost}>
96
+                                                <el-form-item label="本阶标准成本" prop="currentStandardCost">
97
+                                                    <el-input v-model={formData.value.currentStandardCost} />
98
+                                                </el-form-item>
99
+                                            </el-col>
100
+                                            <el-col span="12"  v-show={formData.value.totalMaterialCost}>
101
+                                                <el-form-item label="累计物料成本" prop="totalMaterialCost">
102
+                                                    <el-input v-model={formData.value.totalMaterialCost} />
103
+                                                </el-form-item>
104
+                                            </el-col>
105
+                                            <el-col span="12"  v-show={formData.value.totalLaborCost}>
106
+                                                <el-form-item label="累计人工成本" prop="totalLaborCost">
107
+                                                    <el-input v-model={formData.value.totalLaborCost} />
108
+                                                </el-form-item>
109
+                                            </el-col>
110
+                                            <el-col span="12"  v-show={formData.value.totalEquipmentCost}>
111
+                                                <el-form-item label="累计设备费" prop="totalEquipmentCost">
112
+                                                    <el-input v-model={formData.value.totalEquipmentCost} />
113
+                                                </el-form-item>
114
+                                            </el-col>
115
+                                            <el-col span="12"  v-show={formData.value.totalDriveCost}>
116
+                                                <el-form-item label="累计燃动费" prop="totalDriveCost">
117
+                                                    <el-input v-model={formData.value.totalDriveCost} />
99 118
                                                 </el-form-item>
100
-                                            </el-col> */}
119
+                                            </el-col>
120
+                                            <el-col span="12"  v-show={formData.value.totalSupplyMaterialCost}>
121
+                                                <el-form-item label="累计辅料费" prop="totalSupplyMaterialCost">
122
+                                                    <el-input v-model={formData.value.totalSupplyMaterialCost} />
123
+                                                </el-form-item>
124
+                                            </el-col>
125
+                                            <el-col span="12"  v-show={formData.value.totalOtherCost}>
126
+                                                <el-form-item label="累计其他费" prop="totalOtherCost">
127
+                                                    <el-input v-model={formData.value.totalOtherCost} />
128
+                                                </el-form-item>
129
+                                            </el-col>
130
+                                            <el-col span="12"  v-show={formData.value.totalLogisticsCost}>
131
+                                                <el-form-item label="累计物流成本" prop="totalLogisticsCost">
132
+                                                    <el-input v-model={formData.value.totalLogisticsCost} />
133
+                                                </el-form-item>
134
+                                            </el-col>
135
+                                            <el-col span="12"  v-show={formData.value.totalCurrentStandardCost}>
136
+                                                <el-form-item label="累计标准成本" prop="totalCurrentStandardCost">
137
+                                                    <el-input v-model={formData.value.totalCurrentStandardCost} />
138
+                                                </el-form-item>
139
+                                            </el-col>
140
+                                            {/* TODO 分割 */}
141
+                                            <el-divider></el-divider>
101 142
                                             <el-col span="12">
102 143
                                                 <el-form-item label="人工工时" prop="figureNumber">
103 144
                                                     <el-input v-model={formData.value.figureNumber} />

+ 110
- 50
src/views/modelManagement/index.vue Просмотреть файл

@@ -1,41 +1,105 @@
1 1
 <script lang="tsx">
2 2
 //表格
3
-import { defineComponent, ref } from "vue";
3
+import { defineComponent, ref, onMounted } from "vue";
4 4
 import { ElMessage } from "element-plus";
5
+import { useRouter } from "vue-router";
5 6
 import { transformPageResponse } from "@/utils/qomo";
6
-import { modelList,deleteModel } from "@/api/modelManagement";
7
-import { useRouter } from 'vue-router';
7
+import {
8
+  modelList,
9
+  deleteModel,
10
+  addModel,
11
+  listAll,
12
+  environmentList,
13
+  tenantList,
14
+  editCostModel
15
+} from "@/api/modelManagement";
8 16
 import { ro } from "element-plus/es/locale";
9 17
 export default defineComponent({
10 18
   setup() {
11
-    const router = useRouter();
12 19
     const tableRef = ref();
13
-    const forecastDialogRef = ref();
14 20
     const selectionRows = ref([]);
15
-    // const uploadUrl = ref("/c7525cost/importExcel");
21
+    const userList = ref([]);
22
+    const environmentOptions = ref([]);
23
+    const tenantOptions = ref([]);
24
+    const router = useRouter();
25
+    onMounted(() => {
26
+      listAll().then(res => {
27
+        res.records.forEach(item => {
28
+          userList.value.push({
29
+            label: item.username,
30
+            value: item.id
31
+          });
32
+        });
33
+      });
34
+      environmentList({ pageNo: 1, pageSize: 999 }).then(res => {
35
+        res.records.forEach(item => {
36
+          environmentOptions.value.push({
37
+            label: item.name,
38
+            value: item.id
39
+          });
40
+        });
41
+      });
42
+      tenantList({ pageNo: 1, pageSize: 999 }).then(res => {
43
+        res.records.forEach(item => {
44
+          tenantOptions.value.push({
45
+            label: item.tenantCode,
46
+            value: item.id
47
+          });
48
+        });
49
+      });
50
+    });
16 51
     //列
17 52
     const columns = ref([
18
-      { prop: "drawingNo", label: "图号" },
19
-      { label: "物料号", prop: "materialNo" },
20
-      { label: "物料类型", prop: "materialType" },
21
-      { prop: "modelName", label: "模型名称", hideInSearchForm: true },
22
-      { prop: "modelVersion", label: "模型版本", hideInSearchForm: true },
53
+      { prop: "name", label: "模型名称",render: ({ row }) => <el-link onClick={() => router.push({ path: "/test/index", query: { id: row.id, code:row.code,type:1,space:'标准成本',spaceId:row.projectId } })}>{row?.name}</el-link>},
54
+      { label: "模型编码", prop: "code" },
55
+      {
56
+        label: "模型管理员",
57
+        prop: "userName",
58
+        hideInSearchForm: true,
59
+        hideInAddOrEditForm: true
60
+      },
61
+      {
62
+        label: "模型管理员",
63
+        prop: "userId",
64
+        valueType: "select",
65
+        hideInSearchForm: true,
66
+        hideInTable: true,
67
+        extraProps: { options: userList.value }
68
+      },
23 69
       {
24 70
         valueType: "date",
25
-        prop: "createTime",
26
-        label: "创建时间",
27
-        hideInSearchForm: true
71
+        prop: "updateTime",
72
+        label: "最后修改",
73
+        hideInSearchForm: true,
74
+        hideInAddOrEditForm: true
75
+      },
76
+      {
77
+        prop: "environmentId",
78
+        label: "环境配置",
79
+        valueType: "select",
80
+        extraProps: { options: environmentOptions.value },
81
+        hideInSearchForm: true,
82
+        hideInTable: true
83
+      },
84
+      {
85
+        prop: "tenantId",
86
+        label: "系统租户",
87
+        valueType: "select",
88
+        extraProps: { options: tenantOptions.value },
89
+        hideInSearchForm: true,
90
+        hideInTable: true
28 91
       },
29 92
       {
30
-        prop: "status",
31
-        label: "状态",
32
-        valueType: "dict-select",
33
-        extraProps: { dictType: "modelStatus" }
93
+        prop: "description",
94
+        label: "备注",
95
+        valueType: "textarea",
96
+        extraProps: { dictType: "modelStatus" },
97
+        hideInSearchForm: true
34 98
       },
35 99
       {
36 100
         type: "operation",
37 101
         label: "操作",
38
-        minWidth: 120,
102
+        minWidth: 70,
39 103
         render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
40 104
           <base-table-operation
41 105
             btnList={[
@@ -44,22 +108,27 @@ export default defineComponent({
44 108
                 label: "编辑",
45 109
                 onclick: () => doAddOrEdit(row)
46 110
               },
111
+              {
112
+                key: "edit",
113
+                label: "配置模型",
114
+                onclick: () => editModel(row)
115
+              },
47 116
               {
48 117
                 key: "delete",
49 118
                 label: "删除",
50 119
                 onclick: () => doDeleteRows(row)
51
-              },
52
-              {
53
-                key: "release",
54
-                label: "发布",
55
-                onclick: () => releaseRows(row)
56 120
               }
57 121
             ]}
58 122
           />
59 123
         )
60 124
       }
61 125
     ]);
62
-
126
+    const editModel = row => {
127
+      router.push({
128
+        path: "/test/index",
129
+        query: { id: 123 }
130
+      });
131
+    };
63 132
     const render = () => {
64 133
       return (
65 134
         <div>
@@ -75,26 +144,14 @@ export default defineComponent({
75 144
               current = 1,
76 145
               ...otherSearchParams
77 146
             }) => {
78
-              let tableData = {};
79
-              tableData = transformPageResponse(
147
+              return transformPageResponse(
80 148
                 await modelList({
81 149
                   pageNo: current,
82 150
                   pageSize,
151
+                  projectId: 49,
83 152
                   ...otherSearchParams
84 153
                 })
85 154
               );
86
-              tableData.data.forEach(item => {
87
-                if (item.status == "1") {
88
-                  item.status = "草稿";
89
-                } else if (item.status == "2") {
90
-                  item.status = "已发布";
91
-                } else if (item.status == "3") {
92
-                  item.status = "运行中";
93
-                } else if (item.status == "4") {
94
-                  item.status = "已完成";
95
-                }
96
-              });
97
-              return tableData;
98 155
             }}
99 156
             curdConfig={{
100 157
               /**
@@ -103,21 +160,30 @@ export default defineComponent({
103 160
                */
104 161
               async onAddOrEdit(data) {
105 162
                 if (data.id) {
106
-                  await editHourRate(data);
163
+                  const findName = userList.value.find(
164
+                    item => item.value == data.userId
165
+                  );
166
+                  data.userName = findName.label;
167
+                  await editCostModel(data);
107 168
                 } else {
108
-                  await addHourRate(data);
169
+                  const findName = userList.value.find(
170
+                    item => item.value == data.userId
171
+                  );
172
+                  data.userName = findName.label;
173
+                  data.projectId = 49;
174
+                  await addModel(data);
109 175
                 }
110 176
               },
111 177
               /*删除*/
112 178
               async onDeleteRows(data) {
113 179
                 await deleteModel({ id: data.id });
114 180
               },
115
-              unitColSpan: 12
181
+              unitColSpan: 24
116 182
             }}
117 183
             v-slots={{
118
-              toolbar: () => (
184
+              toolbar: ({ doAddOrEdit }) => (
119 185
                 <el-space>
120
-                  <el-button type="primary" onClick={addModel}>
186
+                  <el-button type="primary" onClick={doAddOrEdit}>
121 187
                     新增模型
122 188
                   </el-button>
123 189
                 </el-space>
@@ -127,12 +193,6 @@ export default defineComponent({
127 193
         </div>
128 194
       );
129 195
     };
130
-    const releaseRows = () => {
131
-      console.log("发布");
132
-    };
133
-    const addModel = () => {
134
-      router.push({ path: "/test/index" });
135
-    }
136 196
     return render;
137 197
   }
138 198
 });

+ 98
- 0
src/views/stageComparison/index.vue Просмотреть файл

@@ -0,0 +1,98 @@
1
+<script lang="tsx">
2
+//表格
3
+import { defineComponent, ref } from "vue";
4
+import {
5
+  costStandardDetailList,
6
+  exportcostStandardDetail
7
+} from "@/api/singleLineQuery.js";
8
+import { transformPageResponse } from "@/utils/qomo";
9
+import { download } from "@qomo-platform/utils";
10
+import { ElMessage } from "element-plus";
11
+export default defineComponent({
12
+  setup() {
13
+    const tableRef = ref();
14
+    //列
15
+    const columns = ref([
16
+      { type: "selection" },
17
+      { prop: "materialNumber", label: "产品编码" },
18
+      { label: "产品名称", prop: "versionNumber" },
19
+      { label: "市场经理", prop: "level", hideInSearchForm: true },
20
+      { label: "项目经理", prop: "figureNumber", hideInSearchForm: true },
21
+      { label: "成本阶段", prop: "dosage", hideInSearchForm: true },
22
+      { label: "版本", prop: "unit", hideInSearchForm: true },
23
+      { label: "BOM材料(含包装材料+辅料)", prop: "materialCost", hideInSearchForm: true },
24
+      { label: "人工费用", prop: "laborCost", hideInSearchForm: true },
25
+      { label: "机器折旧", prop: "equipmentCost", hideInSearchForm: true },
26
+      { label: "机器料消耗", prop: "driveCost", hideInSearchForm: true },
27
+      {
28
+        label: "水电费",
29
+        prop: "supplyMaterialCost",
30
+        hideInSearchForm: true
31
+      },
32
+      { label: "他制费(含物流)", prop: "otherCost", hideInSearchForm: true },
33
+      { label: "制造成本", prop: "logisticsCost", hideInSearchForm: true },
34
+      {
35
+        label: "模具",
36
+        prop: "currentStandardCost",
37
+        hideInSearchForm: true
38
+      },
39
+      {
40
+        label: "工装",
41
+        prop: "totalMaterialCost",
42
+        hideInSearchForm: true
43
+      },
44
+      { label: "检具", prop: "totalLaborCost", hideInSearchForm: true },
45
+      { label: "测试费用", prop: "totalDriveCost", hideInSearchForm: true },
46
+    ]);
47
+
48
+    const render = () => {
49
+      return (
50
+        <BaseTable
51
+          columns={columns.value}
52
+          queryParamsToUrl
53
+          toolbar={{ layout: "search-dnamic,reload,column-setting,fullscreen" }}
54
+          ref={tableRef}
55
+          issortTable
56
+          request={async ({
57
+            pageSize = 10,
58
+            current = 1,
59
+            ...otherSearchParams
60
+          }) => {
61
+            return transformPageResponse(
62
+              await costStandardDetailList({
63
+                pageNo: current,
64
+                pageSize,
65
+                ...otherSearchParams
66
+              })
67
+            );
68
+          }}
69
+          v-slots={{
70
+            toolbar: ({ doAddOrEdit }) => (
71
+              <el-space>
72
+                <el-button type="success" onclick={handleExport}>
73
+                  批量导出
74
+                </el-button>
75
+              </el-space>
76
+            )
77
+          }}
78
+        />
79
+      );
80
+    };
81
+    const handleExport = () => {
82
+      exportcostStandardDetail(
83
+        tableRef.value.selectionRows
84
+          ? {
85
+              selections: tableRef.value.selectionRows
86
+                .map(item => item.id)
87
+                .join(",")
88
+            }
89
+          : {}
90
+      ).then(res => {
91
+        download(res, "费用预测明细.xlsx");
92
+      });
93
+    };
94
+    return render;
95
+  }
96
+});
97
+</script>
98
+<style lang="scss" scoped></style>

+ 118
- 0
src/views/standardComparison/component/artificial.vue Просмотреть файл

@@ -0,0 +1,118 @@
1
+<script lang="tsx">
2
+//表格
3
+import { defineComponent, ref } from "vue";
4
+import { ElMessage } from "element-plus";
5
+import { useRouter } from 'vue-router';
6
+export default defineComponent({
7
+  setup() {
8
+    const tableRef = ref();
9
+    const router = useRouter();
10
+    //列
11
+    const columns = ref([
12
+      { prop: "districtName", label: "内部订单号",hideInSearchForm: true },
13
+      { label: "物料编码", prop: "name",hideInSearchForm: true },
14
+      { label: "物料信息", prop: "date123",hideInSearchForm: true },
15
+      { prop: "createTime", label: "成本中心代码" ,hideInSearchForm: true },
16
+
17
+      { prop: "districtName", label: "成本中心名称",hideInSearchForm: true },
18
+      { label: "基于成品结构用量(版本1)", prop: "name",hideInSearchForm: true },
19
+      { label: "单个零件报工工时(版本1)", prop: "date123",hideInSearchForm: true },
20
+      { prop: "createTime", label: "人工工时(版本1)" ,hideInSearchForm: true },
21
+
22
+      { prop: "districtName", label: "人工费率(版本1)",hideInSearchForm: true },
23
+      { label: "基于成品结构用量(版本2)", prop: "name",hideInSearchForm: true },
24
+      { label: "单个零件报工工时(版本2)", prop: "date123",hideInSearchForm: true },
25
+      { prop: "createTime", label: "人工工时(版本2)" ,hideInSearchForm: true },
26
+
27
+      { prop: "districtName", label: "人工费率(版本2)",hideInSearchForm: true },
28
+      { label: "人工差价", prop: "name",hideInSearchForm: true },
29
+      { label: "人工量差", prop: "date123",hideInSearchForm: true },
30
+      { prop: "createTime", label: "人工总差" ,hideInSearchForm: true },
31
+
32
+      { prop: "districtName", label: "基于成品结构用量(版本1)",hideInSearchForm: true },
33
+      { label: "单个零件报工工时(版本1)", prop: "name",hideInSearchForm: true },
34
+      { label: "燃动力工时(版本1)", prop: "date123",hideInSearchForm: true },
35
+      { prop: "createTime", label: "燃动力费率(版本1)" ,hideInSearchForm: true },
36
+
37
+      { prop: "districtName", label: "基于成品结构用量(版本2)",hideInSearchForm: true },
38
+      { label: "单个零件报工工时(版本2)", prop: "name",hideInSearchForm: true },
39
+      { label: "燃动力工时(版本2)", prop: "date123",hideInSearchForm: true },
40
+      { prop: "createTime", label: "燃动力费率(版本2)" ,hideInSearchForm: true },
41
+
42
+      { prop: "districtName", label: "燃动力价差",hideInSearchForm: true },
43
+      { label: "燃动力量差", prop: "name",hideInSearchForm: true },
44
+      { label: "燃动力总差", prop: "date123",hideInSearchForm: true },
45
+      { prop: "createTime", label: "基于成品结构用量(版本1)" ,hideInSearchForm: true },
46
+
47
+      { prop: "districtName", label: "单个零件报工工时(版本1)",hideInSearchForm: true },
48
+      { label: "辅料工时(版本1)", prop: "name",hideInSearchForm: true },
49
+      { label: "辅料费率(版本1)", prop: "date123",hideInSearchForm: true },
50
+      { prop: "createTime", label: "基于成品结构用量(版本2)" ,hideInSearchForm: true },
51
+
52
+      { prop: "districtName", label: "单个零件报工工时(版本2)",hideInSearchForm: true },
53
+      { label: "辅料工时(版本2)", prop: "name",hideInSearchForm: true },
54
+      { label: "辅料费率(版本2)", prop: "date123",hideInSearchForm: true },
55
+      { prop: "createTime", label: "辅料价差" ,hideInSearchForm: true },
56
+
57
+      { prop: "districtName", label: "辅料量差",hideInSearchForm: true },
58
+      { label: "辅料总差", prop: "name",hideInSearchForm: true },
59
+      { label: "基于成品结构用量(版本1)", prop: "date123",hideInSearchForm: true },
60
+      { prop: "createTime", label: "单个零件报工工时(版本1)" ,hideInSearchForm: true },
61
+
62
+      { prop: "districtName", label: "其他工时(版本1)",hideInSearchForm: true },
63
+      { label: "其他费率(版本1)", prop: "name",hideInSearchForm: true },
64
+      { label: "基于成品结构用量(版本2)", prop: "date123",hideInSearchForm: true },
65
+      { prop: "createTime", label: "单个零件报工工时(版本2)" ,hideInSearchForm: true },
66
+
67
+      { prop: "districtName", label: "其他工时(版本2)",hideInSearchForm: true },
68
+      { label: "其他费率(版本2)", prop: "name",hideInSearchForm: true },
69
+      { label: "其他价差", prop: "date123",hideInSearchForm: true },
70
+      { prop: "createTime", label: "其他量差" ,hideInSearchForm: true },
71
+
72
+      { prop: "districtName", label: "其他总差",hideInSearchForm: true },
73
+    ]);
74
+
75
+    const render = () => {
76
+      return (
77
+        <BaseTable
78
+          columns={columns.value}
79
+          queryParamsToUrl
80
+          ref={tableRef}
81
+          request={async ({ pageSize = 10, current = 1, ...otherSearchParams }) => {
82
+            await new Promise((resolve) => setTimeout(resolve, Math.random() * 1111));
83
+            return {
84
+              data: Array(pageSize)
85
+                .fill(0)
86
+                .map((item, index) => ({
87
+                  id: Math.random(),
88
+                  name: "Tom" + current,
89
+                  date123: "date123" + current,
90
+                  createTime: new Date().getTime(),
91
+                  districtName: "区划" + index,
92
+                  districtName1: "区划1" + index,
93
+                })),
94
+              current,
95
+              // pages: 500 / pageSize,
96
+              total: 500,
97
+            };
98
+          }}
99
+          curdConfig={{
100
+          }}
101
+          v-slots={{
102
+            toolbar: ({ doAddOrEdit }) => (
103
+              <el-space>
104
+                <el-button type="danger" onClick={toBack}>返回</el-button>
105
+              </el-space>
106
+            ),
107
+          }}
108
+        />
109
+      );
110
+    };
111
+    const toBack = ()=>{
112
+      router.go(-1);
113
+    }
114
+    return render;
115
+  },
116
+});
117
+</script>
118
+<style lang="scss" scoped></style>

+ 73
- 0
src/views/standardComparison/component/manHour.vue Просмотреть файл

@@ -0,0 +1,73 @@
1
+<script lang="tsx">
2
+//表格
3
+import { defineComponent, ref } from "vue";
4
+import { ElMessage } from "element-plus";
5
+import { useRouter } from 'vue-router';
6
+export default defineComponent({
7
+  setup() {
8
+    const tableRef = ref();
9
+    const router = useRouter();
10
+    //列
11
+    const columns = ref([
12
+      { prop: "districtName", label: "成本中心代码",hideInSearchForm: true },
13
+      { label: "成本中心代码名称", prop: "name",hideInSearchForm: true },
14
+      { label: "基于成品结构用量(版本1)", prop: "date123",hideInSearchForm: true },
15
+      { prop: "createTime", label: "单个零件报工工时(版本1)" ,hideInSearchForm: true },
16
+      { prop: "districtName", label: "人工工时(版本1)",hideInSearchForm: true },
17
+      { label: "基于成品结构用量(版本2)", prop: "name",hideInSearchForm: true },
18
+      { label: "单个零件报工工时(版本2)", prop: "date123",hideInSearchForm: true },
19
+      { prop: "createTime", label: "人工工时(版本2)" ,hideInSearchForm: true },
20
+      { prop: "districtName", label: "人工工时总差",hideInSearchForm: true },
21
+      { label: "基于成品结构用量(版本1)", prop: "name",hideInSearchForm: true },
22
+      { label: "单个零件报工工时(版本1)", prop: "date123",hideInSearchForm: true },
23
+      { prop: "createTime", label: "机器工时(版本1)" ,hideInSearchForm: true },
24
+      { prop: "districtName", label: "基于成品结构用量(版本2)",hideInSearchForm: true },
25
+      { label: "单个零件报工工时(版本2)", prop: "name",hideInSearchForm: true },
26
+      { label: "机器工时(版本2)", prop: "date123",hideInSearchForm: true },
27
+      { prop: "createTime", label: "机器工时总差" ,hideInSearchForm: true },
28
+    ]);
29
+
30
+    const render = () => {
31
+      return (
32
+        <BaseTable
33
+          columns={columns.value}
34
+          queryParamsToUrl
35
+          ref={tableRef}
36
+          request={async ({ pageSize = 10, current = 1, ...otherSearchParams }) => {
37
+            await new Promise((resolve) => setTimeout(resolve, Math.random() * 1111));
38
+            return {
39
+              data: Array(pageSize)
40
+                .fill(0)
41
+                .map((item, index) => ({
42
+                  id: Math.random(),
43
+                  name: "Tom" + current,
44
+                  date123: "date123" + current,
45
+                  createTime: new Date().getTime(),
46
+                  districtName: "区划" + index,
47
+                  districtName1: "区划1" + index,
48
+                })),
49
+              current,
50
+              // pages: 500 / pageSize,
51
+              total: 500,
52
+            };
53
+          }}
54
+          curdConfig={{
55
+          }}
56
+          v-slots={{
57
+            toolbar: ({ doAddOrEdit }) => (
58
+              <el-space>
59
+                <el-button type="danger" onClick={toBack}>返回</el-button>
60
+              </el-space>
61
+            ),
62
+          }}
63
+        />
64
+      );
65
+    };
66
+    const toBack = ()=>{
67
+      router.go(-1);
68
+    }
69
+    return render;
70
+  },
71
+});
72
+</script>
73
+<style lang="scss" scoped></style>

+ 75
- 0
src/views/standardComparison/component/materials.vue Просмотреть файл

@@ -0,0 +1,75 @@
1
+<script lang="tsx">
2
+//表格
3
+import { defineComponent, ref } from "vue";
4
+import { ElMessage } from "element-plus";
5
+import { useRouter } from 'vue-router';
6
+export default defineComponent({
7
+  setup() {
8
+    const tableRef = ref();
9
+    const router = useRouter();
10
+    //列
11
+    const columns = ref([
12
+      { prop: "districtName", label: "单位",hideInSearchForm: true },
13
+      { label: "采购类型", prop: "name",hideInSearchForm: true },
14
+      { label: "特殊采购类型", prop: "date123",hideInSearchForm: true },
15
+      { prop: "createTime", label: "结构用量" ,hideInSearchForm: true },
16
+
17
+      { prop: "districtName", label: "单位材料价格",hideInSearchForm: true },
18
+      { label: "单位总成本", prop: "name",hideInSearchForm: true },
19
+      { label: "版本1", prop: "date123",hideInSearchForm: true },
20
+      { prop: "createTime", label: "结构用量" ,hideInSearchForm: true },
21
+
22
+      { prop: "districtName", label: "单位材料价格",hideInSearchForm: true },
23
+      { label: "单位总成本", prop: "name",hideInSearchForm: true },
24
+      { label: "版本2", prop: "date123",hideInSearchForm: true },
25
+      { prop: "createTime", label: "结构用量量差" ,hideInSearchForm: true },
26
+
27
+      { prop: "districtName", label: "材料价格价差",hideInSearchForm: true },
28
+      { label: "单位成本差异", prop: "name",hideInSearchForm: true },
29
+      { label: "备注", prop: "date123",hideInSearchForm: true },
30
+    ]);
31
+
32
+    const render = () => {
33
+      return (
34
+        <BaseTable
35
+          columns={columns.value}
36
+          queryParamsToUrl
37
+          ref={tableRef}
38
+          request={async ({ pageSize = 10, current = 1, ...otherSearchParams }) => {
39
+            await new Promise((resolve) => setTimeout(resolve, Math.random() * 1111));
40
+            return {
41
+              data: Array(pageSize)
42
+                .fill(0)
43
+                .map((item, index) => ({
44
+                  id: Math.random(),
45
+                  name: "Tom" + current,
46
+                  date123: "date123" + current,
47
+                  createTime: new Date().getTime(),
48
+                  districtName: "区划" + index,
49
+                  districtName1: "区划1" + index,
50
+                })),
51
+              current,
52
+              // pages: 500 / pageSize,
53
+              total: 500,
54
+            };
55
+          }}
56
+          curdConfig={{
57
+          }}
58
+          v-slots={{
59
+            toolbar: ({ doAddOrEdit }) => (
60
+              <el-space>
61
+                <el-button type="danger" onClick={toBack}>返回</el-button>
62
+              </el-space>
63
+            ),
64
+          }}
65
+        />
66
+      );
67
+    };
68
+    const toBack = ()=>{
69
+      router.go(-1);
70
+    }
71
+    return render;
72
+  },
73
+});
74
+</script>
75
+<style lang="scss" scoped></style>

+ 216
- 0
src/views/standardComparison/index.vue Просмотреть файл

@@ -0,0 +1,216 @@
1
+<script lang="tsx">
2
+//表格
3
+import { defineComponent, ref } from "vue";
4
+import { ElMessage } from "element-plus";
5
+import { transformPageResponse } from "@/utils/qomo";
6
+import { useRouter } from "vue-router";
7
+export default defineComponent({
8
+  setup() {
9
+    const router = useRouter();
10
+    const tableRef = ref();
11
+    const forecastDialogRef = ref();
12
+    const selectionRows = ref([]);
13
+    const btnTitle = ref("工时差异");
14
+    // const uploadUrl = ref("/c7525cost/importExcel");
15
+    //列
16
+    const columnsCheck = ref([
17
+      { prop: "type", label: "对比项", hideInSearchForm: true },
18
+      {
19
+        label: "金额(单位:元)",
20
+        prop: "costCenterCode",
21
+        hideInSearchForm: true
22
+      },
23
+      { label: "版本1", prop: "factory", hideInSearchForm: true },
24
+      { label: "版本2", prop: "factory", hideInSearchForm: true },
25
+      { label: "差异金额", prop: "factory", hideInSearchForm: true },
26
+      {
27
+        type: "operation",
28
+        label: "差异分析",
29
+        minWidth: 120,
30
+        render: ({ row }) => (
31
+          <base-table-operation
32
+            btnList={[
33
+              {
34
+                key: "check",
35
+                label:
36
+                  row.type === 0
37
+                    ? "工时差异"
38
+                    : row.type === 1
39
+                    ? "人工制费差异"
40
+                    : "材料成本差异",
41
+                onclick: () => timeVariance(row)
42
+              }
43
+            ]}
44
+          />
45
+        )
46
+      }
47
+    ]);
48
+    const columns = ref([
49
+      { type: "selection" },
50
+      { prop: "year", label: "内部订单号" },
51
+      { label: "物料号", prop: "costCenterCode" },
52
+      { label: "成本阶段", prop: "factory" },
53
+      { prop: "laborHourRate", label: "版本号", hideInSearchForm: true },
54
+      { prop: "equipHourRate", label: "状态",hideInAddOrEditForm: true},
55
+      {
56
+        prop: "fuelHourRate",
57
+        label: "总标准成本(版本1)",
58
+        hideInSearchForm: true,
59
+        hideInAddOrEditForm: true
60
+      },
61
+      {
62
+        prop: "auxiliaryHourRate",
63
+        label: "总标准成本(版本2)",
64
+        hideInSearchForm: true,
65
+        hideInAddOrEditForm: true
66
+      },
67
+      { prop: "otherHourRate", label: "总差额", hideInSearchForm: true,hideInAddOrEditForm: true },
68
+      { prop: "effectiveDate", label: "差额比", hideInSearchForm: true,hideInAddOrEditForm: true },
69
+      {
70
+        valueType: "date",
71
+        prop: "expirationDate",
72
+        label: "创建时间",
73
+        hideInSearchForm: true,
74
+        hideInAddOrEditForm: true
75
+      },
76
+      {
77
+        type: "operation",
78
+        label: "操作",
79
+        minWidth: 120,
80
+        render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
81
+          <base-table-operation
82
+            btnList={[
83
+              {
84
+                key: "check",
85
+                label: "查看报告",
86
+                onclick: () => checkReport(row)
87
+              }
88
+            ]}
89
+          />
90
+        )
91
+      }
92
+    ]);
93
+
94
+    const render = () => {
95
+      return (
96
+        <div>
97
+          <BaseTable
98
+            columns={columns.value}
99
+            ref={tableRef}
100
+            selectionRows={selectionRows.value}
101
+            toolbar={{
102
+              layout: "search-dnamic,reload,column-setting,fullscreen"
103
+            }}
104
+            request={async ({
105
+              pageSize = 10,
106
+              current = 1,
107
+              ...otherSearchParams
108
+            }) => {
109
+              await new Promise(resolve =>
110
+                setTimeout(resolve, Math.random() * 1111)
111
+              );
112
+              return {
113
+                data: Array(pageSize)
114
+                  .fill(0)
115
+                  .map((item, index) => ({
116
+                    id: Math.random(),
117
+                    name: "Tom" + current,
118
+                    date123: "date123" + current,
119
+                    createTime: new Date().getTime(),
120
+                    districtName: "区划" + index,
121
+                    districtName1: "区划1" + index
122
+                  })),
123
+                current,
124
+                // pages: 500 / pageSize,
125
+                total: 500
126
+              };
127
+            }}
128
+            curdConfig={{
129
+              /**
130
+               * 接受自动表单的数据
131
+               * @param data
132
+               */
133
+              async onAddOrEdit(data) {},
134
+
135
+              unitColSpan: 24
136
+            }}
137
+            v-slots={{
138
+              toolbar: ({ doAddOrEdit, doDeleteRows }) => (
139
+                <el-space>
140
+                  <el-button type="primary" onClick={doAddOrEdit}>
141
+                    添加对比项
142
+                  </el-button>
143
+                </el-space>
144
+              )
145
+            }}
146
+          />
147
+          <BaseDialog
148
+            title="报告详情"
149
+            width="80%"
150
+            ref={forecastDialogRef}
151
+            confirmButtonProps={false}
152
+          >
153
+            <BaseTable
154
+              columns={columnsCheck.value}
155
+              ref={tableRef}
156
+              selectionRows={selectionRows.value}
157
+              request={async ({ pageSize = 10, current = 1 }) => {
158
+                await new Promise(resolve =>
159
+                  setTimeout(resolve, Math.random() * 1111)
160
+                );
161
+                return {
162
+                  data: Array(pageSize)
163
+                    .fill(0)
164
+                    .map((item, index) => ({
165
+                      id: Math.random(),
166
+                      name: "Tom" + current,
167
+                      date123: "date123" + current,
168
+                      createTime: new Date().getTime(),
169
+                      districtName: "区划" + index,
170
+                      districtName1: "区划1" + index,
171
+                      type: index % 3
172
+                    })),
173
+                  current,
174
+                  total: 500
175
+                };
176
+              }}
177
+              curdConfig={{
178
+                /**
179
+                 * 接受自动表单的数据
180
+                 * @param data
181
+                 */
182
+                async onAddOrEdit(data) {},
183
+
184
+                unitColSpan: 24
185
+              }}
186
+            />
187
+          </BaseDialog>
188
+        </div>
189
+      );
190
+    };
191
+    const checkReport = () => {
192
+      forecastDialogRef.value.open();
193
+    };
194
+    const timeVariance = row => {
195
+      if (row.type == 0) {
196
+        // 工时
197
+        router.push({
198
+          path: "/standardComparison/manHour",
199
+        });
200
+      } else if (row.type == 1) {
201
+        // 人工
202
+        router.push({
203
+          path: "/standardComparison/artificial",
204
+        });
205
+      } else if (row.type == 2) {
206
+        // 材料
207
+        router.push({
208
+          path: "/standardComparison/materials",
209
+        });
210
+      }
211
+    };
212
+    return render;
213
+  }
214
+});
215
+</script>
216
+<style lang="scss" scoped></style>

+ 3
- 1
src/views/test/index.vue Просмотреть файл

@@ -18,9 +18,11 @@ import { transformPageResponse } from "@/utils/qomo";
18 18
 import _ from "lodash";
19 19
 import { download } from "@qomo-platform/utils";
20 20
 import request from "@/service/request";
21
+import { useRoute } from 'vue-router';
21 22
 export default defineComponent({
22 23
   name: "flowableOptions",
23 24
   setup(props, { attrs, expose, slots = {} }) {
25
+    const route = useRoute();
24 26
     const { dialogRef, ...exposeDialogArgs } = useExposeDialogArgs();
25 27
 
26 28
     return () => (
@@ -33,7 +35,7 @@ export default defineComponent({
33 35
             return data;
34 36
           }}
35 37
           saveRequest={async data => {
36
-            data.id = '19';
38
+            data.id = route.query.id;
37 39
             data.topMaterialCode = 'mn001';
38 40
             await saveFlowModel(data);
39 41
             //await saveMode(data);

+ 2
- 1
vite.config.js Просмотреть файл

@@ -55,7 +55,8 @@ export default defineConfig(({ mode, command }) => {
55 55
         // https://cn.vitejs.dev/config/#server-proxy
56 56
         "/qomo": {
57 57
           // target: "http://172.16.0.241:8095", //wq
58
-          target: "http://172.16.0.162:8082",  //bgy
58
+          // target: "http://172.16.0.162:8082",  //bgy
59
+          target: "http://172.16.2.127:8082",  //bgy远程
59 60
           // target: "http://192.168.50.9:2999",//中智平台
60 61
           changeOrigin: true,
61 62
           pathRewrite: {