已重命名1个文件
已删除5个文件
已修改39个文件
| | |
| | | /项ç®ä»£ç /WMS/WIDESEA_WMSServer/WIDESEA_BasicRepository/bin |
| | | /项ç®ä»£ç /WMS/WIDESEA_WMSServer/WIDESEA_BasicRepository/bin |
| | | *.dll |
| | | /项ç®èµæ/èæä¸²å£é©±å¨/vspd6.9
|
| | | /项ç®èµæ/èæä¸²å£é©±å¨/vspd6.9 |
| | | **/.vs/ |
| | |
| | | > |
| | | <div style="display: flex; align-items: center" @click.stop> |
| | | <i |
| | | style=" |
| | | padding: 3px; |
| | | margin-right: 10px; |
| | | color: #8f9293; |
| | | cursor: pointer; |
| | | " |
| | | style="padding: 3px; margin-right: 10px; color: #8f9293; cursor: pointer" |
| | | @click="showUpload(scope.row, column)" |
| | | class="el-icon-upload" |
| | | ></i> |
| | | <img |
| | | v-show="column.edit.type == 'img'" |
| | | v-for="(file, imgIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, imgIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="imgIndex" |
| | | :onerror="defaultImg" |
| | | @click="viewImg(scope.row, column, file.path, $event)" |
| | |
| | | style="margin-right: 8px" |
| | | v-show="column.edit.type != 'img'" |
| | | class="t-file" |
| | | v-for="(file, fIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, fIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="fIndex" |
| | | @click="dowloadFile(file)" |
| | | >{{ file.name }}</a |
| | |
| | | v-model="scope.row[column.field]" |
| | | @change=" |
| | | (val) => { |
| | | column.onChange && |
| | | column.onChange(scope.row, column, val); |
| | | column.onChange && column.onChange(scope.row, column, val); |
| | | } |
| | | " |
| | | :type="column.edit.type" |
| | |
| | | v-model="scope.row[column.field]" |
| | | @change=" |
| | | (val) => { |
| | | column.onChange && |
| | | column.onChange(scope.row, column, val); |
| | | column.onChange && column.onChange(scope.row, column, val); |
| | | } |
| | | " |
| | | :placeholder="column.placeholder || column.title" |
| | |
| | | > |
| | | </el-switch> |
| | | <template |
| | | v-else-if=" |
| | | ['select', 'selectList'].indexOf(column.edit.type) != -1 |
| | | " |
| | | v-else-if="['select', 'selectList'].indexOf(column.edit.type) != -1" |
| | | > |
| | | <el-select-v2 |
| | | style="width: 100%" |
| | |
| | | :placeholder="column.placeholder || column.title" |
| | | :autocomplete="column.autocomplete" |
| | | :options="column.bind.data" |
| | | @change=" |
| | | column.onChange && column.onChange(scope.row, column) |
| | | " |
| | | @change="column.onChange && column.onChange(scope.row, column)" |
| | | clearable |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | |
| | | v-else |
| | | v-model="scope.row[column.field]" |
| | | :filterable=" |
| | | column.filter || column.bind.data.length > 10 |
| | | ? true |
| | | : false |
| | | column.filter || column.bind.data.length > 10 ? true : false |
| | | " |
| | | :multiple="column.edit.type == 'select'" |
| | | :placeholder="column.placeholder || column.title" |
| | | :autocomplete="column.autocomplete" |
| | | @change=" |
| | | column.onChange && column.onChange(scope.row, column) |
| | | " |
| | | @change="column.onChange && column.onChange(scope.row, column)" |
| | | clearable |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | > |
| | |
| | | :disabled="initColumnDisabled(scope.row, column)" |
| | | ></el-input> |
| | | </div> |
| | | <div |
| | | class="extra" |
| | | v-if="column.extra && edit.rowIndex == scope.$index" |
| | | > |
| | | <div class="extra" v-if="column.extra && edit.rowIndex == scope.$index"> |
| | | <a |
| | | :style="column.extra.style" |
| | | style="text-decoration: none" |
| | |
| | | ></a> |
| | | <img |
| | | v-else-if="column.type == 'img'" |
| | | v-for="(file, imgIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, imgIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="imgIndex" |
| | | :onerror="defaultImg" |
| | | @click="viewImg(scope.row, column, file.path, $event)" |
| | |
| | | style="margin-right: 8px" |
| | | v-else-if="column.type == 'file' || column.type == 'excel'" |
| | | class="t-file" |
| | | v-for="(file, fIndex) in getFilePath( |
| | | scope.row[column.field], |
| | | column |
| | | )" |
| | | v-for="(file, fIndex) in getFilePath(scope.row[column.field], column)" |
| | | :key="fIndex" |
| | | @click="dowloadFile(file)" |
| | | >{{ file.name }}</a |
| | |
| | | :effect="column.effect" |
| | | >{{ formatter(scope.row, column, true) }}</el-tag |
| | | > |
| | | <template v-else>{{ |
| | | formatter(scope.row, column, true) |
| | | }}</template> |
| | | <template v-else>{{ formatter(scope.row, column, true) }}</template> |
| | | </div> |
| | | |
| | | <span v-else>{{ formatter(scope.row, column, true) }}</span> |
| | |
| | | :max-file="currentColumn.edit.maxFile" |
| | | :img="currentColumn.edit.type == 'img'" |
| | | :excel="currentColumn.edit.type == 'excel'" |
| | | :fileTypes=" |
| | | currentColumn.edit.fileTypes ? currentColumn.edit.fileTypes : [] |
| | | " |
| | | :fileTypes="currentColumn.edit.fileTypes ? currentColumn.edit.fileTypes : []" |
| | | :fileInfo="fileInfo" |
| | | :upload-after="uploadAfter" |
| | | > |
| | |
| | | <el-button type="default" size="small" @click="uploadModel = false" |
| | | >å
³é</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="saveUpload" |
| | | >ä¿å</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="saveUpload">ä¿å</el-button> |
| | | </div> |
| | | </template> |
| | | </VolBox> |
| | |
| | | }, |
| | | components: { |
| | | "table-render": VolTableRender, |
| | | VolUpload: defineAsyncComponent(() => |
| | | import("@/components/basic/VolUpload.vue") |
| | | ), |
| | | VolUpload: defineAsyncComponent(() => import("@/components/basic/VolUpload.vue")), |
| | | VolBox: defineAsyncComponent(() => import("@/components/basic/VolBox.vue")), |
| | | }, |
| | | props: { |
| | |
| | | default: 500, |
| | | }, |
| | | selectable: { |
| | | |
| | | type: Function, |
| | | default: (row, index) => { |
| | | return true; |
| | |
| | | } |
| | | }); |
| | | if (keys.length > 0) { |
| | | this.http |
| | | .post("/api/Sys_Dictionary/GetVueDictionary", keys) |
| | | .then((dic) => { |
| | | dic.forEach((x) => { |
| | | if (x.data.length > this.select2Count) { |
| | | x.data.forEach((item) => { |
| | | item.label = item.value; |
| | | item.value = item.key; |
| | | this.http.post("/api/Sys_Dictionary/GetVueDictionary", keys).then((dic) => { |
| | | dic.forEach((x) => { |
| | | if (x.data.length > this.select2Count) { |
| | | x.data.forEach((item) => { |
| | | item.label = item.value; |
| | | item.value = item.key; |
| | | }); |
| | | } |
| | | columnBind.forEach((c) => { |
| | | // è½¬æ¢æ°æ®æºçç±»åä¸åçç±»åä¸è´(2020.04.04) |
| | | if (c.key == x.dicNo && (c.valueTyoe == "int" || c.valueTyoe == "sbyte")) { |
| | | x.data.forEach((d) => { |
| | | // 2020.09.01å¢å 对æ°åç±»åçäºæ¬¡å¤æ |
| | | if (!isNaN(d.key)) { |
| | | d.key = ~~d.key; |
| | | } |
| | | }); |
| | | } |
| | | columnBind.forEach((c) => { |
| | | // è½¬æ¢æ°æ®æºçç±»åä¸åçç±»åä¸è´(2020.04.04) |
| | | if ( |
| | | c.key == x.dicNo && |
| | | (c.valueTyoe == "int" || c.valueTyoe == "sbyte") |
| | | ) { |
| | | x.data.forEach((d) => { |
| | | // 2020.09.01å¢å 对æ°åç±»åçäºæ¬¡å¤æ |
| | | if (!isNaN(d.key)) { |
| | | d.key = ~~d.key; |
| | | } |
| | | }); |
| | | } |
| | | if (c.key == x.dicNo) c.data.push(...x.data); |
| | | }); |
| | | if (c.key == x.dicNo) c.data.push(...x.data); |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | this.paginations.sort = this.pagination.sortName; |
| | |
| | | }, |
| | | extraClick(row, column) { |
| | | column.extra.click && |
| | | column.extra.click( |
| | | row, |
| | | column, |
| | | this.url ? this.rowData : this.tableData |
| | | ); |
| | | column.extra.click(row, column, this.url ? this.rowData : this.tableData); |
| | | }, |
| | | headerClick(column, event) { |
| | | if (this.clickEdit && this.edit.rowIndex != -1) { |
| | |
| | | rowDbClick(row, column, event) { |
| | | //2021.05.23å¢å åå»è¡äºä»¶ |
| | | this.$emit("rowDbClick", { row, column, event }); |
| | | },rowClick(row, column, event) { |
| | | // 2022.02.20å¢å ç¹å»æ¶è¡¨æ ¼åæ°å¤æ |
| | | if (!column) { |
| | | return; |
| | | } |
| | | }, |
| | | rowClick(row, column, event) { |
| | | // 2022.02.20å¢å ç¹å»æ¶è¡¨æ ¼åæ°å¤æ |
| | | if (!column) { |
| | | return; |
| | | } |
| | | |
| | | // ===== ä¼åï¼é离å¤éæ¡ç¹å»äºä»¶ï¼é¿å
åæ³¡å¹²æ° å¼å§ ===== |
| | | // 夿ç¹å»ç®æ æ¯å¦æ¯å¤éæ¡ï¼æå¤éæ¡æå¨çåå
æ ¼/徿 ï¼ |
| | | const targetEl = event.target; |
| | | const isCheckbox = targetEl.classList.contains('el-checkbox__input') || |
| | | targetEl.closest('.el-checkbox__input') || |
| | | targetEl.closest('.el-table-column--selection'); |
| | | // 妿ç¹å»çæ¯å¤éæ¡åºåï¼ç´æ¥è¿åï¼ä¸æ§è¡è¡éä¸é»è¾ |
| | | if (isCheckbox) { |
| | | return; |
| | | } |
| | | // ===== ä¼åï¼é离å¤éæ¡ç¹å»äºä»¶ ç»æ ===== |
| | | // ===== ä¼åï¼é离å¤éæ¡ç¹å»äºä»¶ï¼é¿å
åæ³¡å¹²æ° å¼å§ ===== |
| | | // 夿ç¹å»ç®æ æ¯å¦æ¯å¤éæ¡ï¼æå¤éæ¡æå¨çåå
æ ¼/徿 ï¼ |
| | | const targetEl = event.target; |
| | | const isCheckbox = |
| | | targetEl.classList.contains("el-checkbox__input") || |
| | | targetEl.closest(".el-checkbox__input") || |
| | | targetEl.closest(".el-table-column--selection"); |
| | | // 妿ç¹å»çæ¯å¤éæ¡åºåï¼ç´æ¥è¿åï¼ä¸æ§è¡è¡éä¸é»è¾ |
| | | if (isCheckbox) { |
| | | return; |
| | | } |
| | | // ===== ä¼åï¼é离å¤éæ¡ç¹å»äºä»¶ ç»æ ===== |
| | | |
| | | // ===== ä¼åï¼ç¹å»è¡éä¸/忢å¤éæ¡ å¼å§ ===== |
| | | // 1. 夿æ¯å¦æ¾ç¤ºå¤éæ¡ï¼ck为trueï¼ï¼ä¸æ¾ç¤ºåæ éå¤ç |
| | | // 2. ç¼è¾ç¶æä¸ä¸è§¦åï¼é¿å
å¹²æ°ç¼è¾åè½ï¼ |
| | | if (this.ck && this.edit.rowIndex === -1) { |
| | | // 3. åéåºæ¯ï¼single为trueï¼ï¼å
æ¸
空ææéä¸é¡¹ï¼å强å¶éä¸å½åè¡ï¼ä¿æåéé»è¾ï¼ |
| | | if (this.single) { |
| | | this.$refs.table.clearSelection(); // æ¸
空ææéä¸ |
| | | this.$refs.table.toggleRowSelection(row, true); // åéåºæ¯å¼ºå¶éä¸å½åè¡ |
| | | } |
| | | // 4. å¤éåºæ¯ï¼single为falseï¼ï¼ä¸ä¼ 第äºä¸ªåæ°ï¼å®ç°åæ¢éä¸/åæ¶ç¶æ |
| | | else { |
| | | this.$refs.table.toggleRowSelection(row); // åæ¢ç¶æï¼æ¯æåæ¶éä¸ |
| | | } |
| | | } |
| | | // ===== ä¼åï¼ç¹å»è¡éä¸/忢å¤éæ¡ ç»æ ===== |
| | | |
| | | // æ£å¨ç¼è¾æ¶ï¼ç¦æ¢è§¦årowClickäºä»¶ |
| | | if (this.edit.rowIndex == -1) { |
| | | this.$emit("rowClick", { row, column, event }); |
| | | } |
| | | // ç¹å»è¡äºä»¶(2020.11.07) |
| | | if (!this.doubleEdit) { |
| | | return; |
| | | } |
| | | // ç¹å»å
¶ä»è¡æ¶ï¼å¦æç¹å»çè¡ä¸æ£å¨ç¼è¾çè¡ç¸åï¼ä¿æç¼è¾ç¶æ |
| | | if (this.clickEdit && this.edit.rowIndex != -1) { |
| | | if (row.elementIndex == this.edit.rowIndex) { |
| | | // ç¹å»çåå
æ ¼å¦æä¸å¯ä»¥ç¼è¾ï¼ç´æ¥ç»æç¼è¾ |
| | | // 2020.10.12ä¿®å¤ç»æç¼è¾æ¶ï¼element tableé«çæ¬å±æ§è·åä¸å°çé®é¢ |
| | | let _col = this.columns.find((x) => { |
| | | return x.field == ((event && event.property) || column.property); |
| | | }); |
| | | if (_col && (!_col.edit || _col.readonly)) { |
| | | if (this.rowEndEdit(row, event)) { |
| | | this.edit.rowIndex = -1; |
| | | // ===== ä¼åï¼ç¹å»è¡éä¸/忢å¤éæ¡ å¼å§ ===== |
| | | // 1. 夿æ¯å¦æ¾ç¤ºå¤éæ¡ï¼ck为trueï¼ï¼ä¸æ¾ç¤ºåæ éå¤ç |
| | | // 2. ç¼è¾ç¶æä¸ä¸è§¦åï¼é¿å
å¹²æ°ç¼è¾åè½ï¼ |
| | | if (this.ck && this.edit.rowIndex === -1) { |
| | | // 3. åéåºæ¯ï¼single为trueï¼ï¼å
æ¸
空ææéä¸é¡¹ï¼å强å¶éä¸å½åè¡ï¼ä¿æåéé»è¾ï¼ |
| | | if (this.single) { |
| | | this.$refs.table.clearSelection(); // æ¸
空ææéä¸ |
| | | this.$refs.table.toggleRowSelection(row, true); // åéåºæ¯å¼ºå¶éä¸å½åè¡ |
| | | } |
| | | // 4. å¤éåºæ¯ï¼single为falseï¼ï¼ä¸ä¼ 第äºä¸ªåæ°ï¼å®ç°åæ¢éä¸/åæ¶ç¶æ |
| | | else { |
| | | this.$refs.table.toggleRowSelection(row); // åæ¢ç¶æï¼æ¯æåæ¶éä¸ |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | if (this.rowEndEdit(row, event && event.property ? event : column)) { |
| | | this.edit.rowIndex = -1; |
| | | } |
| | | //彿£å¨ç¼è¾ï¼ä¸ç¹å»å°å
¶ä»è¡æ¶ï¼å¨åç¼è¾çè¡ç»æç¼è¾åï¼è§¦åæ°è¡çrowClickäºä»¶ |
| | | //æ£å¨ç¼è¾æ¶ï¼ç¦æ¢è§¦årowClickäºä»¶ |
| | | if (this.edit.rowIndex == -1) { |
| | | this.$emit("rowClick", { row, column, event }); |
| | | } |
| | | } |
| | | this.rowBeginEdit(row, column); |
| | | }, |
| | | // ===== ä¼åï¼ç¹å»è¡éä¸/忢å¤éæ¡ ç»æ ===== |
| | | |
| | | // æ£å¨ç¼è¾æ¶ï¼ç¦æ¢è§¦årowClickäºä»¶ |
| | | if (this.edit.rowIndex == -1) { |
| | | this.$emit("rowClick", { row, column, event }); |
| | | } |
| | | // ç¹å»è¡äºä»¶(2020.11.07) |
| | | if (!this.doubleEdit) { |
| | | return; |
| | | } |
| | | // ç¹å»å
¶ä»è¡æ¶ï¼å¦æç¹å»çè¡ä¸æ£å¨ç¼è¾çè¡ç¸åï¼ä¿æç¼è¾ç¶æ |
| | | if (this.clickEdit && this.edit.rowIndex != -1) { |
| | | if (row.elementIndex == this.edit.rowIndex) { |
| | | // ç¹å»çåå
æ ¼å¦æä¸å¯ä»¥ç¼è¾ï¼ç´æ¥ç»æç¼è¾ |
| | | // 2020.10.12ä¿®å¤ç»æç¼è¾æ¶ï¼element tableé«çæ¬å±æ§è·åä¸å°çé®é¢ |
| | | let _col = this.columns.find((x) => { |
| | | return x.field == ((event && event.property) || column.property); |
| | | }); |
| | | if (_col && (!_col.edit || _col.readonly)) { |
| | | if (this.rowEndEdit(row, event)) { |
| | | this.edit.rowIndex = -1; |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | if (this.rowEndEdit(row, event && event.property ? event : column)) { |
| | | this.edit.rowIndex = -1; |
| | | } |
| | | //彿£å¨ç¼è¾ï¼ä¸ç¹å»å°å
¶ä»è¡æ¶ï¼å¨åç¼è¾çè¡ç»æç¼è¾åï¼è§¦åæ°è¡çrowClickäºä»¶ |
| | | //æ£å¨ç¼è¾æ¶ï¼ç¦æ¢è§¦årowClickäºä»¶ |
| | | if (this.edit.rowIndex == -1) { |
| | | this.$emit("rowClick", { row, column, event }); |
| | | } |
| | | } |
| | | this.rowBeginEdit(row, column); |
| | | }, |
| | | |
| | | // //æ£å¨ç¼è¾æ¶ï¼ç¦æ¢åºårowClickäºä»¶ |
| | | // if (this.edit.rowIndex == -1) { |
| | |
| | | if (column.base64) { |
| | | fileInfo.push({ |
| | | name: "", |
| | | path: |
| | | (file.indexOf("data") == -1 ? "data:image/png;base64," : "") + |
| | | file, |
| | | path: (file.indexOf("data") == -1 ? "data:image/png;base64," : "") + file, |
| | | }); |
| | | } else if (file.indexOf(".") != -1) { |
| | | let splitFile = file.split("/"); |
| | |
| | | this.edit.rowIndex = -1; |
| | | return; |
| | | } |
| | | let row = (this.url ? this.rowData : this.tableData)[ |
| | | this.edit.rowIndex |
| | | ]; |
| | | let row = (this.url ? this.rowData : this.tableData)[this.edit.rowIndex]; |
| | | for (let index = 0; index < this.columns.length; index++) { |
| | | const _column = this.columns[index]; |
| | | if (_column.edit) { |
| | |
| | | let data = this.url ? this.rowData : this.tableData; |
| | | let indexArr = this.getSelectedIndex(); |
| | | if (indexArr.length == 0) { |
| | | return this.$Message.error( |
| | | "å 餿ä½å¿
须设置VolTableç屿§index='true'" |
| | | ); |
| | | return this.$Message.error("å 餿ä½å¿
须设置VolTableç屿§index='true'"); |
| | | } |
| | | // if (indexArr.length == 0 || !this.key) { |
| | | // return this.$message.error( |
| | |
| | | } |
| | | if (remoteInfo.length == 0) return; |
| | | // ha= Object.assign([], ha, hb) |
| | | this.http |
| | | .post("/api/Sys_Dictionary/GetTableDictionary", remoteInfo) |
| | | .then((dic) => { |
| | | dic.forEach((x) => { |
| | | this.remoteColumns.forEach((column) => { |
| | | if (column.bind.key == x.key) { |
| | | column.bind.data = Object.assign([], column.bind.data, x.data); |
| | | // column.bind.data.push(...x.data); |
| | | } |
| | | }); |
| | | this.http.post("/api/Sys_Dictionary/GetTableDictionary", remoteInfo).then((dic) => { |
| | | dic.forEach((x) => { |
| | | this.remoteColumns.forEach((column) => { |
| | | if (column.bind.key == x.key) { |
| | | column.bind.data = Object.assign([], column.bind.data, x.data); |
| | | // column.bind.data.push(...x.data); |
| | | } |
| | | }); |
| | | this.$emit("dicInited", dic); |
| | | }); |
| | | this.$emit("dicInited", dic); |
| | | }); |
| | | }, |
| | | load(query, isResetPage) { |
| | | // isResetPageéç½®åé¡µæ°æ® |
| | |
| | | if (data.summary.hasOwnProperty(col.field)) { |
| | | let sum = data.summary[col.field]; |
| | | if (sum) { |
| | | sum = |
| | | (sum * 1.0).toFixed(col.numberLength || 2).replace(".00", "") * |
| | | 1.0; |
| | | sum = (sum * 1.0).toFixed(col.numberLength || 2).replace(".00", "") * 1.0; |
| | | } |
| | | this.summaryData.push(sum); |
| | | } else { |
| | |
| | | : column.bind.data |
| | | ).forEach((x) => { |
| | | // 2020.06.06ä¿®å¤æ°æ®æºä¸ºselectListæ¶,key为æ°å0æ¶ä¸è½è½¬æ¢ææ¬çé®é¢ |
| | | if ( |
| | | x.key !== "" && |
| | | x.key !== undefined && |
| | | x.key + "" == valArr[index] + "" |
| | | ) { |
| | | if (x.key !== "" && x.key !== undefined && x.key + "" == valArr[index] + "") { |
| | | valArr[index] = x.label || x.value; |
| | | } |
| | | }); |
| | |
| | | if (column.summary == "avg") { |
| | | sum = sum / (this.rowData.length || this.tableData.length || 1); |
| | | } |
| | | sum = |
| | | (sum * 1.0).toFixed(column.numberLength || 2).replace(".00", "") * |
| | | 1.0; |
| | | sum = (sum * 1.0).toFixed(column.numberLength || 2).replace(".00", "") * 1.0; |
| | | } |
| | | this.summaryData[this.summaryIndex[column.field]] = sum; |
| | | }, |
| | |
| | | return true; |
| | | } |
| | | return ( |
| | | date1.valueOf() < |
| | | (typeof date2 == "number" ? date2 : new Date(date2).valueOf()) |
| | | date1.valueOf() < (typeof date2 == "number" ? date2 : new Date(date2).valueOf()) |
| | | ); |
| | | }, |
| | | getDateOptions(date, item) { |
| | |
| | | //ä¸è®¾ç½®æ¶åç§ï¼åé¢ä¼èªå¨å ä¸ 08:00 |
| | | item.min = item.min + " 00:00:000"; |
| | | } |
| | | return ( |
| | | this.compareDate(date, item.min) || !this.compareDate(date, item.max) |
| | | ); |
| | | return this.compareDate(date, item.min) || !this.compareDate(date, item.max); |
| | | }, |
| | | getDateFormat(column) { |
| | | //è§https://day.js.org/docs/zh-CN/display/format |
| | |
| | | |
| | | if (this.currentColumn.edit.url === undefined) { |
| | | this.uploadUrl = |
| | | "api/" + |
| | | (this.url || "").replace("/api", "api").split("/")[1] + |
| | | "/upload"; |
| | | "api/" + (this.url || "").replace("/api", "api").split("/")[1] + "/upload"; |
| | | } else { |
| | | this.uploadUrl = this.currentColumn.edit.url; |
| | | } |
| | | this.uploadModel = true; |
| | | }, |
| | | uploadAfter(result, files) { |
| | | this.currentColumn.uploadAfter && |
| | | this.currentColumn.uploadAfter(result, files); |
| | | this.currentColumn.uploadAfter && this.currentColumn.uploadAfter(result, files); |
| | | return true; |
| | | }, |
| | | saveUpload() { |
| | |
| | | |
| | | let extension = { |
| | | components: {//卿æ©å
ç»ä»¶æç»ä»¶è·¯å¾ |
| | | //表åheaderãcontentãfooter对åºä½ç½®æ©å
çç»ä»¶ |
| | | gridHeader:'', |
| | | gridBody: '', |
| | | gridbody:'', |
| | | gridFooter: '', |
| | | //å¼¹åºæ¡(ä¿®æ¹ãç¼è¾ãæ¥ç)headerãcontentãfooter对åºä½ç½®æ©å
çç»ä»¶ |
| | | modelHeader: '', |
| | |
| | | buttons: [],//æ©å±çæé® |
| | | methods: {//äºä»¶æ©å± |
| | | onInit() { |
| | | var detailImport = this.detailOptions.buttons.find(item=>item.value == 'import'); |
| | | if(detailImport){ |
| | | detailImport.onClick = () => { |
| | | this.$refs.gridBody.open(); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | onInited() { |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div class="container"> |
| | | <!-- 左侧åºå - æ 任使 颿 注 --> |
| | | <!-- 左侧åºå - ä»
ä¿çä¿¡å·ç¯+æå/é¶ä»¶åºå --> |
| | | <div class="left-area"> |
| | | <div class="left-top"> |
| | | <!-- æé®+ä¿¡å· æ¨ªåæåå®¹å¨ --> |
| | | <div class="btn-signal-group"> |
| | | <!-- æé®ç» - ä¿®æ¹ä¸ºä¸ä¸æå --> |
| | | <div class="btn-group"> |
| | | <button |
| | | class="btn" |
| | | :class="isPLCStarted ? 'stop-btn' : 'start-btn'" |
| | | @click="handleToggle" |
| | | <div class="signal-status"> |
| | | <div class="signal-item" v-for="(signal, index) in signalStates" :key="index"> |
| | | <div |
| | | class="signal-light" |
| | | :class="signal ? 'signal-active' : 'signal-inactive'" |
| | | > |
| | | <i class="icon" :class="isPLCStarted ? 'icon-stop' : 'icon-start'"></i> |
| | | {{ isPLCStarted ? "å
³é" : "å¯å¨" }} |
| | | </button> |
| | | <button |
| | | class="btn" |
| | | :class="isPLCPaused ? 'resume-btn' : 'pause-btn'" |
| | | @click="handlePauseToggle" |
| | | :disabled="!isPLCStarted" |
| | | > |
| | | <i class="icon" :class="isPLCPaused ? 'icon-resume' : 'icon-pause'"></i> |
| | | {{ isPLCPaused ? "æ¢å¤" : "æå" }} |
| | | </button> |
| | | </div> |
| | | |
| | | <!-- ä¿¡å·ç¯ç» å 两个æé®å®½åº¦ + æ´ä½æ¾å¤§ --> |
| | | <div class="signal-status"> |
| | | <div class="signal-item" v-for="(signal, index) in signalStates" :key="index"> |
| | | <div |
| | | class="signal-light" |
| | | :class="signal ? 'signal-active' : 'signal-inactive'" |
| | | > |
| | | <div class="signal-light-inner"></div> |
| | | </div> |
| | | <span class="signal-label">{{ signalLabels[index] }}</span> |
| | | <div class="signal-light-inner"></div> |
| | | </div> |
| | | <span class="signal-label">{{ signalLabels[index] }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | class="part-checkbox" |
| | | v-model="leftPartChecked[index]" |
| | | @change="handlePartCheck(index)" |
| | | :disabled="checkLoading[index]" |
| | | /> |
| | | <span class="checkmark"></span> |
| | | <span class="checkbox-label">{{ |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- å³ä¾§åºå - æ 任使 颿 注 ãå·²å 餿¸
空+ä¿åæé®ã --> |
| | | <!-- å³ä¾§åºå - ä¿çåæå½å
¥+æäº¤+æ¸
é¤åè½ --> |
| | | <div class="right-area"> |
| | | <div class="right-top"> |
| | | <div class="form-row"> |
| | | <div class="form-row input-submit-row"> |
| | | <span class="label">å½å
¥æ¡ï¼</span> |
| | | <!-- â
åªä¿ç纯å½å
¥æ¡ï¼æ¸
空/ä¿åæé®å·²å é¤ --> |
| | | <input type="text" class="input-box" v-model="rightTopInput" /> |
| | | <button class="btn save-btn submit-input-btn" @click="saveData"> |
| | | <i class="icon icon-submit"></i>æäº¤ |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="right-bottom"> |
| | | <div class="form-row tooling-board-row"> |
| | | <span class="short-label">å·¥è£
æ¿ç¼å·ï¼</span> |
| | | <input |
| | | type="text" |
| | | class="input-box short-input" |
| | | v-model="toolingBoardNo" |
| | | placeholder="请è¾å
¥å·¥è£
æ¿ç¼å·" |
| | | /> |
| | | <button class="btn clear-btn" @click="clearToolingBoardNo"> |
| | | <i class="icon icon-clear"></i>æ¸
é¤ |
| | | </button> |
| | | <button class="btn save-btn" @click="saveToolingBoardNo"> |
| | | <i class="icon icon-submit"></i>æäº¤ |
| | | </button> |
| | | </div> |
| | | <div class="parts-list"> |
| | | <div class="form-row part-item finished-product-row"> |
| | | <span class="label">æåç¼å·ï¼</span> |
| | |
| | | |
| | | export default { |
| | | setup() { |
| | | // åºç¡æ°æ®å®ä¹ - 1:1ç²¾å对æ¥å端 æåç¼å·+é¶ä»¶ç¼å· æ åä½å
¼å®¹ |
| | | const finishedProduct = ref(""); // 左侧æåç¼å·ï¼GetLeftInitialDataæ¥å£è¿åï¼ |
| | | const finishedProductId = ref(""); |
| | | const rightTopInput = ref(""); |
| | | // åºç¡æ°æ®å®ä¹ |
| | | const finishedProduct = ref(""); // 左侧æåç¼å·ï¼æ¥å£è¿åï¼ |
| | | const finishedProductId = ref(""); // 左侧æåIDï¼æ¥å£è¿åï¼ |
| | | const rightTopInput = ref(""); // å³ä¾§æ ¸å¿å½å
¥æ¡ |
| | | const leftPartCodes = ref(Array(10).fill("")); // 左侧é¶ä»¶ç¼å·æ°ç» |
| | | const rightPartCodes = ref(Array(10).fill("")); // å³ä¾§é¶ä»¶ç¼å·æ°ç» |
| | | const leftPartChecked = ref(Array(10).fill(false)); |
| | | const toolingBoardNo = ref(""); |
| | | const fillIndex = ref(-1); |
| | | const leftPartIds = ref(Array(10).fill("")); |
| | | const finishedProductCode = ref(""); // å³ä¾§æåç¼å·ï¼å·¥è£
æ¿æ¥å£è¿åï¼ |
| | | const leftPartChecked = ref(Array(10).fill(false)); // 左侧é¶ä»¶å¾éç¶æ |
| | | const leftPartIds = ref(Array(10).fill("")); // 左侧é¶ä»¶IDï¼æ¥å£è¿åï¼ |
| | | const finishedProductCode = ref(""); // å³ä¾§æåç¼å·è¾å
¥æ¡ |
| | | const fillIndex = ref(-1); // å½å
¥æ¡èªå¨å¡«å
ç´¢å¼ |
| | | const checkLoading = ref(Array(10).fill(false)); // é¶ä»¶å¾éå è½½é |
| | | |
| | | // PLCç¶æ |
| | | const isPLCStarted = ref(false); |
| | | const isPLCPaused = ref(false); |
| | | |
| | | // ä¿¡å·ç¸å
³ |
| | | // ä¿¡å·ç¯ç¸å
³ |
| | | const signalStates = ref([false, false, false, false, false]); |
| | | const signalLabels = ref([ |
| | | "å¿è·³ä¿¡å·", |
| | |
| | | "æ
éä¿¡å·", |
| | | ]); |
| | | |
| | | // 宿¶è½®è¯¢æ ¸å¿é
ç½® |
| | | // 宿¶/鲿ç¸å
³åé |
| | | let pollingTimer = null; |
| | | const pollingInterval = 5000; |
| | | const pollingInterval = 5000; // ä¿¡å·ç¯è½®è¯¢é´é5ç§ |
| | | let checkDebounceTimer = null; |
| | | let destroyDelayTimer = null; |
| | | const destroyDelayTime = 500; // â
æ ¸å¿ï¼å¡«å
+æ¸
空 é½å»¶è¿500æ¯«ç§ |
| | | let boardCodeDebounceTimer = null; |
| | | // â
æ°å¢ï¼èªå¨æäº¤é²æå®æ¶å¨ï¼é²æ¢éå¤æäº¤ |
| | | const destroyDelayTime = 500; // å½å
¥æ¡å¡«å
å»¶è¿500ms |
| | | let autoSubmitDebounceTimer = null; |
| | | // â
æ°å¢ï¼æäº¤éï¼é²æ¢æ å¾éæ¶éå¤è§¦åæäº¤ |
| | | let submitLock = ref(false); |
| | | let submitLock = ref(false); // æäº¤éï¼é²æ¢éå¤æäº¤ |
| | | |
| | | // â
â
â
æ ¸å¿æ°å¢1ï¼è®¡ç®å±æ§ - 宿¶ç»è®¡å·¦ä¾§å¾éçå¤éæ¡æ°é (èªå¨æ´æ°) |
| | | // 计ç®å±æ§ - ç»è®¡ææå¾é/å¡«å
æ°éï¼è¿æ»¤ç©ºå¼ï¼ |
| | | const checkedCount = computed(() => { |
| | | // ç»è®¡leftPartCheckedæ°ç»ä¸ä¸ºtrueçæ°é |
| | | return leftPartChecked.value.filter((checked) => checked === true).length; |
| | | }); |
| | | |
| | | // â
â
â
æ ¸å¿æ°å¢2ï¼è®¡ç®å±æ§ - 宿¶ç»è®¡å³ä¾§å·²å¡«å
çé¶ä»¶æ°é (èªå¨æ´æ°) |
| | | const filledPartCount = computed(() => { |
| | | // ç»è®¡rightPartCodesæ°ç»ä¸æå¼(é空)çé¶ä»¶æ°é |
| | | return rightPartCodes.value.filter((code) => code.trim() !== "").length; |
| | | }); |
| | | |
| | | // â
è·å左侧åå§æ°æ® - å¯¹æ¥ /api/scanStation/GetLeftInitialData |
| | | // è·å左侧åå§æ°æ®ï¼æå+é¶ä»¶+å¾éç¶æï¼ |
| | | const fetchLeftInitialData = async () => { |
| | | try { |
| | | console.log("æ£å¨è·å左侧åå§æ°æ®ï¼æåç¼å·+é¶ä»¶ç¼å·+å¾éç¶æ+é¶ä»¶IDï¼..."); |
| | | console.log("æ£å¨è·å左侧åå§æ°æ®..."); |
| | | const response = await axios.get("/api/scanStation/GetLeftInitialData", { |
| | | timeout: 5000, |
| | | }); |
| | |
| | | const data = resData.Data || resData.data || {}; |
| | | if (data.finishedProductId) finishedProductId.value = data.finishedProductId; |
| | | if (data.finishedProduct) finishedProduct.value = data.finishedProduct; |
| | | // èµå¼å·¦ä¾§é¶ä»¶ç¼å· |
| | | if (Array.isArray(data.leftPartCodes) && data.leftPartCodes.length >= 10) { |
| | | for (let i = 0; i < 10; i++) { |
| | | leftPartCodes.value[i] = data.leftPartCodes[i] || ""; |
| | | leftPartIds.value[i] = data.leftPartIds?.[i] || ""; |
| | | } |
| | | } |
| | | // èµå¼å¾éç¶æ |
| | | if (Array.isArray(data.leftPartChecked) && data.leftPartChecked.length >= 10) { |
| | | for (let i = 0; i < 10; i++) { |
| | | leftPartChecked.value[i] = !!data.leftPartChecked[i]; |
| | |
| | | } |
| | | }; |
| | | |
| | | // â
è·åä¿¡å·+PLCç¶æ |
| | | // è·åä¿¡å·ç¯ç¶æï¼å®æ¶è½®è¯¢ï¼ |
| | | const fetchSignalAndPLCStates = async () => { |
| | | try { |
| | | const response = await axios.get("/api/scanStation/GetSignalStates", { |
| | |
| | | const data = resData.Data || resData.data || {}; |
| | | const newSignalStates = data.signalStates || []; |
| | | for (let i = 0; i < 5; i++) signalStates.value[i] = newSignalStates[i] ?? false; |
| | | const plcStatus = data.plcStatus || data.plc_status || {}; |
| | | isPLCStarted.value = plcStatus.isStarted ?? isPLCStarted.value; |
| | | // â
ä¿®å¤BUGï¼åä»£ç æ¯ isPLCStarted.value å¯¼è´æåç¶æèµå¼é误 |
| | | isPLCPaused.value = plcStatus.isPaused ?? isPLCPaused.value; |
| | | } |
| | | } catch (error) { |
| | | console.error("è·åä¿¡å·åPLCç¶æå¤±è´¥ï¼", error); |
| | | console.error("è·åä¿¡å·ç¶æå¤±è´¥ï¼", error); |
| | | } |
| | | }; |
| | | |
| | | // â
ãæ ¸å¿ä¿®æ¹ãå·¥è£
æ¿æ¥è¯¢æ¥å£ - ææ°æ®å°±å¡«å
ï¼æ æ°æ®/失败 å®å
¨ä¿çåæå
容ï¼ä¸å任使¸
空æä½ |
| | | const fetchProductAndPartsByBoardCode = async (boardCode) => { |
| | | if (!boardCode.trim()) return; |
| | | try { |
| | | console.log(`å·¥è£
æ¿ç¼å·åæ´ï¼è¯·æ±æ°æ®ï¼${boardCode}`); |
| | | const response = await axios.get( |
| | | "/api/boxingDetail/GetProductAndPartsByBoardNo", |
| | | { |
| | | params: { palletCode: boardCode.trim() }, |
| | | timeout: 5000, |
| | | } |
| | | ); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | // â
åªæãæ¥å£æå+æè¿åæ°æ®ãçæ¶åï¼ææ§è¡èµå¼è¦ç |
| | | if (isSuccess) { |
| | | const data = resData.Data || resData.data || {}; |
| | | // ææåç¼å·å°±èµå¼ï¼æ²¡æå°±ä¸æä½ |
| | | if (data.finishedProductCode) { |
| | | finishedProductCode.value = data.finishedProductCode; |
| | | } |
| | | // æé¶ä»¶å表就填å
ï¼æ²¡æå°±ä¸æä½ |
| | | const partsList = Array.isArray(data.partsList) ? data.partsList : []; |
| | | if (partsList.length > 0) { |
| | | for (let i = 0; i < 10; i++) { |
| | | if (partsList[i]) { |
| | | rightPartCodes.value[i] = partsList[i]; |
| | | } |
| | | } |
| | | } |
| | | console.log("â
å·¥è£
æ¿æ¥è¯¢æåï¼æåç¼å·+é¶ä»¶ç¼å·å¡«å
宿"); |
| | | } else { |
| | | // â
æ å¯¹åºæ°æ®ï¼åªå¼¹æç¤ºï¼ä¸æ¸
空任ä½å
容 |
| | | alert( |
| | | "è·åæ°æ®å¤±è´¥ï¼" + (resData.Message || resData.message || "æ 对åºå·¥è£
æ¿æ°æ®") |
| | | ); |
| | | } |
| | | } catch (error) { |
| | | // â
请æ±å¤±è´¥ï¼åªå¼¹æç¤ºï¼ä¸æ¸
空任ä½å
容 |
| | | alert("å·¥è£
æ¿æ°æ®è¯·æ±å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¥å£ï¼"); |
| | | console.error("å·¥è£
æ¿æ¥å£è¯·æ±å¤±è´¥ï¼", error); |
| | | } finally { |
| | | boardCodeDebounceTimer = null; |
| | | } |
| | | }; |
| | | |
| | | // å¯å¨/忢宿¶è½®è¯¢ |
| | | // å¯å¨/åæ¢ä¿¡å·ç¯è½®è¯¢ |
| | | const startPolling = () => { |
| | | if (pollingTimer) clearInterval(pollingTimer); |
| | | fetchSignalAndPLCStates(); |
| | |
| | | pollingTimer = null; |
| | | }; |
| | | |
| | | // PLCå¯å¨/å
³éé»è¾ |
| | | const handleToggle = async () => { |
| | | try { |
| | | const response = await axios.get("/api/scanStation/StartPLC", { |
| | | params: { isStop: isPLCStarted.value }, |
| | | timeout: 5000, |
| | | }); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | isPLCStarted.value = !isPLCStarted.value; |
| | | isPLCPaused.value = false; |
| | | fetchSignalAndPLCStates(); |
| | | } else { |
| | | alert( |
| | | resData.Message || |
| | | resData.message || |
| | | (isPLCStarted.value ? "å
³é失败" : "å¯å¨å¤±è´¥") |
| | | ); |
| | | } |
| | | } catch (error) { |
| | | alert(isPLCStarted.value ? "å
³éPLC失败" : "å¯å¨PLC失败"); |
| | | console.error("PLCå¯å失败ï¼", error); |
| | | } |
| | | }; |
| | | |
| | | // PLCæå/æ¢å¤é»è¾ |
| | | const handlePauseToggle = async () => { |
| | | try { |
| | | const response = await axios.get("/api/scanStation/PausePLC", { |
| | | params: { isPause: !isPLCPaused.value }, |
| | | timeout: 5000, |
| | | }); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | isPLCPaused.value = !isPLCPaused.value; |
| | | fetchSignalAndPLCStates(); |
| | | } else { |
| | | alert( |
| | | resData.Message || |
| | | resData.message || |
| | | (isPLCPaused.value ? "æ¢å¤å¤±è´¥" : "æå失败") |
| | | ); |
| | | } |
| | | } catch (error) { |
| | | alert(isPLCPaused.value ? "æ¢å¤PLC失败" : "æåPLC失败"); |
| | | console.error("PLCæåæ¢å¤å¤±è´¥ï¼", error); |
| | | } |
| | | }; |
| | | |
| | | // é¶ä»¶å¾éç¶æåæ´å¤ç |
| | | // 左侧é¶ä»¶å¾éç¶æåæ´å¤çï¼æ´æ°åç«¯ç¶æï¼ |
| | | const handlePartCheck = async (index) => { |
| | | const isChecked = leftPartChecked.value[index]; |
| | | const partCode = leftPartCodes.value[index]; |
| | | const partId = leftPartIds.value[index]; |
| | | |
| | | // åç½®æ ¡éª |
| | | if (!finishedProductId.value) { |
| | | alert("æåIDä¸åå¨ï¼æ æ³æ´æ°é¶ä»¶æ«ç ç¶æï¼"); |
| | | leftPartChecked.value[index] = !isChecked; |
| | |
| | | return; |
| | | } |
| | | |
| | | if (checkDebounceTimer) clearTimeout(checkDebounceTimer); |
| | | checkDebounceTimer = setTimeout(async () => { |
| | | try { |
| | | const response = await axios.post( |
| | | "/api/scanStation/UpdatePartScannedStatus", |
| | | { Id: partId, IsScanned: isChecked ? 1 : 0 }, |
| | | { timeout: 5000 } |
| | | ); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | console.log(`é¶ä»¶${index + 1}æ«ç ç¶ææ´æ°æå`); |
| | | // â
å¾éç¶æååæ¶ï¼éç½®æäº¤é |
| | | submitLock.value = false; |
| | | } else { |
| | | leftPartChecked.value[index] = !isChecked; |
| | | alert( |
| | | `é¶ä»¶${index + 1}ç¶ææ´æ°å¤±è´¥ï¼${ |
| | | resData.Message || resData.message || "æªç¥é误" |
| | | }` |
| | | ); |
| | | } |
| | | } catch (error) { |
| | | checkLoading.value[index] = true; |
| | | try { |
| | | const response = await axios.post( |
| | | "/api/scanStation/UpdatePartScannedStatus", |
| | | { Id: partId, IsScanned: isChecked ? 1 : 0 }, |
| | | { timeout: 5000 } |
| | | ); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | console.log(`é¶ä»¶${index + 1}æ«ç ç¶ææ´æ°æå`); |
| | | } else { |
| | | leftPartChecked.value[index] = !isChecked; |
| | | alert(`é¶ä»¶${index + 1}ç¶ææ´æ°è¯·æ±å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¥å£ï¼`); |
| | | console.error(`æ´æ°é¶ä»¶${index + 1}æ«ç ç¶æå¤±è´¥ï¼`, error); |
| | | } finally { |
| | | checkDebounceTimer = null; |
| | | alert( |
| | | `é¶ä»¶${index + 1}ç¶ææ´æ°å¤±è´¥ï¼${ |
| | | resData.Message || resData.message || "æªç¥é误" |
| | | }` |
| | | ); |
| | | } |
| | | }, 500); |
| | | } catch (error) { |
| | | leftPartChecked.value[index] = !isChecked; |
| | | alert(`é¶ä»¶${index + 1}ç¶ææ´æ°è¯·æ±å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¥å£ï¼`); |
| | | console.error(`æ´æ°é¶ä»¶${index + 1}æ«ç ç¶æå¤±è´¥ï¼`, error); |
| | | } finally { |
| | | checkLoading.value[index] = false; |
| | | if (checkDebounceTimer) clearTimeout(checkDebounceTimer); |
| | | checkDebounceTimer = null; |
| | | } |
| | | }; |
| | | |
| | | // â
æ ¸å¿ä¿®æ¹ï¼å»¶è¿0.5ç§å¡«å
+ å»¶è¿0.5ç§æ¸
空 忥æ§è¡ æ éæå¨æé® |
| | | // å³ä¾§å½å
¥æ¡å»¶è¿å¡«å
é»è¾ï¼æåâé¶ä»¶ä¾æ¬¡å¡«å
ï¼ |
| | | const fillContent = () => { |
| | | if (!rightTopInput.value.trim()) return; |
| | | const inputValue = rightTopInput.value.trim(); |
| | | |
| | | // æ¸
餿§å®æ¶å¨ï¼é²æ¢é夿§è¡ |
| | | if (destroyDelayTimer) clearTimeout(destroyDelayTimer); |
| | | // ç»ä¸å»¶è¿500msæ§è¡ãå¡«å
+æ¸
空ã |
| | | destroyDelayTimer = setTimeout(() => { |
| | | if (!toolingBoardNo.value.trim()) { |
| | | toolingBoardNo.value = inputValue; |
| | | } else if (!finishedProductCode.value.trim()) { |
| | | if (!finishedProductCode.value.trim()) { |
| | | finishedProductCode.value = inputValue; |
| | | } else if (fillIndex.value < 10) { |
| | | rightPartCodes.value[fillIndex.value] = inputValue; |
| | | fillIndex.value++; |
| | | } else { |
| | | alert("å·¥è£
æ¿ç¼å·ãæåç¼å·åé¶ä»¶1-10å·²å
¨é¨å¡«å
宿,æ æ³ç»§ç»å½å
¥!"); |
| | | alert("æåç¼å·åé¶ä»¶1-10å·²å
¨é¨å¡«å
宿,æ æ³ç»§ç»å½å
¥!"); |
| | | rightTopInput.value = ""; |
| | | destroyDelayTimer = null; |
| | | return; |
| | | } |
| | | // å¡«å
宿å èªå¨æ¸
空å½å
¥æ¡ |
| | | rightTopInput.value = ""; |
| | | destroyDelayTimer = null; |
| | | }, destroyDelayTime); |
| | | }; |
| | | |
| | | // â
çå¬å½å
¥æ¡å
容ååèªå¨è§¦åå¡«å
é»è¾ |
| | | // çå¬å³ä¾§å½å
¥æ¡è¾å
¥ï¼è§¦åèªå¨å¡«å
|
| | | watch( |
| | | rightTopInput, |
| | | (newVal) => { |
| | |
| | | { immediate: false } |
| | | ); |
| | | |
| | | // çå¬å·¥è£
æ¿ç¼å·ååæ¥è¯¢æ°æ® |
| | | watch( |
| | | toolingBoardNo, |
| | | (newVal) => { |
| | | const boardCode = newVal.trim(); |
| | | if (boardCode) { |
| | | if (boardCodeDebounceTimer) clearTimeout(boardCodeDebounceTimer); |
| | | boardCodeDebounceTimer = setTimeout( |
| | | () => fetchProductAndPartsByBoardCode(boardCode), |
| | | 300 |
| | | ); |
| | | } else { |
| | | if (boardCodeDebounceTimer) clearTimeout(boardCodeDebounceTimer); |
| | | } |
| | | }, |
| | | { immediate: false } |
| | | ); |
| | | |
| | | // å³ä¾§é¡µé¢æä½æ¹æ³ (å·²å 餿¸
空/ä¿åå½å
¥æ¡çæ¹æ³ï¼æ åä½) |
| | | const clearToolingBoardNo = () => (toolingBoardNo.value = ""); |
| | | // å³ä¾§è¾å
¥æ¡æ¸
餿¹æ³ |
| | | const clearRightPart = (index) => (rightPartCodes.value[index] = ""); |
| | | const clearFinishedProductCode = () => (finishedProductCode.value = ""); |
| | | |
| | | // æäº¤å·¥è£
æ¿æ°æ®å°å端 |
| | | const saveToolingBoardNo = async () => { |
| | | if (!toolingBoardNo.value.trim()) { |
| | | alert("å·¥è£
æ¿ç¼å·ä¸è½ä¸ºç©ºï¼è¯·è¾å
¥ååæäº¤ï¼"); |
| | | // æ ¸å¿ä¿®æ¹ï¼æ¢å¤æåç¼å·å¿
å¡«æ ¡éªï¼æªå¡«åç´æ¥æç¤ºå¹¶ç»æ¢æäº¤ |
| | | const saveData = async () => { |
| | | // 1. æåç¼å·å¿
å¡«æ ¡éªãæ ¸å¿æ°å¢ã |
| | | const productCode = finishedProductCode.value.trim(); |
| | | if (!productCode) { |
| | | alert("请å
å¡«åæåç¼å·ï¼æåç¼å·ä¸ºå¿
填项ï¼"); |
| | | return; |
| | | } |
| | | if (!finishedProductCode.value.trim()) { |
| | | alert("æåç¼å·ä¸è½ä¸ºç©ºï¼è¯·è¾å
¥ååæäº¤ï¼"); |
| | | return; |
| | | } |
| | | // 2. æäº¤éï¼é²æ¢éå¤ç¹å» |
| | | if (submitLock.value) return; |
| | | submitLock.value = true; |
| | | |
| | | try { |
| | | // 3. ä¼ åéé
ï¼å端Dtoæ¯å¤§é©¼å³°å段ï¼å¿
é¡»ä¸¥æ ¼å¹é
ï¼FinishedProductCode/PartsListï¼ |
| | | const submitData = { |
| | | toolingBoardNo: toolingBoardNo.value.trim(), |
| | | finishedProductCode: finishedProductCode.value.trim(), |
| | | partsList: rightPartCodes.value.map((item) => item.trim()), |
| | | FinishedProductCode: productCode, // ç´æ¥ä½¿ç¨å·²æ ¡éªçéç©ºå¼ |
| | | PartsList: rightPartCodes.value.map((item) => item.trim()), |
| | | }; |
| | | console.log("â
æäº¤å·¥è£
æ¿æ°æ®ï¼", submitData); |
| | | console.log("ð¤ æäº¤å°SaveToolingBoardNoçåæ°ï¼å¹é
å端Dtoï¼ï¼", submitData); |
| | | |
| | | // 4. è°ç¨å端æ¥å£ï¼å»¶é¿è¶
æ¶æ¶é´ï¼å端æPLC交äºï¼500msä¼ç ï¼è®¾ä¸º10ç§ï¼ |
| | | const response = await axios.post( |
| | | "/api/boxingDetail/SaveToolingBoardNo", |
| | | submitData, |
| | | { timeout: 5000 } |
| | | { timeout: 10000 } |
| | | ); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | alert("â
æäº¤æåï¼"); |
| | | toolingBoardNo.value = ""; |
| | | console.log("ð¥ SaveToolingBoardNoæ¥å£è¿åï¼", resData); |
| | | |
| | | // 5. éé
å端è¿åæ ¼å¼ï¼status为true表示æåï¼å¦ååmessageéè¯¯ä¿¡æ¯ |
| | | if (resData.status === true) { |
| | | finishedProductCode.value = ""; |
| | | rightPartCodes.value = Array(10).fill(""); |
| | | rightTopInput.value = ""; |
| | | fillIndex.value = -1; |
| | | // â
æäº¤æååï¼éç½®æäº¤é |
| | | submitLock.value = false; |
| | | } else { |
| | | alert("æäº¤å¤±è´¥ï¼" + (resData.Message || resData.message || "æªç¥é误")); |
| | | // ä¸å¡é误ï¼ç´æ¥å±ç¤ºå端è¿åçmessageï¼å¦ç©æéè¯¯ãæ é
æ¹ï¼ |
| | | const errorMsg = resData.message || "æäº¤å¤±è´¥ï¼æªç¥ä¸å¡é误"; |
| | | alert(`æäº¤å¤±è´¥ï¼${errorMsg}`); |
| | | } |
| | | } catch (error) { |
| | | alert("æäº¤è¯·æ±å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¥å£ï¼"); |
| | | console.error("æäº¤æ¥å£å¤±è´¥ï¼", error); |
| | | // â
请æ±å¤±è´¥ä¹éç½®é |
| | | // 6. å¼å¸¸æè·ï¼å
¼å®¹åç«¯æªæè·å¼å¸¸ï¼å¦PLCé讯å¼å¸¸ãæ°ç»è¶çã500éè¯¯ï¼ |
| | | let errorMsg = "æäº¤è¯·æ±å¼å¸¸ï¼"; |
| | | if (error.code === "ECONNABORTED") { |
| | | errorMsg = "æäº¤è¯·æ±è¶
æ¶ï¼å端PLC交äº/æ°æ®åºæä½èæ¶è¿é¿"; |
| | | } else if (error.response) { |
| | | // æå¡å¨500é误ï¼å端æåºæªæè·å¼å¸¸ï¼å¦PLCæªè¿æ¥ãé¶ä»¶ä¸å¹é
ï¼ |
| | | errorMsg = `æå¡å¨é误ï¼${error.response.status} - ${error.response.statusText}ï¼è¯·æ£æ¥PLCé讯æé
æ¹é
ç½®`; |
| | | console.error("â å端æå¡å¨é误详æ
ï¼", error.response.data); |
| | | } else if (error.request) { |
| | | errorMsg = "ç½ç»å¼å¸¸ï¼æªæ¶å°å端ååºï¼è¯·æ£æ¥æ¥å£å°ååç½ç»"; |
| | | } else { |
| | | errorMsg = `请æ±é误ï¼${error.message}`; |
| | | } |
| | | alert(errorMsg); |
| | | console.error("â æäº¤æ¥å£å¼å¸¸è¯¦æ
ï¼", error); |
| | | } finally { |
| | | // 7. éæ¾æäº¤éï¼æ 论æå/失败é½è¦éæ¾ |
| | | submitLock.value = false; |
| | | } |
| | | }; |
| | | |
| | | // â
â
â
æ ¸å¿å级ï¼èªå¨æäº¤å¤æé»è¾ - æ°å¢æ å¾éæ¶æåç¼å·å¡«å
å³æäº¤ |
| | | // æ ¸å¿ä¿®æ¹ï¼èªå¨æäº¤é»è¾åæ¥å¢å æåç¼å·å¿
å¡«æ ¡éªï¼æ æåç¼å·ä¸è§¦åèªå¨æäº¤ï¼ |
| | | const checkAutoSubmit = () => { |
| | | // 鲿ï¼é²æ¢çæ¶é´å
夿¬¡è§¦åæäº¤ |
| | | if (autoSubmitDebounceTimer) clearTimeout(autoSubmitDebounceTimer); |
| | | autoSubmitDebounceTimer = setTimeout(() => { |
| | | const needCheckNum = checkedCount.value; // 左侧å¾éçæ°é |
| | | const filledNum = filledPartCount.value; // å³ä¾§å¡«å
çé¶ä»¶æ°é |
| | | const hasBoardNo = toolingBoardNo.value.trim() !== ""; // å·¥è£
æ¿æå¼ |
| | | const hasProductCode = finishedProductCode.value.trim() !== ""; // æåæå¼ |
| | | const needCheckNum = checkedCount.value; // 左侧å¾éé¶ä»¶æ° |
| | | const filledNum = filledPartCount.value; // å³ä¾§ææå¡«å
é¶ä»¶æ° |
| | | const productCode = finishedProductCode.value.trim(); // æåç¼å·ï¼å»ç©ºæ ¼ï¼ |
| | | const hasProductCode = !!productCode; // æåç¼å·æ¯å¦ææãä¿çåé»è¾ï¼å®é
æ¯å¿
å¡«æ ¡éªã |
| | | |
| | | console.log(`â
èªå¨æäº¤æ ¡éªï¼å·¦ä¾§å¾é${needCheckNum}个ï¼å³ä¾§å¡«å
${filledNum}个`); |
| | | console.log( |
| | | `â
èªå¨æäº¤æ ¡éªï¼å¾é${needCheckNum}个 | å¡«å
${filledNum}个 | æå已填${hasProductCode}` |
| | | ); |
| | | |
| | | // 忝1ï¼å·¦ä¾§æå¾é â åæé»è¾ï¼é¶ä»¶å¡«å
æ°â¥å¾éæ° ææäº¤ |
| | | if (needCheckNum > 0) { |
| | | if (hasBoardNo && hasProductCode && filledNum >= needCheckNum) { |
| | | console.log("â
满足å¾éæ°éæ¡ä»¶ï¼æ§è¡èªå¨æäº¤ï¼"); |
| | | saveToolingBoardNo(); |
| | | // åç½®æ»æ ¡éªï¼æåç¼å·æªå¡«åï¼ç´æ¥ä¸è§¦åä»»ä½èªå¨æäº¤ãæ ¸å¿å¼ºåã |
| | | if (!hasProductCode) { |
| | | console.log("â ï¸ æåç¼å·æªå¡«åï¼è·³è¿èªå¨æäº¤"); |
| | | autoSubmitDebounceTimer = null; |
| | | return; |
| | | } |
| | | |
| | | // åºæ¯1ï¼å·¦ä¾§æ å¾é â ä»
æåç¼å·ææå³æäº¤ï¼å·²æ»¡è¶³hasProductCodeï¼ |
| | | if (needCheckNum === 0) { |
| | | if (!submitLock.value) { |
| | | console.log("â
æ é¶ä»¶å¾éï¼æåå·²å¡«ï¼æ§è¡èªå¨æäº¤ï¼"); |
| | | saveData(); |
| | | } |
| | | } |
| | | // 忝2ï¼å·¦ä¾§æ å¾é â æ°å¢é»è¾ï¼å·¥è£
æ¿+æåé½æå¼ å°±æäº¤ (å éé²éå¤) |
| | | // åºæ¯2ï¼å·¦ä¾§æå¾é â æåææ + å¡«å
æ°=å¾éæ° ææäº¤ï¼å·²æ»¡è¶³hasProductCodeï¼ |
| | | else { |
| | | if (hasBoardNo && hasProductCode && !submitLock.value) { |
| | | console.log("â
左侧æ å¾éï¼æåç¼å·å¡«å
å®æï¼æ§è¡èªå¨æäº¤ï¼"); |
| | | submitLock.value = true; // å é鲿¢éå¤æäº¤ |
| | | saveToolingBoardNo(); |
| | | if (filledNum === needCheckNum && !submitLock.value) { |
| | | console.log("â
é¶ä»¶æ°éå¹é
ï¼æåå·²å¡«ï¼æ§è¡èªå¨æäº¤ï¼"); |
| | | saveData(); |
| | | } |
| | | } |
| | | autoSubmitDebounceTimer = null; |
| | | }, 300); |
| | | }, 300); // 300ms鲿ï¼é¿å
è¾å
¥é¢ç¹è§¦å |
| | | }; |
| | | |
| | | // â
â
â
æ ¸å¿æ°å¢4ï¼çå¬å
³é®æ°æ®ååï¼è§¦åèªå¨æäº¤æ ¡éª |
| | | watch( |
| | | [checkedCount, filledPartCount, toolingBoardNo, finishedProductCode], |
| | | () => { |
| | | checkAutoSubmit(); |
| | | }, |
| | | { deep: true, immediate: false } |
| | | ); |
| | | // çå¬èªå¨æäº¤ç¸å
³æ°æ®ååï¼è§¦åæ ¡éª |
| | | watch([checkedCount, filledPartCount, finishedProductCode], () => checkAutoSubmit(), { |
| | | deep: true, |
| | | immediate: false, |
| | | }); |
| | | |
| | | // èªå¨æ£æµå¡«å
ç´¢å¼é»è¾ |
| | | // èªå¨æ£æµå¡«å
ç´¢å¼ï¼æåå¡«å®åï¼æå第ä¸ä¸ªç©ºé¶ä»¶æ¡ï¼ |
| | | const detectFillIndex = () => { |
| | | if (!toolingBoardNo.value.trim() || !finishedProductCode.value.trim()) { |
| | | if (!finishedProductCode.value.trim()) { |
| | | fillIndex.value = -1; |
| | | return; |
| | | } |
| | |
| | | fillIndex.value = 10; |
| | | }; |
| | | |
| | | watch( |
| | | [toolingBoardNo, finishedProductCode, () => [...rightPartCodes.value]], |
| | | detectFillIndex, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ); |
| | | // ç嬿å/é¶ä»¶è¾å
¥ï¼æ´æ°å¡«å
ç´¢å¼ |
| | | watch([finishedProductCode, () => [...rightPartCodes.value]], detectFillIndex, { |
| | | immediate: true, |
| | | deep: true, |
| | | }); |
| | | |
| | | // é¡µé¢æè½½/å¸è½½çå½å¨æ |
| | | // çå½å¨æï¼æè½½æ¶å è½½åå§æ°æ®+å¯å¨è½®è¯¢ |
| | | onMounted(async () => { |
| | | await fetchLeftInitialData(); |
| | | startPolling(); |
| | | detectFillIndex(); |
| | | }); |
| | | |
| | | // çå½å¨æï¼å¸è½½æ¶æ¸
餿æå®æ¶å¨/鲿ï¼é²æ¢å
åæ³æ¼ |
| | | onUnmounted(() => { |
| | | stopPolling(); |
| | | if (checkDebounceTimer) clearTimeout(checkDebounceTimer); |
| | | if (destroyDelayTimer) clearTimeout(destroyDelayTimer); |
| | | if (boardCodeDebounceTimer) clearTimeout(boardCodeDebounceTimer); |
| | | if (autoSubmitDebounceTimer) clearTimeout(autoSubmitDebounceTimer); |
| | | [checkDebounceTimer, destroyDelayTimer, autoSubmitDebounceTimer].forEach( |
| | | (t) => t && clearTimeout(t) |
| | | ); |
| | | }); |
| | | |
| | | // æ´é²æ¨¡æ¿æé屿§/æ¹æ³ |
| | | return { |
| | | finishedProduct, |
| | | finishedProductId, |
| | | rightTopInput, |
| | | leftPartCodes, |
| | | rightPartCodes, |
| | | leftPartChecked, |
| | | leftPartIds, |
| | | toolingBoardNo, |
| | | isPLCStarted, |
| | | isPLCPaused, |
| | | signalStates, |
| | | signalLabels, |
| | | finishedProductCode, |
| | | handleToggle, |
| | | handlePauseToggle, |
| | | checkLoading, |
| | | handlePartCheck, |
| | | clearToolingBoardNo, |
| | | saveToolingBoardNo, |
| | | saveData, |
| | | clearRightPart, |
| | | clearFinishedProductCode, |
| | | }; |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* åºç¡æ ·å¼éç½®ä¸å
¨å±æ ·å¼ */ |
| | | /* åºç¡æ ·å¼éç½® */ |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | box-sizing: border-box; |
| | | font-family: "Microsoft Yahei", "PingFang SC", "Inter", sans-serif; |
| | | font-family: "Microsoft Yahei", "PingFang SC", sans-serif; |
| | | scrollbar-width: none; |
| | | -ms-overflow-style: none; |
| | | } |
| | |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* 容卿 ·å¼ - æ¾å¤§ é´è·å 宽 */ |
| | | /* ä¸»å®¹å¨ */ |
| | | .container { |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100vh; |
| | | margin: 0; |
| | | gap: 15px; |
| | | padding: 15px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | /* 颿¿éç¨æ ·å¼ - ç»ä¸å
è¾¹è· ç¡®ä¿å·¦å³å¯¹é½ */ |
| | | /* å·¦å³åºåéç¨æ ·å¼ */ |
| | | .left-area, |
| | | .right-area { |
| | | flex: 1; |
| | |
| | | transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); |
| | | } |
| | | |
| | | /* æé®+ä¿¡å· æ¨ªåæåå®¹å¨ - æ ¸å¿å¸å± */ |
| | | .btn-signal-group { |
| | | /* 左侧顶é¨-ä¿¡å·ç¯åºå */ |
| | | .left-top { |
| | | background: #f8fafc; |
| | | padding: 20px 15px; |
| | | border-radius: 12px; |
| | | flex-shrink: 0; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 20px; |
| | | width: 100%; |
| | | } |
| | | .btn-group { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | flex-shrink: 0; |
| | | justify-content: center; |
| | | } |
| | | .signal-status { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | justify-content: center; |
| | | align-items: center; |
| | | gap: 18px; |
| | | flex-shrink: 0; |
| | | padding: 0; |
| | | } |
| | | |
| | | .left-top { |
| | | background: #f8fafc; |
| | | padding: 15px; |
| | | border-radius: 12px; |
| | | gap: 25px; |
| | | flex-shrink: 0; |
| | | width: 100%; |
| | | } |
| | | |
| | | /* ä¸ä¸åºåéç¨ */ |
| | | .left-bottom, |
| | | .right-bottom { |
| | | display: flex; |
| | |
| | | flex: 1; |
| | | overflow: hidden !important; |
| | | } |
| | | |
| | | .right-top { |
| | | padding: 15px; |
| | | background: #f8fafc; |
| | |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | /* 表åè¡æ ·å¼ - ç»ä¸é«åº¦åé´è· ç¡®ä¿å·¦å³å¯¹é½ */ |
| | | /* 表åè¡éç¨æ ·å¼ */ |
| | | .form-row { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | flex-shrink: 0; |
| | | width: 100%; |
| | | } |
| | | |
| | | .input-submit-row { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | flex-wrap: nowrap; |
| | | padding: 6px 10px; |
| | | border-radius: 8px; |
| | | transition: all 0.2s ease; |
| | | height: 48px; |
| | | line-height: 48px; |
| | | flex-shrink: 0; |
| | | width: 100%; |
| | | } |
| | | .form-row:hover { |
| | | background: #f8fafc; |
| | | } |
| | | |
| | | .finished-product-row { |
| | | /* æåç¼å·è¡æ ·å¼ */ |
| | | .right-bottom .finished-product-row { |
| | | margin-top: 16px; |
| | | background: #eff6ff; |
| | | border-left: 4px solid #3b82f6; |
| | | padding-top: 2px; |
| | | padding-bottom: 2px; |
| | | } |
| | | .left-bottom .finished-product-row { |
| | | background: #eff6ff; |
| | | border-left: 4px solid #3b82f6; |
| | | } |
| | | |
| | | .tooling-board-row { |
| | | background: #f0fdf4; |
| | | border-left: 4px solid #22c55e; |
| | | } |
| | | |
| | | /* é¶ä»¶é¡¹æ ·å¼ */ |
| | | .part-item { |
| | | border-bottom: 1px solid #f1f5f9; |
| | | margin-bottom: 3px; |
| | | } |
| | | |
| | | .part-item:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | /* æ ç¾æ ·å¼ - ç»ä¸å®½åº¦ ç¡®ä¿å·¦å³å¯¹é½ */ |
| | | /* æ ç¾æ ·å¼ */ |
| | | .label { |
| | | width: 90px; |
| | | text-align: right; |
| | |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .short-label { |
| | | width: 110px; |
| | | text-align: right; |
| | | color: #334155; |
| | | font-size: 15px; |
| | | font-weight: 600; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | /* è¾å
¥æ¡æ ·å¼ - ç»ä¸å°ºå¯¸ ç¡®ä¿å·¦å³å¯¹é½ */ |
| | | /* è¾å
¥æ¡æ ·å¼ */ |
| | | .input-box { |
| | | flex: 1; |
| | | min-width: 100px; |
| | |
| | | transition: all 0.2s ease; |
| | | background-color: #ffffff; |
| | | } |
| | | |
| | | .short-input { |
| | | width: 150px !important; |
| | | flex: none !important; |
| | | } |
| | | |
| | | .input-box:focus { |
| | | border-color: #3b82f6; |
| | | box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); |
| | | } |
| | | |
| | | .input-box:disabled { |
| | | background-color: #f1f5f9; |
| | | color: #64748b; |
| | | cursor: not-allowed; |
| | | } |
| | | |
| | | .input-box::placeholder { |
| | | color: #94a3b8; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* æé®æ ·å¼ - åºå®å®½åº¦ ä¸å */ |
| | | /* æé®éç¨æ ·å¼ */ |
| | | .btn { |
| | | width: 120px; |
| | | height: 42px; |
| | |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .submit-input-btn { |
| | | width: 110px !important; |
| | | height: 42px !important; |
| | | flex: none !important; |
| | | padding: 0 15px !important; |
| | | font-size: 15px !important; |
| | | } |
| | | .submit-input-btn .icon { |
| | | width: 20px !important; |
| | | height: 20px !important; |
| | | } |
| | | .btn:disabled { |
| | | opacity: 0.6; |
| | | cursor: not-allowed; |
| | | transform: none !important; |
| | | box-shadow: none !important; |
| | | } |
| | | |
| | | .btn::after { |
| | | content: ""; |
| | | position: absolute; |
| | |
| | | background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); |
| | | transition: all 0.5s ease; |
| | | } |
| | | |
| | | .btn:hover::after { |
| | | left: 100%; |
| | | } |
| | | |
| | | /* 徿 æ ·å¼ - 徿 æ¾å¤§ */ |
| | | /* 徿 æ ·å¼ */ |
| | | .icon { |
| | | display: inline-block; |
| | | width: 18px; |
| | |
| | | background-repeat: no-repeat; |
| | | background-position: center; |
| | | } |
| | | |
| | | .icon-start { |
| | | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E"); |
| | | } |
| | | |
| | | .icon-stop { |
| | | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 6h12v12H6z'/%3E%3C/svg%3E"); |
| | | } |
| | | |
| | | .icon-pause { |
| | | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E"); |
| | | } |
| | | |
| | | .icon-resume { |
| | | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11 5L6 9H2v6h4l5 4V5zm7 0v14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E"); |
| | | } |
| | | |
| | | .icon-clear { |
| | | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E"); |
| | | } |
| | | |
| | | .icon-submit { |
| | | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M2.01 21L15 13.4 23 21V5H2.01V21zM17 15l-5-5-5 5V7h10v8z'/%3E%3C/svg%3E"); |
| | | } |
| | | |
| | | /* æé®ç±»åæ ·å¼ - ä¸å */ |
| | | .start-btn { |
| | | background: linear-gradient(135deg, #10b981 0%, #059669 100%); |
| | | color: #fff; |
| | | } |
| | | .start-btn:hover:not(:disabled) { |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2); |
| | | } |
| | | |
| | | .stop-btn { |
| | | background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); |
| | | color: #fff; |
| | | } |
| | | .stop-btn:hover:not(:disabled) { |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2); |
| | | } |
| | | |
| | | .pause-btn { |
| | | background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); |
| | | color: #fff; |
| | | } |
| | | .pause-btn:hover:not(:disabled) { |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2); |
| | | } |
| | | |
| | | .resume-btn { |
| | | background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); |
| | | color: #fff; |
| | | } |
| | | .resume-btn:hover:not(:disabled) { |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 4px 8px rgba(139, 92, 246, 0.2); |
| | | } |
| | | |
| | | /* æé®ä¸»é¢æ ·å¼ */ |
| | | .clear-btn { |
| | | background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); |
| | | color: #fff; |
| | |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 4px 8px rgba(239, 68, 68, 0.15); |
| | | } |
| | | |
| | | .save-btn { |
| | | background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); |
| | | color: #fff; |
| | |
| | | box-shadow: 0 4px 8px rgba(59, 130, 246, 0.15); |
| | | } |
| | | |
| | | /* ä¿¡å·ç¯æ ·å¼ éç®æ¾å¤§ */ |
| | | /* ä¿¡å·ç¯æ ·å¼ */ |
| | | .signal-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | font-size: 14px; |
| | | color: #334155; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | width: 100%; |
| | | text-align: center; |
| | | font-weight: 600; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /* èªå®ä¹å¤éæ¡æ ·å¼ - æ¾å¤§ ç¹å»åºåæ´å¤§ */ |
| | | /* èªå®ä¹å¤éæ¡æ ·å¼ */ |
| | | .checkbox-container { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | } |
| | | .part-checkbox { |
| | | display: none; |
| | | } |
| | | .checkbox-container:has(.part-checkbox:disabled) { |
| | | opacity: 0.6; |
| | | cursor: not-allowed; |
| | | } |
| | | .checkmark { |
| | | width: 22px; |
| | |
| | | width: 100%; |
| | | flex: none; |
| | | } |
| | | .btn-signal-group { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | .signal-status { |
| | | width: 100%; |
| | | justify-content: flex-start; |
| | | flex-wrap: wrap; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .form-row { |
| | | .form-row, |
| | | .input-submit-row { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | height: auto; |
| | | line-height: normal; |
| | | } |
| | | .label, |
| | | .short-label { |
| | | .label { |
| | | width: 100%; |
| | | text-align: left; |
| | | margin-bottom: 6px; |
| | |
| | | .input-box { |
| | | width: 100%; |
| | | } |
| | | .short-input { |
| | | .btn, |
| | | .submit-input-btn { |
| | | width: 100% !important; |
| | | } |
| | | .btn { |
| | | width: 100%; |
| | | margin-top: 6px; |
| | | } |
| | | .btn-group { |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | width: 100%; |
| | | .right-bottom .finished-product-row { |
| | | margin-top: 0 !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨ååæ®µ - æ°å¢boxingNo |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | boxingNo: "", // æµæ°´å·å段 |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | |
| | | field: "palletCode", |
| | | type: "input", |
| | | width: 200, |
| | | link: true, |
| | | require: true, |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true, |
| | | }, |
| | | // æ°å¢ï¼æµæ°´å·ç¼è¾é¡¹ï¼åå®ä½ä¸è´éç©ºï¼æ
设require: trueï¼ |
| | | { |
| | | title: "æµæ°´å·", |
| | | field: "boxingNo", |
| | | type: "input", |
| | | width: 200, |
| | | require: true, |
| | |
| | | ], |
| | | ]); |
| | | |
| | | // æ¥è¯¢è¡¨ååæ®µ - æ°å¢boxingNo |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | boxingNo: "", // æµæ°´å·æ¥è¯¢å段 |
| | | creater: "", |
| | | createDate: "", |
| | | }); |
| | |
| | | { title: "å·¥è£
æ¿ç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like" }, |
| | | { title: "æååç§°", field: "productName", type: "like" }, |
| | | // æ°å¢ï¼æµæ°´å·æ¥è¯¢é¡¹ï¼æ¨¡ç³æ¥è¯¢likeï¼åå
¶ä»ç¼å·ä¿æä¸è´ï¼ |
| | | { title: "æµæ°´å·", field: "boxingNo", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | |
| | | ], |
| | | ]); |
| | | |
| | | // è¡¨æ ¼åé
ç½® - æ°å¢boxingNoå |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | |
| | | { |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | // æ°å¢ï¼æµæ°´å·è¡¨æ ¼åï¼å®½åº¦åå
¶ä»ç¼å·ä¿æ200ï¼å¯æ ¹æ®éæ±è°æ´ï¼ |
| | | { |
| | | field: "boxingNo", |
| | | title: "æµæ°´å·", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | |
| | | |
| | | const detail = ref({ |
| | | cnName: "ç»ç详ç»ä¿¡æ¯", |
| | | table: "boxingDetail", |
| | | table: "DoxingDetail", |
| | | columns: [ |
| | | { |
| | | field: "boxingId", |
| | |
| | | field: "componentCode", |
| | | title: "é¶ä»¶ç¼å·", |
| | | type: "string", |
| | | edit: { type: "" }, |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | field: "componentName", |
| | | title: "é¶ä»¶åç§°", |
| | | type: "string", |
| | | edit: { type: "" }, |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨ååæ®µ - æ°å¢pressFastenTorqueï¼åè£
ä½ç´§åºæç©ï¼ |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | productCode: "", |
| | | productName: "", |
| | | productLength: 0, |
| | | productWidth: 0, |
| | | productHeight: 0, |
| | | screwDownsetDistance: 0, |
| | | screwTorqueOutput: 0, |
| | | dintAutoScrewOn: 0, |
| | | xDirectionDistance1: 0, |
| | | yDirectionHeight1: 0, |
| | | xDirectionDistance2: 0, |
| | | yDirectionHeight2: 0, |
| | | xDirectionDistance3: 0, |
| | | yDirectionHeight3: 0, |
| | | productLength: "", |
| | | productWidth: "", |
| | | productHeight: "", |
| | | pressNoTighten: "", |
| | | screwDownsetDistance: "", |
| | | screwTorqueOutput: "", |
| | | pressFastenTorque: "", // ãæ°å¢ãåè£
ä½ç´§åºæç© |
| | | dintAutoScrewOn: "", |
| | | p0P1Width: "", |
| | | p0P2Width: "", |
| | | p0P3Width: "", |
| | | p1P3Height: "", |
| | | p2P3Height: "", |
| | | productImagePath: "", |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨åé
ç½®-æ°å¢åè£
ä½ç´§åºæç©ï¼å¸å±éé
åæç´§åæ§ |
| | | const editFormOptions = ref([ |
| | | // 第ä¸è¡ï¼åºç¡æ è¯ |
| | | [ |
| | | { |
| | | title: "æåç¼å·", |
| | |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "主é®ID", |
| | | field: "id", |
| | | title: "æ§ç´§ç¨åºå·", |
| | | field: "dintAutoScrewOn", |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true, |
| | | inputType: "number", |
| | | width: 180, |
| | | placeholder: "请è¾å
¥æ´æ°", |
| | | }, |
| | | { |
| | | title: "产åé¿åº¦", |
| | | field: "productLength", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "产å宽度", |
| | | field: "productWidth", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "产åé«åº¦", |
| | | field: "productHeight", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "åè£
ä½ä¸æ§ç´§", |
| | | field: "pressNoTighten", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "ä¿ååå", |
| | | field: "screwDownsetDistance", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 150, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ä¸å¿é«åº¦", |
| | | field: "screwTorqueOutput", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "ç´§åºæç©", |
| | | field: "pressFastenTorque", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 150, |
| | | placeholder: "ä¿ç2ä½å°æ°ï¼é»è®¤0.00", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "P0P1宽度", |
| | | field: "p0P1Width", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "P0P2宽度", |
| | | field: "p0P2Width", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | ], |
| | | // 第åè¡ï¼Pç³»åé«åº¦ + 产åå¾çè·¯å¾ |
| | | [ |
| | | { |
| | | title: "P0P3宽度", |
| | | field: "p0P3Width", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "P1P3é«åº¦", |
| | | field: "p1P3Height", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 150, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "P2P3é«åº¦", |
| | | field: "p2P3Height", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 150, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | }, |
| | | { |
| | | title: "产åå¾çè·¯å¾", |
| | | field: "productImagePath", |
| | | type: "textarea", |
| | | width: 400, |
| | | rows: 2, |
| | | placeholder: "请è¾å
¥å¾ç宿´è·¯å¾ï¼æ¯æ500å符以å
", |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | // æç´¢è¡¨ååæ®µ - æ éä¿®æ¹ |
| | | const searchFormFields = ref({ |
| | | productCode: "", |
| | | productName: "", |
| | |
| | | createDate: "", |
| | | }); |
| | | |
| | | // æç´¢è¡¨åé
ç½® - æ éä¿®æ¹ |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æåç¼å·", field: "productCode", type: "like" }, |
| | | { title: "æååç§°", field: "productName", type: "like" }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like", width: 200 }, |
| | | { title: "æååç§°", field: "productName", type: "like", width: 200 }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | { title: "å建人", field: "creater", type: "like", width: 200 }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime", width: 380 }, |
| | | ], |
| | | ]); |
| | | |
| | | // è¡¨æ ¼åé
ç½® - æ°å¢åè£
ä½ç´§åºæç©å |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "åºå·", |
| | | type: "int", |
| | | width: 90, |
| | | width: 80, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productCode", |
| | | title: "æåç¼å·", |
| | | type: "string", |
| | | link: true, |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productLength", |
| | | title: "产åé¿åº¦", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productWidth", |
| | | title: "产å宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productHeight", |
| | | title: "产åé«åº¦", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressNoTighten", |
| | | title: "åè£
ä½ä¸æ§ç´§", |
| | | type: "select", |
| | | width: 100, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "screwDownsetDistance", |
| | | title: "ä¿ååå", |
| | | type: "decimal", |
| | | width: 110, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "screwTorqueOutput", |
| | | title: "ä¸å¿é«åº¦", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressFastenTorque", // ãæ°å¢ãè¡¨æ ¼å |
| | | title: "åè£
ä½ç´§åºæç©", |
| | | type: "decimal", |
| | | width: 120, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "dintAutoScrewOn", |
| | | title: "æ§ç´§ç¨åºå·", |
| | | type: "int", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | // Pç³»å宽度 |
| | | { |
| | | field: "p0P1Width", |
| | | title: "P0P1宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "p0P2Width", |
| | | title: "P0P2宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "p0P3Width", |
| | | title: "P0P3宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | // Pç³»åé«åº¦ |
| | | { |
| | | field: "p1P3Height", |
| | | title: "P1P3é«åº¦", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "p2P3Height", |
| | | title: "P2P3é«åº¦", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productImagePath", |
| | | title: "å¾çè·¯å¾", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | overflow: "ellipsis", |
| | | }, |
| | | // å
Œ
±å段 |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 150, |
| | | align: "left", |
| | | width: 160, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | |
| | | // é
æ¹æç»é
ç½® - æ éä¿®æ¹ |
| | | const detail = ref({ |
| | | cnName: "é¶ä»¶è¯¦ç»ä¿¡æ¯", |
| | | table: "componentDetail", |
| | | cnName: "é
æ¹ä¿¡æ¯è¯¦æ
", |
| | | table: "FormulaDetail", |
| | | columns: [ |
| | | { |
| | | field: "formulaId", |
| | | title: "ID", |
| | | title: "é
æ¹ID", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "componentCode", |
| | | title: "é¶ä»¶ç¼å·", |
| | | type: "string", |
| | | edit: { type: "" }, |
| | | width: 120, |
| | | require: true, |
| | | align: "left", |
| | |
| | | field: "componentName", |
| | | title: "é¶ä»¶åç§°", |
| | | type: "string", |
| | | edit: { type: "" }, |
| | | width: 150, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "supplierCode", |
| | | title: "便¹ä»£ç ", |
| | | type: "string", |
| | | edit: { type: "" }, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | | width: 100, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | // è¡¨æ ¼åºç¡é
ç½® |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨åç»å®åæ®µï¼æ°å¢supplierCodeï¼ |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | formulaId: "", |
| | | componentCode: "", |
| | | componentName: "", |
| | | supplierCode: "", |
| | | isScanned: "", |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨åé
ç½®é¡¹ï¼æ°å¢ä¾æ¹ä»£ç è¾å
¥é¡¹ï¼ |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "便¹ä»£ç ", |
| | | field: "supplierCode", |
| | | type: "input", |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | |
| | | ], |
| | | ]); |
| | | |
| | | // æç´¢è¡¨åç»å®åæ®µï¼æ°å¢supplierCodeï¼ |
| | | const searchFormFields = ref({ |
| | | formulaId: "", |
| | | componentCode: "", |
| | | componentName: "", |
| | | supplierCode: "", |
| | | creater: "", |
| | | createDate: "", |
| | | isScanned: "", |
| | | }); |
| | | |
| | | // æç´¢è¡¨åé
ç½®é¡¹ï¼æ°å¢ä¾æ¹ä»£ç æ¨¡ç³æç´¢ï¼ |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "é
æ¹ä¿¡æ¯ä¸»é®", field: "formulaId", type: "int" }, |
| | | { title: "é¶ä»¶ç¼å·", field: "componentCode", type: "like" }, |
| | | { title: "é¶ä»¶åç§°", field: "componentName", type: "like" }, |
| | | { title: "便¹ä»£ç ", field: "supplierCode", type: "like" }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | |
| | | ], |
| | | ]); |
| | | |
| | | // è¡¨æ ¼åé
ç½®ï¼æ°å¢ä¾æ¹ä»£ç åï¼ |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | |
| | | { |
| | | field: "componentName", |
| | | title: "é¶ä»¶åç§°", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "supplierCode", |
| | | title: "便¹ä»£ç ", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | |
| | | }, |
| | | ]); |
| | | |
| | | // 详æ
页é
ç½®ï¼ææªä½¿ç¨ï¼ä¿æåæï¼ |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | // è¡¨æ ¼åºç¡é
ç½® |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "å 工信æ¯", |
| | | name: "processInfo", |
| | | url: "/processInfo/", |
| | | sortName: "createDate", |
| | | url: "/processInfo/", |
| | | sortName: "createDate", |
| | | sortOrder: "desc", // æ°å¢ï¼å建æ¶é´é»è®¤ååºï¼ç¬¦å常è§ä½¿ç¨ |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨ååæ®µ - å®å
¨å¹é
å端Dt_ProcessInfoå®ä½ |
| | | // æ°å¢ï¼pressPressureï¼åè£
ä½ä¸åååï¼ï¼è¡¥å
¨ææåç«¯åæ®µ |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | palletCode: "", |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | componentQty: "", |
| | | torsioValue: "", |
| | | torsioValueStandard: "", |
| | | stiffnessValue: "", |
| | | stiffnessValueStandard: "", |
| | | testResult: "", |
| | | pressHeight: "", |
| | | screwTorque: "", |
| | | screwAngle: "", |
| | | height1: "", |
| | | height2: "", |
| | | height3: "", |
| | | productSn: "", // æµæ°´å· |
| | | pressTightenNg: "", // åè£
æ§ç´§_æ§ç´§NG |
| | | pressTightenOk: "", // åè£
æ§ç´§_æ§ç´§OK |
| | | pressTightenUnfinished: "", // åè£
æ§ç´§_æ¬æ¬¡å å·¥æªå®æ |
| | | checkUnfinished: "", // æ£æµ_æ¬æ¬¡æ£æµæªå®æ |
| | | //componentQty: "", // é¶ä»¶æ°é |
| | | // torsioValue: "", // æåå¼ |
| | | // torsioValueStandard: "", // æå弿 å |
| | | // stiffnessValue: "", // ååº¦å¼ |
| | | // stiffnessValueStandard: "", // ååº¦å¼æ å |
| | | // testResult: "", // æµè¯ç»æ |
| | | pressHeight: "", // åè£
ä½ä¸åé«åº¦ |
| | | screwTorque: "", // åè£
使§ç´§æå |
| | | screwAngle: "", // åè£
使§ç´§è§åº¦ |
| | | pressPressure: "", // ãæ°å¢ãåè£
ä½ä¸åååï¼å¹é
å端å®ä½ï¼ |
| | | height1: "", // æ§ç´§ä½æ£æµé«åº¦1 |
| | | height2: "", // æ§ç´§ä½æ£æµé«åº¦2 |
| | | height3: "", // æ§ç´§ä½æ£æµé«åº¦3 |
| | | }); |
| | | |
| | | |
| | | // ç¼è¾è¡¨åé
ç½®-ãåæ¶åç±»ï¼ååæå¸ãï¼ä¿çææåææ ¡éª/é»è®¤å¼/屿§ |
| | | const editFormOptions = ref([ |
| | | // 第ä¸è¡ï¼5ä¸ªåæ®µï¼åºç¡æ è¯+1ä¸ªç¶æï¼ï¼å®½åº¦åè° |
| | | [ |
| | | { |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | field: "palletCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | width: 160, |
| | | require: true, |
| | | placeholder: "请è¾å
¥å·¥è£
æ¿ç¼å·", |
| | | }, |
| | | { |
| | | title: "æåç¼å·", |
| | | field: "productCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | width: 160, |
| | | require: true, |
| | | placeholder: "请è¾å
¥æåç¼å·", |
| | | }, |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | } |
| | | width: 160, |
| | | require: true, |
| | | placeholder: "请è¾å
¥æååç§°", |
| | | }, |
| | | { |
| | | title: "æµæ°´å·", |
| | | field: "productSn", |
| | | type: "input", |
| | | width: 180, |
| | | require: false, |
| | | placeholder: "请è¾å
¥äº§åæµæ°´å·", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "é¶ä»¶æ°é", |
| | | field: "componentQty", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | title: "æ§ç´§NG", |
| | | field: "pressTightenNg", |
| | | type: "select", |
| | | width: 150, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "æåå¼", |
| | | field: "torsioValue", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | title: "æ§ç´§OK", |
| | | field: "pressTightenOk", |
| | | type: "select", |
| | | width: 150, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "æå弿 å", |
| | | field: "torsioValueStandard", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "å度å¼", |
| | | field: "stiffnessValue", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | title: "æ§ç´§æªå®æ", |
| | | field: "pressTightenUnfinished", |
| | | type: "select", |
| | | width: 170, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "ååº¦å¼æ å", |
| | | field: "stiffnessValueStandard", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | title: "æ£æµæªå®æ", |
| | | field: "checkUnfinished", |
| | | type: "select", |
| | | width: 150, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "æµè¯ç»æ", |
| | | field: "testResult", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "åè£
ä½ä¸åæ£æµé«åº¦", |
| | | field: "pressHeight", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "åè£
使§ç´§æ£æµæå", |
| | | field: "screwTorque", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "åè£
使§ç´§æ£æµè§åº¦", |
| | | field: "screwAngle", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ§ç´§ä½æ£æµé«åº¦1", |
| | | field: "height1", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "æ§ç´§ä½æ£æµé«åº¦2", |
| | | field: "height2", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "æ§ç´§ä½æ£æµé«åº¦3", |
| | | field: "height3", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | // { |
| | | // title: "é¶ä»¶æ°é", |
| | | // field: "componentQty", |
| | | // type: "input", |
| | | // inputType: "number", |
| | | // width: 140, |
| | | // require: false, |
| | | // attrs: { min: 0, step: 1 }, |
| | | // placeholder: "请è¾å
¥æ£æ´æ°", |
| | | // }, |
| | | { |
| | | title: "主é®ID", |
| | | field: "id", |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true |
| | | } |
| | | ] |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | // // 第ä¸è¡ï¼5ä¸ªåæ®µï¼æå/å度ç¸å
³+æµè¯ç»æï¼ï¼å°æ°æ ¡éª |
| | | // [ |
| | | // { |
| | | // title: "æåå¼", |
| | | // field: "torsioValue", |
| | | // type: "input", |
| | | // inputType: "number", |
| | | // width: 140, |
| | | // require: false, |
| | | // attrs: { step: 0.01, min: 0 }, |
| | | // placeholder: "ä¿ç2ä½å°æ°", |
| | | // }, |
| | | // { |
| | | // title: "æå弿 å", |
| | | // field: "torsioValueStandard", |
| | | // type: "input", |
| | | // inputType: "number", |
| | | // width: 160, |
| | | // require: false, |
| | | // attrs: { step: 0.01, min: 0 }, |
| | | // placeholder: "ä¿ç2ä½å°æ°", |
| | | // }, |
| | | // { |
| | | // title: "å度å¼", |
| | | // field: "stiffnessValue", |
| | | // type: "input", |
| | | // inputType: "number", |
| | | // width: 140, |
| | | // require: false, |
| | | // attrs: { step: 0.01, min: 0 }, |
| | | // placeholder: "ä¿ç2ä½å°æ°", |
| | | // }, |
| | | // { |
| | | // title: "ååº¦å¼æ å", |
| | | // field: "stiffnessValueStandard", |
| | | // type: "input", |
| | | // inputType: "number", |
| | | // width: 160, |
| | | // require: false, |
| | | // attrs: { step: 0.01, min: 0 }, |
| | | // placeholder: "ä¿ç2ä½å°æ°", |
| | | // }, |
| | | // { |
| | | // title: "æµè¯ç»æ", |
| | | // field: "testResult", |
| | | // type: "input", |
| | | // inputType: "number", |
| | | // width: 140, |
| | | // require: false, |
| | | // placeholder: "请è¾å
¥æ°åç»æ", |
| | | // }, |
| | | // ], |
| | | // 第åè¡ï¼4ä¸ªåæ®µï¼åè£
ä½å
¨åæ°ï¼ï¼å°æ°æ ¡éªï¼æ°å¢åè£
åå |
| | | [ |
| | | { |
| | | title: "åè£
é«åº¦", |
| | | field: "pressHeight", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "åè£
åå", |
| | | field: "pressPressure", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "åè£
æå", |
| | | field: "screwTorque", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "æ§ç´§è§åº¦", |
| | | field: "screwAngle", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | ], |
| | | // 第äºè¡ï¼3ä¸ªåæ®µï¼æ§ç´§ä½æ£æµé«åº¦ï¼ï¼å°æ°æ ¡éªï¼å±
ä¸æå¸ |
| | | [ |
| | | { |
| | | title: "æ£æµé«åº¦1", |
| | | field: "height1", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 200, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "æ£æµé«åº¦2", |
| | | field: "height2", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 200, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "æ£æµé«åº¦3", |
| | | field: "height3", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 200, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | // æç´¢è¡¨ååæ®µ - æ ¸å¿æç´¢é¡¹ï¼æµæ°´å·+åºç¡ä¿¡æ¯+å建信æ¯ï¼ |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | productSn: "", // æµæ°´å·æç´¢ |
| | | creater: "", |
| | | createDate: "", |
| | | }); |
| | | |
| | | // æç´¢è¡¨åé
ç½® - ä¼å宽度ï¼å¹é
å¸å± |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "å·¥è£
æ¿ç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like" }, |
| | | { title: "æååç§°", field: "productName", type: "like" }, |
| | | { title: "å·¥è£
æ¿ç¼å·", field: "palletCode", type: "like", width: 180 }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like", width: 180 }, |
| | | { title: "æååç§°", field: "productName", type: "like", width: 180 }, |
| | | { title: "æµæ°´å·", field: "productSn", type: "like", width: 200 }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | { title: "å建人", field: "creater", type: "like", width: 200 }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime", width: 380 }, |
| | | ], |
| | | ]); |
| | | |
| | | // è¡¨æ ¼åé
ç½® - å®å
¨å¹é
å端å®ä½ï¼æ°å¢pressPressureåï¼ä¼åå宽/å¯¹é½ |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "åºå·", |
| | | type: "int", |
| | | width: 90, |
| | | width: 80, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | width: 140, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productCode", |
| | | title: "æåç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | width: 140, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "componentQty", |
| | | title: "é¶ä»¶æ°é", |
| | | type: "int", |
| | | width: 200, |
| | | field: "productSn", |
| | | title: "æµæ°´å·", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | overflow: "ellipsis", |
| | | }, |
| | | // 4ä¸ªç¶æå - æ¯å¦æ ¼å¼åæ¾ç¤º |
| | | { |
| | | field: "pressTightenNg", |
| | | title: "æ§ç´§NG", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "torsioValue", |
| | | title: "æåå¼", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | field: "pressTightenOk", |
| | | title: "æ§ç´§OK", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "torsioValueStandard", |
| | | title: "æå弿 å", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | field: "pressTightenUnfinished", |
| | | title: "æ§ç´§æªå®æ", |
| | | type: "select", |
| | | width: 140, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "stiffnessValue", |
| | | title: "å度å¼", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | field: "checkUnfinished", |
| | | title: "æ£æµæªå®æ", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "stiffnessValueStandard", |
| | | title: "ååº¦å¼æ å", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "testResult", |
| | | title: "æµè¯ç»æ", |
| | | type: "int", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | // { |
| | | // field: "componentQty", |
| | | // title: "é¶ä»¶æ°é", |
| | | // type: "int", |
| | | // width: 90, |
| | | // align: "center", |
| | | // }, |
| | | // // æå/å度ç¸å
³ - decimalç±»åï¼ä¿ç2ä½å°æ°ï¼ |
| | | // { |
| | | // field: "torsioValue", |
| | | // title: "æåå¼", |
| | | // type: "decimal", |
| | | // width: 90, |
| | | // align: "center", |
| | | // }, |
| | | // { |
| | | // field: "torsioValueStandard", |
| | | // title: "æåæ å", |
| | | // type: "decimal", |
| | | // width: 100, |
| | | // align: "center", |
| | | // }, |
| | | // { |
| | | // field: "stiffnessValue", |
| | | // title: "å度å¼", |
| | | // type: "decimal", |
| | | // width: 90, |
| | | // align: "center", |
| | | // }, |
| | | // { |
| | | // field: "stiffnessValueStandard", |
| | | // title: "å度æ å", |
| | | // type: "decimal", |
| | | // width: 100, |
| | | // align: "center", |
| | | // }, |
| | | // { |
| | | // field: "testResult", |
| | | // title: "æµè¯ç»æ", |
| | | // type: "int", |
| | | // width: 90, |
| | | // align: "center", |
| | | // }, |
| | | // åè£
使£æµåæ° - ãæ°å¢pressPressureåãdecimalç±»å |
| | | { |
| | | field: "pressHeight", |
| | | title: "åè£
ä½ä¸åæ£æµé«åº¦", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | title: "åè£
é«åº¦", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressPressure", // ãæ°å¢ãåè£
ä½ä¸ååå |
| | | title: "åè£
åå", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | columnDescription: "åè£
ä½ä¸ååå", |
| | | }, |
| | | { |
| | | field: "screwTorque", |
| | | title: "åè£
使§ç´§æ£æµæå", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | title: "åè£
æå", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "screwAngle", |
| | | title: "åè£
使§ç´§æ£æµè§åº¦", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | title: "æ§ç´§è§åº¦", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | // æ§ç´§ä½æ£æµé«åº¦ |
| | | { |
| | | field: "height1", |
| | | title: "æ§ç´§ä½æ£æµé«åº¦1", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | title: "æ£æµé«åº¦1", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "height2", |
| | | title: "æ§ç´§ä½æ£æµé«åº¦2", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | title: "æ£æµé«åº¦2", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "height3", |
| | | title: "æ§ç´§ä½æ£æµé«åº¦3", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | title: "æ£æµé«åº¦3", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | // å
Œ
±å段 - å建/ä¿®æ¹ä¿¡æ¯ |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 150, |
| | | align: "left", |
| | | width: 160, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | |
| | | // å å·¥ä¿¡æ¯æ æç»ï¼ä¿æç©ºé
ç½® |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | </script> |
| | |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | // è¡¨æ ¼åºç¡é
ç½® - æ°å¢é»è®¤ååºãç»ä¸è§è |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | |
| | | name: "processInfoDetail", |
| | | url: "/processInfoDetail/", |
| | | sortName: "createDate", |
| | | sortOrder: "desc", // æ°å¢ï¼å建æ¶é´é»è®¤ååºï¼å主页é¢ä¿æä¸è´ |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨ååæ®µ - 忥䏻页é¢ï¼æ°å¢pressPressureï¼åè£
ååï¼ï¼å¹é
å端å®ä½ |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | productSn: "", // æµæ°´å· |
| | | pressTightenNg: "", // åè£
æ§ç´§_æ§ç´§NG |
| | | pressTightenOk: "", // åè£
æ§ç´§_æ§ç´§OK |
| | | pressTightenUnfinished: "", // åè£
æ§ç´§_æ¬æ¬¡å å·¥æªå®æ |
| | | checkUnfinished: "", // æ£æµ_æ¬æ¬¡æ£æµæªå®æ |
| | | pressHeight: "", // åè£
ä½ä¸åé«åº¦ |
| | | screwTorque: "", // åè£
使§ç´§æå |
| | | screwAngle: "", // åè£
使§ç´§è§åº¦ |
| | | pressPressure: "", // ãæ°å¢ãåè£
ä½ä¸åååï¼å¹é
å端å®ä½ï¼ |
| | | height1: "", // æ§ç´§ä½æ£æµé«åº¦1 |
| | | height2: "", // æ§ç´§ä½æ£æµé«åº¦2 |
| | | height3: "", // æ§ç´§ä½æ£æµé«åº¦3 |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨åé
ç½® - åæ¶åä½åç±»ãååæå¸ï¼æ°å¢åè£
åå项ï¼è¡¥å
¨é»è®¤å¼/æ ¡éªï¼ç»ä¸å®½åº¦ |
| | | const editFormOptions = ref([ |
| | | // 第ä¸è¡ï¼åºç¡æ è¯ï¼å®½åº¦åè°ï¼å主页é¢å¸å±ä¸è´ |
| | | [ |
| | | { |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | field: "palletCode", |
| | | type: "input", |
| | | width: 200, |
| | | width: 160, |
| | | require: true, |
| | | placeholder: "请è¾å
¥å·¥è£
æ¿ç¼å·", |
| | | }, |
| | | { |
| | | title: "æåç¼å·", |
| | | field: "productCode", |
| | | type: "input", |
| | | width: 200, |
| | | width: 160, |
| | | require: true, |
| | | placeholder: "请è¾å
¥æåç¼å·", |
| | | }, |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | width: 200, |
| | | width: 160, |
| | | require: true, |
| | | placeholder: "请è¾å
¥æååç§°", |
| | | }, |
| | | { |
| | | title: "æµæ°´å·", |
| | | field: "productSn", |
| | | type: "input", |
| | | width: 180, |
| | | require: false, |
| | | placeholder: "请è¾å
¥äº§åæµæ°´å·", |
| | | }, |
| | | ], |
| | | // 第äºè¡ï¼4ä¸ªç¶æå+主é®ï¼è¡¥å
¨é»è®¤å¼0ï¼å¦ï¼ï¼ç»ä¸å®½åº¦/对é½ï¼éèä¸»é® |
| | | [ |
| | | { |
| | | title: "æ§ç´§NG", |
| | | field: "pressTightenNg", |
| | | type: "select", |
| | | width: 150, |
| | | align: "center", |
| | | defaultValue: "0", // æ°å¢é»è®¤å¼ï¼å主页é¢ä¸è´ |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "æ§ç´§OK", |
| | | field: "pressTightenOk", |
| | | type: "select", |
| | | width: 150, |
| | | align: "center", |
| | | defaultValue: "0", // æ°å¢é»è®¤å¼ |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "æ§ç´§æªå®æ", |
| | | field: "pressTightenUnfinished", |
| | | type: "select", |
| | | width: 170, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "æ£æµæªå®æ", |
| | | field: "checkUnfinished", |
| | | type: "select", |
| | | width: 150, |
| | | align: "center", |
| | | defaultValue: "0", // æ°å¢é»è®¤å¼ï¼ç»ä¸è§è |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "主é®ID", |
| | | field: "id", |
| | |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åè£
é«åº¦", |
| | | field: "pressHeight", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "åè£
åå", |
| | | field: "pressPressure", // æ°å¢åè£
åå项 |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "åè£
æå", |
| | | field: "screwTorque", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "æ§ç´§è§åº¦", |
| | | field: "screwAngle", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 160, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | ], |
| | | // 第äºè¡ï¼æ§ç´§ä½æ£æµé«åº¦ï¼å°æ°æ ¡éªï¼å±
䏿å¸ï¼ç»ä¸å®½åº¦ |
| | | [ |
| | | { |
| | | title: "æ£æµé«åº¦1", |
| | | field: "height1", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 200, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "æ£æµé«åº¦2", |
| | | field: "height2", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 200, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | { |
| | | title: "æ£æµé«åº¦3", |
| | | field: "height3", |
| | | type: "input", |
| | | inputType: "number", |
| | | width: 200, |
| | | require: false, |
| | | attrs: { step: 0.01, min: 0 }, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | // æç´¢è¡¨ååæ®µ - ä¿æå主页é¢ãåæä»£ç ä¸è´ï¼æ ¸å¿æç´¢é¡¹æ è°æ´ |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | productSn: "", // æµæ°´å·æç´¢ |
| | | creater: "", |
| | | createDate: "", |
| | | }); |
| | | |
| | | // æç´¢è¡¨åé
ç½® - ä¼å宽度å¹é
å¸å±ï¼å主页é¢å®å
¨ä¸è´ |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "å·¥è£
æ¿ç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like" }, |
| | | { title: "æååç§°", field: "productName", type: "like" }, |
| | | { title: "å·¥è£
æ¿ç¼å·", field: "palletCode", type: "like", width: 180 }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like", width: 180 }, |
| | | { title: "æååç§°", field: "productName", type: "like", width: 180 }, |
| | | { title: "æµæ°´å·", field: "productSn", type: "like", width: 200 }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | { title: "å建人", field: "creater", type: "like", width: 200 }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime", width: 380 }, |
| | | ], |
| | | ]); |
| | | |
| | | // è¡¨æ ¼åé
ç½® - ãæ°å¢pressPressureåãï¼ç»ä¸åå/宽度/ç±»åï¼ä¿®å¤é¦åæ¯å¤§åé®é¢ï¼ä¼åå¯¹é½ |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "åºå·", |
| | | type: "int", |
| | | width: 90, |
| | | width: 80, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | width: 140, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productCode", |
| | | title: "æåç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | width: 140, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productSn", |
| | | title: "æµæ°´å·", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | overflow: "ellipsis", |
| | | }, |
| | | // 4ä¸ªç¶æå - ä¿®å¤åæPressTightenNgé¦åæ¯å¤§åé®é¢ï¼ç»ä¸è§è |
| | | { |
| | | field: "pressTightenNg", |
| | | title: "æ§ç´§NG", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "pressTightenOk", |
| | | title: "æ§ç´§OK", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "pressTightenUnfinished", |
| | | title: "æ§ç´§æªå®æ", |
| | | type: "select", |
| | | width: 140, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "checkUnfinished", |
| | | title: "æ£æµæªå®æ", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "pressHeight", |
| | | title: "åè£
é«åº¦", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressPressure", // æ°å¢åè£
ååå |
| | | title: "åè£
åå", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | columnDescription: "åè£
ä½ä¸ååå", |
| | | }, |
| | | { |
| | | field: "screwTorque", |
| | | title: "åè£
æå", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "screwAngle", |
| | | title: "æ§ç´§è§åº¦", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | // æ§ç´§ä½æ£æµé«åº¦ |
| | | { |
| | | field: "height1", |
| | | title: "æ£æµé«åº¦1", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "height2", |
| | | title: "æ£æµé«åº¦2", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "height3", |
| | | title: "æ£æµé«åº¦3", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | // å
Œ
±å段 - å建/ä¿®æ¹ä¿¡æ¯ï¼å主页é¢ä¸è´ |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 150, |
| | | align: "left", |
| | | width: 160, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | |
| | | // æ äºçº§æç»ï¼ä¿æç©ºé
ç½®ä¸å |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | // ãä¿®æ¹1ãæ°å¢ç»è£
人åãé¦ä»¶/æ«ä»¶æµæ°´å·å段ï¼ç§»é¤ä¸åå¨çisScanned |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | stationCode: "", |
| | | stationName: "", |
| | | stationEndProduct: "", |
| | | assembleUser: "", // ç»è£
人å |
| | | firstProductSn: "", // é¦ä»¶æµæ°´å· |
| | | lastProductSn: "", // æ«ä»¶æµæ°´å· |
| | | }); |
| | | |
| | | const editFormOptions = ref([ |
| | |
| | | require: false, |
| | | }, |
| | | ], |
| | | // ãä¿®æ¹2ãç§»é¤isScanned䏿æ¡ï¼æ°å¢ç»è£
人åè¾å
¥æ¡ |
| | | [ |
| | | { |
| | | title: "ç»è£
人å", |
| | | field: "assembleUser", |
| | | type: "input", |
| | | width: 200, |
| | | require: false, // å端å
è®¸ä¸ºç©ºï¼æ
设为éå¿
å¡« |
| | | }, |
| | | ], |
| | | // ãæ°å¢ãé¦ä»¶æµæ°´å·è¾å
¥æ¡ |
| | | [ |
| | | { |
| | | title: "é¦ä»¶æµæ°´å·", |
| | | field: "firstProductSn", |
| | | type: "input", |
| | | width: 300, // æµæ°´å·è¾é¿ï¼å 宽è¾å
¥æ¡ |
| | | require: false, |
| | | }, |
| | | ], |
| | | // ãæ°å¢ãæ«ä»¶æµæ°´å·è¾å
¥æ¡ |
| | | [ |
| | | { |
| | | title: "æ«ä»¶æµæ°´å·", |
| | | field: "lastProductSn", |
| | | type: "input", |
| | | width: 300, |
| | | require: false, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "主é®ID", |
| | |
| | | ], |
| | | ]); |
| | | |
| | | // ãä¿®æ¹3ãæç´¢è¡¨åç§»é¤isScannedï¼æ°å¢ç»è£
人åï¼æµæ°´å·ä¸è¬ä¸åæç´¢ï¼æ
䏿°å¢ï¼ |
| | | const searchFormFields = ref({ |
| | | stationCode: "", |
| | | stationName: "", |
| | | stationEndProduct: "", |
| | | assembleUser: "", // æ°å¢ç»è£
人åæç´¢ |
| | | creater: "", |
| | | createDate: "", |
| | | }); |
| | |
| | | type: "select-search", |
| | | data: stationEndProductList, // ç»å®å
¨å±æ¥å£æ°æ® |
| | | }, |
| | | { title: "ç»è£
人å", field: "assembleUser", type: "like" }, // æ°å¢ç»è£
äººåæ¨¡ç³æç´¢ |
| | | ], |
| | | [ |
| | | // ãä¿®æ¹4ãç§»é¤æç´¢æ çisScannedä¸ææ¡ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | // ãä¿®æ¹5ãç§»é¤è¡¨æ ¼çisScannedåï¼æ°å¢ä»¥ä¸ä¸å |
| | | { |
| | | field: "assembleUser", |
| | | title: "ç»è£
人å", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "firstProductSn", |
| | | title: "é¦ä»¶æµæ°´å·", |
| | | type: "string", |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "lastProductSn", |
| | | title: "æ«ä»¶æµæ°´å·", |
| | | type: "string", |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | |
| | | key: "", |
| | | }); |
| | | |
| | | // ãä¿çåæé»è¾ãè·åç«å°æåä¸ææ°æ® |
| | | const getStationEndProductData = async () => { |
| | | try { |
| | | const res = await axios.get("/api/formula/getEndProductList"); |
| | |
| | | |
| | | <template> |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | |
| | | require: true, |
| | | align: "left", |
| | | edit: { type: "" }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | sortable: true, |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.PLCEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | | { |
| | |
| | | /// <summary> |
| | | /// æ¯è¾é¶ä»¶æ¯å¦é½å
¨ |
| | | /// </summary> |
| | | /// <param name="boxingDetails"></param> |
| | | /// <param name="formulaDetails"></param> |
| | | /// <returns></returns> |
| | | public bool IsComponentCodesEqual(List<Dt_BoxingDetail> boxingDetails, List<Dt_FormulaDetail> formulaDetails) |
| | | /// <param name="boxingDetails">å®é
è£
ç®±çé¶ä»¶éå</param> |
| | | /// <param name="formulaDetails">é
æ¹è¦æ±çé¶ä»¶éå</param> |
| | | /// <returns>æ¯å¦å®å
¨å¹é
</returns> |
| | | public bool CheckComponentsMatchExactly(List<string> boxingDetails, List<string> formulaDetails) |
| | | { |
| | | // 1. åºç¡æ ¡éªï¼ç©ºå¼/æ°éä¸ä¸è´ç´æ¥è¿åä¸å¹é
|
| | | if (boxingDetails == null || formulaDetails == null || boxingDetails.Count != formulaDetails.Count) |
| | | { |
| | | return false; |
| | | } |
| | | List<string> BoxingIdList = boxingDetails.Select(x => x.ComponentCode).ToList(); |
| | | List<string> FormulaIdList = formulaDetails.Select(x => x.ComponentCode).ToList(); |
| | | return !BoxingIdList.Except(FormulaIdList).Any() && !FormulaIdList.Except(BoxingIdList).Any(); |
| | | // 2. 两个空éåç´æ¥å¤å®ä¸ºå¹é
ï¼æ é¶ä»¶=é¶ä»¶é½å
¨ï¼ |
| | | if (boxingDetails.Count == 0) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | // 3. ç»è®¡ç¬¬ä¸ä¸ªéåçå
ç´ åºç°æ¬¡æ°ï¼ä¸¥æ ¼é®å¹é
ï¼å¤çéå¤å
ç´ ï¼ |
| | | var elementCountDict = new Dictionary<string, int>(); |
| | | foreach (var item in boxingDetails) |
| | | { |
| | | // å¤çéåä¸çnullå
ç´ ï¼è½¬ä¸ºç©ºå符串é¿å
åå
¸é®ä¸ºnullæ¥é |
| | | var key = item ?? string.Empty; |
| | | if (elementCountDict.ContainsKey(key)) |
| | | { |
| | | elementCountDict[key]++; |
| | | } |
| | | else |
| | | { |
| | | elementCountDict[key] = 1; |
| | | } |
| | | } |
| | | |
| | | // 4. éå第äºä¸ªéåï¼æµæ¶è®¡æ°ï¼æ æ¤å
ç´ /æ°éä¸å¹é
ç´æ¥è¿åfalse |
| | | foreach (var item in formulaDetails) |
| | | { |
| | | var key = item ?? string.Empty; |
| | | if (!elementCountDict.ContainsKey(key)) |
| | | { |
| | | return false; // åå¨é
æ¹æ²¡æ/è£
ç®±å¤åºæ¥çé¶ä»¶ |
| | | } |
| | | elementCountDict[key]--; |
| | | if (elementCountDict[key] == 0) |
| | | { |
| | | elementCountDict.Remove(key); // è®¡æ°æ¸
é¶åç§»é¤ï¼é¿å
å¹²æ°æç»å¤æ |
| | | } |
| | | } |
| | | |
| | | // 5. åå
¸ä¸ºç©º = ææå
ç´ ç§ç±»+æ°éå®å
¨å¹é
|
| | | return elementCountDict.Count == 0; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error("æäº¤åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | string palletCode = toolingBoardSubmitDto.ToolingBoardNo?.Trim(); |
| | | string productCode = toolingBoardSubmitDto.FinishedProductCode?.Trim(); |
| | | if (string.IsNullOrWhiteSpace(palletCode)) |
| | | if (!string.IsNullOrWhiteSpace(productCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error("å·¥è£
æ¿ç¼å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (string.IsNullOrWhiteSpace(productCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error("æåç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | string proCode = string.Empty; |
| | | string proOther = string.Empty; |
| | | |
| | | // 2. æ¥è¯¢æåé
æ¹ä¿¡æ¯ |
| | | Dt_Formula formulaModel = _formulaService.Repository.QueryFirst(x => x.ProductCode == productCode); |
| | | if (formulaModel == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ æåé
æ¹ï¼è¯·æ ¸å¯¹æåç¼ç "); |
| | | } |
| | | |
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == formulaModel.Id && x.IsScanned == 1); |
| | | List<string> Codelist = dt_FormulaDetails.Select(x => x.ComponentCode).ToList(); |
| | | string IsCode = IsComponentCodesEqual(toolingBoardSubmitDto.PartsList, Codelist); |
| | | if (IsCode != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç©æã{IsCode}ãé误ï¼è¯·æ ¸å¯¹ç©æç¼å·"); |
| | | } |
| | | |
| | | |
| | | // 3. æ ¸å¿å¤æï¼æ ¹æ®å·¥è£
æ¿ç¼å·æ¥è¯¢æ¯å¦åå¨ãæ°å¢/ä¿®æ¹ãçä¸»è¡¨æ°æ® |
| | | Dt_Boxing existBoxinModel = _boxingService.Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (existBoxinModel == null) |
| | | { |
| | | #region æ°å¢é»è¾ - åé»è¾ä¼åç |
| | | Dt_Boxing dt_boxin = new Dt_Boxing() |
| | | var proCodeMatch = System.Text.RegularExpressions.Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", System.Text.RegularExpressions.RegexOptions.IgnoreCase); |
| | | if (proCodeMatch.Success) |
| | | { |
| | | PalletCode = palletCode, |
| | | ProductCode = productCode, |
| | | ProductName = formulaModel.ProductName.Trim(), |
| | | Creater = "admin", |
| | | CreateDate = DateTime.Now |
| | | }; |
| | | int newBoxingId = _boxingService.Repository.AddData(dt_boxin); |
| | | |
| | | |
| | | // æ¹éæ·»å æç»è¡¨æ°æ® |
| | | if (toolingBoardSubmitDto.PartsList != null && toolingBoardSubmitDto.PartsList.Count > 0) |
| | | { |
| | | List<Dt_BoxingDetail> detailList = new List<Dt_BoxingDetail>(); |
| | | foreach (string ComponentCode in toolingBoardSubmitDto.PartsList) |
| | | { |
| | | if (string.IsNullOrWhiteSpace(ComponentCode)) continue; |
| | | string ComponentCodeTrim = ComponentCode.Trim(); |
| | | |
| | | Dt_FormulaDetail formulaDetail = _formulaDetailService.Repository.QueryFirst(x => x.FormulaId == formulaModel.Id && x.ComponentCode == ComponentCodeTrim); |
| | | if (formulaDetail == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"é
æ¹ä¸æ æ¤ç©æã{ComponentCodeTrim}ãï¼è¯·æ ¸å¯¹ç©æç¼å·"); |
| | | } |
| | | |
| | | Dt_BoxingDetail detailModel = new Dt_BoxingDetail() |
| | | { |
| | | BoxingId = newBoxingId, |
| | | ComponentCode = ComponentCodeTrim, |
| | | ComponentName = formulaDetail.ComponentName, |
| | | Creater = "admin", |
| | | CreateDate = DateTime.Now |
| | | }; |
| | | detailList.Add(detailModel); |
| | | } |
| | | if (detailList.Count > 0) |
| | | { |
| | | BaseDal.AddData(detailList); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | | #region ä¿®æ¹é»è¾ - æ°å¢æ ¸å¿é»è¾ |
| | | // 1. æ´æ°ä¸»è¡¨æ°æ® |
| | | existBoxinModel.ProductCode = productCode; |
| | | existBoxinModel.ProductName = formulaModel.ProductName.Trim(); |
| | | existBoxinModel.Modifier = "admin"; |
| | | existBoxinModel.ModifyDate = DateTime.Now; |
| | | _boxingService.Repository.UpdateData(existBoxinModel); |
| | | |
| | | int boxingId = existBoxinModel.Id; |
| | | |
| | | // 2. å é¤è¯¥ç»çä¸çãåæå
¨é¨æç»è¡¨æ°æ®ã |
| | | List<Dt_BoxingDetail> oldDetailList = BaseDal.QueryData(x => x.BoxingId == boxingId); |
| | | if (oldDetailList != null && oldDetailList.Count > 0) |
| | | { |
| | | BaseDal.DeleteData(oldDetailList); |
| | | proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}"; // æ¼æ¥TX+æ°åï¼ä¿ææ ¼å¼ç»ä¸ |
| | | } |
| | | |
| | | // 3. éæ°æå
¥ä¿®æ¹åçæç»è¡¨æ°æ® |
| | | if (toolingBoardSubmitDto.PartsList != null && toolingBoardSubmitDto.PartsList.Count > 0) |
| | | // æ£å2ï¼å¹é
è¿ç»ç10ä½çº¯æ°åï¼å
¨å±å¹é
ï¼å第ä¸ä¸ªç¬¦åçå³å¯ï¼ |
| | | var proOtherMatch = System.Text.RegularExpressions.Regex.Match(productCode, @"\d{10}"); |
| | | if (proOtherMatch.Success) |
| | | { |
| | | List<Dt_BoxingDetail> detailList = new List<Dt_BoxingDetail>(); |
| | | foreach (string ComponentCode in toolingBoardSubmitDto.PartsList) |
| | | { |
| | | if (string.IsNullOrWhiteSpace(ComponentCode)) continue; |
| | | string ComponentCodeTrim = ComponentCode.Trim(); |
| | | |
| | | Dt_FormulaDetail formulaDetail = _formulaDetailService.Repository.QueryFirst(x => x.FormulaId == formulaModel.Id && x.ComponentCode == ComponentCodeTrim); |
| | | if (formulaDetail == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"é
æ¹ä¸æ æ¤ç©æã{ComponentCodeTrim}ãï¼è¯·æ ¸å¯¹ç©æåç§°"); |
| | | } |
| | | |
| | | Dt_BoxingDetail detailModel = new Dt_BoxingDetail() |
| | | { |
| | | BoxingId = boxingId, |
| | | ComponentCode = ComponentCodeTrim, |
| | | ComponentName = formulaDetail.ComponentName, |
| | | Creater = "admin", |
| | | CreateDate = DateTime.Now |
| | | }; |
| | | detailList.Add(detailModel); |
| | | } |
| | | if (detailList.Count > 0) |
| | | { |
| | | BaseDal.AddData(detailList); |
| | | } |
| | | proOther = proOtherMatch.Value.Trim(); |
| | | } |
| | | #endregion |
| | | toolingBoardSubmitDto.PartsList = toolingBoardSubmitDto.PartsList.Where(code => !string.IsNullOrEmpty(code)).ToList(); |
| | | // 2. æ¥è¯¢æåé
æ¹ä¿¡æ¯ |
| | | Dt_Formula formulaModel = _formulaService.Repository.QueryFirst(x => x.ProductCode == proCode); |
| | | if (formulaModel == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ æåé
æ¹ï¼è¯·æ ¸å¯¹æåç¼ç "); |
| | | } |
| | | |
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == formulaModel.Id && x.IsScanned == 1); |
| | | List<string> Codelist = dt_FormulaDetails.Select(x => x.ComponentCode).ToList(); |
| | | string IsCode = IsComponentCodesEqual(toolingBoardSubmitDto.PartsList, Codelist); |
| | | if (IsCode != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç©æã{IsCode}ãé误ï¼è¯·æ ¸å¯¹ç©æç¼å·"); |
| | | } |
| | | |
| | | |
| | | |
| | | //Dt_Boxing existBoxinModel = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode); |
| | | |
| | | //if (existBoxinModel == null) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error($"æçæªæ·»å ï¼è¯·ç¨åéè¯"); |
| | | //} |
| | | |
| | | if (!CheckComponentsMatchExactly(toolingBoardSubmitDto.PartsList, Codelist)) |
| | | { |
| | | throw new InvalidOperationException("é¶ä»¶ä¸é
æ¹è¡¨ä¸ä¸å"); |
| | | } |
| | | |
| | | var PalletCode = TcpClientExample.Start("192.168.2.120", 2001); |
| | | if (!PalletCode.IsNotEmptyOrNull() || PalletCode == "NoRead") |
| | | { |
| | | throw new InvalidOperationException("æçç æªæ«å°ï¼è¯·éè¯"); |
| | | } |
| | | Dt_Boxing existBoxinModel = new Dt_Boxing(); |
| | | existBoxinModel.PalletCode = PalletCode; |
| | | existBoxinModel.ProductCode = proCode; |
| | | existBoxinModel.BoxingNo = proOther; |
| | | |
| | | int id = _boxingService.Repository.AddData(existBoxinModel); |
| | | |
| | | foreach (var item in dt_FormulaDetails) |
| | | { |
| | | Dt_BoxingDetail dt_BoxingDetail = new Dt_BoxingDetail() |
| | | { |
| | | BoxingId = id, |
| | | ComponentCode = item.ComponentCode, |
| | | ComponentName = item.ComponentName, |
| | | Creater = "admin", |
| | | CreateDate = new DateTime() |
| | | }; |
| | | BaseDal.AddData(dt_BoxingDetail); |
| | | } |
| | | uow.Commit(); |
| | | } |
| | | uow.Commit(); |
| | | string msg = existBoxinModel == null ? "ç»çä¿¡æ¯æ°å¢æåï¼" : "ç»çä¿¡æ¯ä¿®æ¹æåï¼"; |
| | | return WebResponseContent.Instance.OK(msg); |
| | | |
| | | |
| | | |
| | | OtherDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceName == "主æ§PLC") as OtherDevice; |
| | | if (device == null) throw new Exception("æªæ¾å°ä¸»æ§PLC设å¤ä¿¡æ¯"); |
| | | if (!device.IsConnected) throw new Exception($"主æ§PLC设å¤é讯å¼å¸¸"); |
| | | |
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, true); |
| | | Thread.Sleep(500); |
| | | |
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, false); |
| | | |
| | | |
| | | // if (existBoxinModel == null) |
| | | //{ |
| | | // #region æ°å¢é»è¾ - åé»è¾ä¼åç |
| | | // Dt_Boxing dt_boxin = new Dt_Boxing() |
| | | // { |
| | | // PalletCode = palletCode, |
| | | // ProductCode = productCode, |
| | | // ProductName = formulaModel.ProductName.Trim(), |
| | | // Creater = "admin", |
| | | // CreateDate = DateTime.Now |
| | | // }; |
| | | // int newBoxingId = _boxingService.Repository.AddData(dt_boxin); |
| | | |
| | | |
| | | // // æ¹éæ·»å æç»è¡¨æ°æ® |
| | | // if (toolingBoardSubmitDto.PartsList != null && toolingBoardSubmitDto.PartsList.Count > 0) |
| | | // { |
| | | // List<Dt_BoxingDetail> detailList = new List<Dt_BoxingDetail>(); |
| | | // foreach (string ComponentCode in toolingBoardSubmitDto.PartsList) |
| | | // { |
| | | // if (string.IsNullOrWhiteSpace(ComponentCode)) continue; |
| | | // string ComponentCodeTrim = ComponentCode.Trim(); |
| | | |
| | | // Dt_FormulaDetail formulaDetail = _formulaDetailService.Repository.QueryFirst(x => x.FormulaId == formulaModel.Id && x.ComponentCode == ComponentCodeTrim); |
| | | // if (formulaDetail == null) |
| | | // { |
| | | // return WebResponseContent.Instance.Error($"é
æ¹ä¸æ æ¤ç©æã{ComponentCodeTrim}ãï¼è¯·æ ¸å¯¹ç©æç¼å·"); |
| | | // } |
| | | |
| | | // Dt_BoxingDetail detailModel = new Dt_BoxingDetail() |
| | | // { |
| | | // BoxingId = newBoxingId, |
| | | // ComponentCode = ComponentCodeTrim, |
| | | // ComponentName = formulaDetail.ComponentName, |
| | | // Creater = "admin", |
| | | // CreateDate = DateTime.Now |
| | | // }; |
| | | // detailList.Add(detailModel); |
| | | // } |
| | | // if (detailList.Count > 0) |
| | | // { |
| | | // BaseDal.AddData(detailList); |
| | | // } |
| | | // } |
| | | // #endregion |
| | | //} |
| | | //else |
| | | //{ |
| | | // #region ä¿®æ¹é»è¾ - æ°å¢æ ¸å¿é»è¾ |
| | | // // 1. æ´æ°ä¸»è¡¨æ°æ® |
| | | // existBoxinModel.ProductCode = productCode; |
| | | // existBoxinModel.ProductName = formulaModel.ProductName.Trim(); |
| | | // existBoxinModel.Modifier = "admin"; |
| | | // existBoxinModel.ModifyDate = DateTime.Now; |
| | | // _boxingService.Repository.UpdateData(existBoxinModel); |
| | | |
| | | // int boxingId = existBoxinModel.Id; |
| | | |
| | | // // 2. å é¤è¯¥ç»çä¸çãåæå
¨é¨æç»è¡¨æ°æ®ã |
| | | // List<Dt_BoxingDetail> oldDetailList = BaseDal.QueryData(x => x.BoxingId == boxingId); |
| | | // if (oldDetailList != null && oldDetailList.Count > 0) |
| | | // { |
| | | // BaseDal.DeleteData(oldDetailList); |
| | | // } |
| | | |
| | | // // 3. éæ°æå
¥ä¿®æ¹åçæç»è¡¨æ°æ® |
| | | // if (toolingBoardSubmitDto.PartsList != null && toolingBoardSubmitDto.PartsList.Count > 0) |
| | | // { |
| | | // List<Dt_BoxingDetail> detailList = new List<Dt_BoxingDetail>(); |
| | | // foreach (string ComponentCode in toolingBoardSubmitDto.PartsList) |
| | | // { |
| | | // if (string.IsNullOrWhiteSpace(ComponentCode)) continue; |
| | | // string ComponentCodeTrim = ComponentCode.Trim(); |
| | | |
| | | // Dt_FormulaDetail formulaDetail = _formulaDetailService.Repository.QueryFirst(x => x.FormulaId == formulaModel.Id && x.ComponentCode == ComponentCodeTrim); |
| | | // if (formulaDetail == null) |
| | | // { |
| | | // return WebResponseContent.Instance.Error($"é
æ¹ä¸æ æ¤ç©æã{ComponentCodeTrim}ãï¼è¯·æ ¸å¯¹ç©æåç§°"); |
| | | // } |
| | | |
| | | // Dt_BoxingDetail detailModel = new Dt_BoxingDetail() |
| | | // { |
| | | // BoxingId = boxingId, |
| | | // ComponentCode = ComponentCodeTrim, |
| | | // ComponentName = formulaDetail.ComponentName, |
| | | // Creater = "admin", |
| | | // CreateDate = DateTime.Now |
| | | // }; |
| | | // detailList.Add(detailModel); |
| | | // } |
| | | // if (detailList.Count > 0) |
| | | // { |
| | | // BaseDal.AddData(detailList); |
| | | // } |
| | | // } |
| | | // #endregion |
| | | //} |
| | | //uow.Commit(); |
| | | //string msg = existBoxinModel == null ? "ç»çä¿¡æ¯æ°å¢æåï¼" : "ç»çä¿¡æ¯ä¿®æ¹æåï¼"; |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return base.AddData(saveModel); |
| | | } |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | Dt_Formula dt_Formula=new Dt_Formula() |
| | | { |
| | | Id = saveModel.MainData["id"].ObjToInt(), |
| | | ProductCode = saveModel.MainData["productCode"].ToString(), |
| | | ProductName = saveModel.MainData["productName"].ToString(), |
| | | ProductLength = decimal.Parse(saveModel.MainData["productLength"].ToString()), |
| | | ProductWidth = decimal.Parse(saveModel.MainData["productWidth"].ToString()), |
| | | ProductHeight = decimal.Parse(saveModel.MainData["productHeight"].ToString()), |
| | | ScrewDownsetDistance = decimal.Parse(saveModel.MainData["screwDownsetDistance"].ToString()), |
| | | ScrewTorqueOutput = decimal.Parse(saveModel.MainData["screwTorqueOutput"].ToString()), |
| | | DintAutoScrewOn = saveModel.MainData["dintAutoScrewOn"].ObjToInt(), |
| | | XDirectionDistance1 = decimal.Parse(saveModel.MainData["xDirectionDistance1"].ToString()), |
| | | YDirectionHeight1 = decimal.Parse(saveModel.MainData["yDirectionHeight1"].ToString()), |
| | | XDirectionDistance2 = decimal.Parse(saveModel.MainData["xDirectionDistance2"].ToString()), |
| | | YDirectionHeight2 = decimal.Parse(saveModel.MainData["yDirectionHeight2"].ToString()), |
| | | XDirectionDistance3 = decimal.Parse(saveModel.MainData["xDirectionDistance3"].ToString()), |
| | | YDirectionHeight3 = decimal.Parse(saveModel.MainData["yDirectionHeight3"].ToString()) |
| | | //public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | //{ |
| | | // Dt_Formula dt_Formula = new Dt_Formula() |
| | | // { |
| | | // Id = saveModel.MainData["id"].ObjToInt(), |
| | | // ProductCode = saveModel.MainData["productCode"].ToString(), |
| | | // ProductName = saveModel.MainData["productName"].ToString(), |
| | | // ProductLength = decimal.Parse(saveModel.MainData["productLength"].ToString()), |
| | | // ProductWidth = decimal.Parse(saveModel.MainData["productWidth"].ToString()), |
| | | // ProductHeight = decimal.Parse(saveModel.MainData["productHeight"].ToString()), |
| | | // ScrewDownsetDistance = decimal.Parse(saveModel.MainData["screwDownsetDistance"].ToString()), |
| | | // ScrewTorqueOutput = decimal.Parse(saveModel.MainData["screwTorqueOutput"].ToString()), |
| | | // DintAutoScrewOn = saveModel.MainData["dintAutoScrewOn"].ObjToInt(), |
| | | // P0P1Width = decimal.Parse(saveModel.MainData["p0P1Width"].ToString()), |
| | | // P0P2Width = decimal.Parse(saveModel.MainData["p0P2Width"].ToString()), |
| | | // P0P3Width = decimal.Parse(saveModel.MainData["p0P3Width"].ToString()), |
| | | // P1P3Height = decimal.Parse(saveModel.MainData["p1P3Height"].ToString()), |
| | | // P2P3Height = decimal.Parse(saveModel.MainData["p2P3Height"].ToString()), |
| | | |
| | | //ScrewTorque = float.Parse(saveModel.MainData["ScrewTorque"].ToString()), |
| | | //UpdateBy = saveModel.UpdateBy, |
| | | //UpdateTime = DateTime.Now |
| | | }; |
| | | return UpdateData(dt_Formula); |
| | | //return base.UpdateData(saveModel); |
| | | } |
| | | // //ScrewTorque = float.Parse(saveModel.MainData["ScrewTorque"].ToString()), |
| | | // //UpdateBy = saveModel.UpdateBy, |
| | | // //UpdateTime = DateTime.Now |
| | | // }; |
| | | // return UpdateData(dt_Formula); |
| | | // //return base.UpdateData(saveModel); |
| | | //} |
| | | |
| | | public override WebResponseContent UpdateData(Dt_Formula entity) |
| | | { |
| | | return base.UpdateData(entity); |
| | | } |
| | | //public override WebResponseContent UpdateData(Dt_Formula entity) |
| | | //{ |
| | | // return base.UpdateData(entity); |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | { |
| | | public class ProcessInfoService : ServiceBase<Dt_ProcessInfo, IRepository<Dt_ProcessInfo>>, IProcessInfoService |
| | | { |
| | | public ProcessInfoService(IRepository<Dt_ProcessInfo> BaseDal) : base(BaseDal) |
| | | |
| | | private readonly IFormulaService _formulaService; |
| | | private readonly IFormulaDetailService _formulaDetailService; |
| | | |
| | | public ProcessInfoService( |
| | | IRepository<Dt_ProcessInfo> BaseDal, |
| | | IFormulaService formulaService, |
| | | IFormulaDetailService formulaDetailService |
| | | ) : base(BaseDal) |
| | | { |
| | | _formulaService = formulaService; |
| | | _formulaDetailService = formulaDetailService; |
| | | } |
| | | |
| | | public IRepository<Dt_ProcessInfo> Repository => BaseDal; |
| | | |
| | | /// <summary> |
| | | /// ä¸è½½æµç¨å¡ |
| | | /// </summary> |
| | | /// <param name="dt_ProcessInfo"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ExportData(Dt_ProcessInfo dt_ProcessInfo) |
| | | { |
| | | |
| | | string fileName = $"{DateTime.Now.ToString("yyyyMMddHHssmm")}.xlsx"; |
| | | string templatePath = $"{AppDomain.CurrentDomain.BaseDirectory}ExprotTemplate\\åçµæºå¼¹æ§æ¯æä¿¡æ¯åæµç¨å¡.xlsx";//模æ¿è·¯å¾ |
| | | string savePath = $"{AppDomain.CurrentDomain.BaseDirectory}Download\\{fileName}";//ä¿åæä»¶è·¯å¾ |
| | | |
| | | using Stream templateStream = new FileStream(templatePath, FileMode.Open); |
| | | using Stream saveStream = new FileStream(savePath, FileMode.Create); |
| | | using ExcelPackage package = new ExcelPackage(saveStream, templateStream); |
| | | ExcelWorksheet worksheet = package.Workbook.Worksheets["æµç¨å¡"]; |
| | | worksheet.Cells[3, 5].Value = dt_ProcessInfo.ProductCode;//æåç¼å· |
| | | |
| | | package.Save(); |
| | | |
| | | string pdfFileName = $"{DateTime.Now.ToString("yyyyMMddHHssmm")}.pdf"; |
| | | string pdfPath = $"{AppDomain.CurrentDomain.BaseDirectory}Download\\{pdfFileName}"; |
| | | |
| | | Workbook workbook = new Workbook(); |
| | | workbook.LoadFromFile(savePath); |
| | | |
| | | // 转æ¢ç¬¬ä¸ä¸ªå·¥ä½è¡¨å°PDF |
| | | workbook.SaveToFile(pdfPath, FileFormat.PDF); |
| | | return WebResponseContent.Instance.OK(data: new { path = pdfPath, fileName = pdfFileName }); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using Autofac.Core; |
| | | using OfficeOpenXml; |
| | | using Spire.Xls; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | |
| | | { |
| | | private readonly IFormulaService _formulaService; |
| | | private readonly IFormulaDetailService _formulaDetailService; |
| | | private readonly IProcessInfoService _processInfoService; |
| | | private readonly IProcessInfoDetailService _processInfoDetailService; |
| | | |
| | | public ScanStationService(IRepository<Dt_ScanStation> BaseDal, |
| | | |
| | | public ScanStationService(IRepository<Dt_ScanStation> BaseDal, |
| | | IFormulaService formulaService, |
| | | IFormulaDetailService formulaDetailService |
| | | IFormulaDetailService formulaDetailService, |
| | | IProcessInfoService processInfoService, |
| | | IProcessInfoDetailService processInfoDetailService |
| | | ) : base(BaseDal) |
| | | { |
| | | _formulaService = formulaService; |
| | | _formulaDetailService = formulaDetailService; |
| | | _processInfoService = processInfoService; |
| | | _processInfoDetailService = processInfoDetailService; |
| | | } |
| | | |
| | | public IRepository<Dt_ScanStation> Repository => BaseDal; |
| | |
| | | var Error = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolError); |
| | | |
| | | if (Heart && !EMG && OnlineExecuting && !Error) |
| | | { |
| | | { |
| | | device.SetValue(W_PLCDBName.wboolAutoStart, true); |
| | | //æåä¿¡å· |
| | | device.SetValue(W_PLCDBName.wboolAutoPause, false); |
| | |
| | | var Heart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolHeart); |
| | | var EMG = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolEMG); |
| | | var Error = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolError); |
| | | if(!device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolAutoStart)) |
| | | if (!device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolAutoStart)) |
| | | { |
| | | return WebResponseContent.Instance.Error("è®¾å¤æªå¯å¨"); |
| | | } |
| | |
| | | } |
| | | return WebResponseContent.Instance.Error("æ´æ°é误"); |
| | | } |
| | | catch (Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¸è½½æµç¨å¡ |
| | | /// </summary> |
| | | /// <param name="dt_ProcessInfo"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ExportData(Dt_ScanStation dt_ScanStation) |
| | | { |
| | | |
| | | string fileName = $"{DateTime.Now.ToString("yyyyMMddHHssmm")}.xlsx"; |
| | | string templatePath = $"{AppDomain.CurrentDomain.BaseDirectory}ExprotTemplate\\åçµæºå¼¹æ§æ¯æä¿¡æ¯åæµç¨å¡.xlsx";//模æ¿è·¯å¾ |
| | | string savePath = $"{AppDomain.CurrentDomain.BaseDirectory}Download\\{fileName}";//ä¿åæä»¶è·¯å¾ |
| | | |
| | | using Stream templateStream = new FileStream(templatePath, FileMode.Open); |
| | | using Stream saveStream = new FileStream(savePath, FileMode.Create); |
| | | using ExcelPackage package = new ExcelPackage(saveStream, templateStream); |
| | | ExcelWorksheet worksheet = package.Workbook.Worksheets["æµç¨å¡"]; |
| | | Dt_Formula formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_ScanStation.StationEndProduct); |
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == formula.Id && x.IsScanned == 1).ToList(); |
| | | for (int i = dt_FormulaDetails.Count; i < 10; i++) |
| | | { |
| | | dt_FormulaDetails.Add(new Dt_FormulaDetail()); |
| | | } |
| | | |
| | | worksheet.Cells[3, 5].Value = dt_ScanStation.StationEndProduct;//æåç¼å· |
| | | worksheet.Cells[3, 17].Value = dt_ScanStation.LastProductSn.ObjToInt() - dt_ScanStation.FirstProductSn.ObjToInt() + 1;//æ°é; |
| | | worksheet.Cells[3, 29].Value = dt_ScanStation.FirstProductSn + "-" + dt_ScanStation.LastProductSn;//æµæ°´å· |
| | | worksheet.Cells[4, 5].Value = DateTime.Now.ToString("yyyy/MM/dd");//ç»è£
æ¥æ |
| | | worksheet.Cells[4, 17].Value = dt_ScanStation.AssembleUser;//ç»è£
人å |
| | | |
| | | int row = 7; |
| | | for (int j = 0; j < 5; j++) |
| | | { |
| | | worksheet.Cells[row, 1].Value = dt_FormulaDetails[j].ComponentName; |
| | | worksheet.Cells[row, 5].Value = dt_FormulaDetails[j].ComponentCode; |
| | | worksheet.Cells[row, 12].Value = dt_FormulaDetails[j].SupplierCode; |
| | | |
| | | worksheet.Cells[row, 19].Value = dt_FormulaDetails[j + 5].ComponentName; |
| | | worksheet.Cells[row, 23].Value = dt_FormulaDetails[j + 5].ComponentCode; |
| | | worksheet.Cells[row, 30].Value = dt_FormulaDetails[j + 5].SupplierCode; |
| | | row++; |
| | | } |
| | | |
| | | row = 13; |
| | | for (int j = 0; j < 4; j++) |
| | | { |
| | | worksheet.Cells[row + j, 12].Value = "â æ¯ â¡ å¦"; |
| | | worksheet.Cells[row + j, 30].Value = "â æ¯ â¡ å¦"; |
| | | } |
| | | worksheet.Cells[17, 12].Value = "â æ¯ â¡ å¦"; |
| | | worksheet.Cells[23, 5].Value = "â æ¯ â¡ å¦"; |
| | | |
| | | List<Dt_ProcessInfoDetail> dt_ProcessInfoDetails = _processInfoDetailService.Repository |
| | | .QueryData(x => x.ProductCode == dt_ScanStation.StationEndProduct |
| | | && x.ProductSn.CompareTo(dt_ScanStation.LastProductSn) >= 0 |
| | | && x.ProductSn.CompareTo(dt_ScanStation.LastProductSn) <= 0) |
| | | .OrderBy(x => x.CreateDate) |
| | | .ToList(); |
| | | row = 27; |
| | | ExcelRange baseStyleRow = worksheet.Cells[$"{row}:{row}"]; |
| | | foreach (var item in dt_ProcessInfoDetails) |
| | | { |
| | | if (row > 61) |
| | | { |
| | | var sourceRange = worksheet.Cells[row - 1, 1, row - 1, 36]; |
| | | var targetRange = worksheet.Cells[row, 1, row, 36]; |
| | | |
| | | // 1. å¤å¶åå¹¶è§åï¼åæé»è¾ä¿çï¼ |
| | | this.CopyCellMerge(worksheet, sourceRange, targetRange); |
| | | // 2. å¤å¶æ ·å¼ï¼å
¼å®¹ææEPPlusçæ¬ï¼ |
| | | targetRange.StyleID = sourceRange.StyleID; |
| | | // 3. 忥è¡é« |
| | | worksheet.Row(row).Height = worksheet.Row(row - 1).Height; |
| | | } |
| | | |
| | | worksheet.Cells[row, 1].Value = item.ProductSn; |
| | | worksheet.Cells[row, 7].Value = item.Height2; |
| | | worksheet.Cells[row, 13].Value = item.Height1; |
| | | worksheet.Cells[row, 19].Value = item.PressPressure; |
| | | worksheet.Cells[row, 25].Value = item.ScrewTorque; |
| | | if (item.PressTightenUnfinished == 1) |
| | | { |
| | | worksheet.Cells[row, 31].Value = "åè£
æ§ç´§å¼å¸¸"; |
| | | } |
| | | else if (item.CheckUnfinished == 1) |
| | | { |
| | | worksheet.Cells[row, 31].Value = "æ£æµå¼å¸¸"; |
| | | } |
| | | else |
| | | { |
| | | worksheet.Cells[row, 31].Value = "æ£å¸¸"; |
| | | } |
| | | row++; |
| | | |
| | | } |
| | | //worksheet.DeleteRow(row, worksheet.Dimension.End.Row - row + 1); |
| | | |
| | | package.Save(); |
| | | |
| | | string pdfFileName = $"{DateTime.Now.ToString("yyyyMMddHHssmm")}.pdf"; |
| | | string pdfPath = $"{AppDomain.CurrentDomain.BaseDirectory}Download\\{pdfFileName}"; |
| | | |
| | | Workbook workbook = new Workbook(); |
| | | workbook.LoadFromFile(savePath); |
| | | |
| | | // 转æ¢ç¬¬ä¸ä¸ªå·¥ä½è¡¨å°PDF |
| | | workbook.SaveToFile(pdfPath, FileFormat.PDF); |
| | | return WebResponseContent.Instance.OK(data: new { path = pdfPath, fileName = pdfFileName }); |
| | | |
| | | } |
| | | |
| | | |
| | | // <summary> |
| | | /// èªå®ä¹Excelåå
æ ¼åå¹¶è§åå¤å¶æ¹æ³ï¼å
¼å®¹ä½çæ¬EPPlusï¼ |
| | | /// </summary> |
| | | /// <param name="worksheet">Excelå·¥ä½è¡¨</param> |
| | | /// <param name="sourceRange">æºåå
æ ¼èå´</param> |
| | | /// <param name="targetRange">ç®æ åå
æ ¼èå´</param> |
| | | public void CopyCellMerge(ExcelWorksheet worksheet, ExcelRange sourceRange, ExcelRange targetRange) |
| | | { |
| | | if (sourceRange == null || targetRange == null) return; |
| | | if (sourceRange.Worksheet != worksheet || targetRange.Worksheet != worksheet) return; |
| | | |
| | | // 1. å
å°æºèå´å
çåå¹¶åºåæåå°ä¸´æ¶åè¡¨ä¸ |
| | | var sourceMergeList = new List<string>(); |
| | | foreach (var merge in worksheet.MergedCells) |
| | | { |
| | | var mergeRange = worksheet.Cells[merge]; |
| | | if (mergeRange.Start.Row >= sourceRange.Start.Row && mergeRange.End.Row <= sourceRange.End.Row |
| | | && mergeRange.Start.Column >= sourceRange.Start.Column && mergeRange.End.Column <= sourceRange.End.Column) |
| | | { |
| | | sourceMergeList.Add(merge); |
| | | } |
| | | } |
| | | |
| | | // 2. éå临æ¶å表ï¼å®å
¨å°åå»ºç®æ åå¹¶åºå |
| | | foreach (var merge in sourceMergeList) |
| | | { |
| | | var mergeRange = worksheet.Cells[merge]; |
| | | int rowOffset = targetRange.Start.Row - sourceRange.Start.Row; |
| | | int colOffset = targetRange.Start.Column - sourceRange.Start.Column; |
| | | var targetMergeRange = worksheet.Cells[ |
| | | mergeRange.Start.Row + rowOffset, |
| | | mergeRange.Start.Column + colOffset, |
| | | mergeRange.End.Row + rowOffset, |
| | | mergeRange.End.Column + colOffset |
| | | ]; |
| | | targetMergeRange.Merge = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | rboolLocation4ScanStart, |
| | | /// <summary> |
| | | /// å·¥ä½2ç©æä¿¡æ¯ç¡®è®¤å¯å¨ |
| | | /// </summary> |
| | | rboolLocation5ScanStart, |
| | | /// <summary> |
| | | /// åè£
宿åä¿¡æ¯ä¸ä¼ å¯å¨ |
| | | /// </summary> |
| | | rboolLocation6ScanStart, |
| | | /// <summary> |
| | | /// æ£æµå®æåä¿¡æ¯ä¸ä¼ å¯å¨ |
| | | /// </summary> |
| | | rboolLocation7ScanStart, |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸åæ£æµé«åº¦ |
| | | /// </summary> |
| | | rrealDetectPressHeight, |
| | |
| | | /// </summary> |
| | | rrealDetectScrewAngle, |
| | | /// <summary> |
| | | /// åè£
ä½ä¸ååå |
| | | /// </summary> |
| | | rrealDetectPressForce, |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_byæ§ç´§NG |
| | | /// </summary> |
| | | rrealPressScrewByScrewNG, |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_byæ§ç´§OK |
| | | /// </summary> |
| | | rrealPressScrewByScrewOK, |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_byæ¬æ¬¡å å·¥æªå®æ |
| | | /// </summary> |
| | | rrealPressScrewByProcessUnfinished, |
| | | /// <summary> |
| | | /// æ£æµ_byæ¬æ¬¡æ£æµæªå®æ |
| | | /// </summary> |
| | | rrealDetectByInspectUnfinished, |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦1 |
| | | /// </summary> |
| | | rrealDetectHeight1, |
| | |
| | | /// æ§ç´§ä½æ£æµé«åº¦3 |
| | | /// </summary> |
| | | rrealDetectHeight3, |
| | | |
| | | /// <summary> |
| | | /// åè£
使çç ä¿å |
| | | /// </summary> |
| | | rrealPressPalletCode, |
| | | /// <summary> |
| | | /// æ£æµä½æçç ä¿å |
| | | /// </summary> |
| | | rrealCheckPalletCode, |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | wboolLocation4ScanDone, |
| | | /// <summary> |
| | | /// å·¥ä½2ç©æä¿¡æ¯ç¡®è®¤å®æ |
| | | /// </summary> |
| | | wboolLocation5ScanDone, |
| | | /// <summary> |
| | | /// åè£
宿åä¿¡æ¯ä¸ä¼ 宿 |
| | | /// </summary> |
| | | wboolLocation6ScanDone, |
| | | /// <summary> |
| | | /// æ£æµå®æåä¿¡æ¯ä¸ä¼ 宿 |
| | | /// </summary> |
| | | wboolLocation7ScanDone, |
| | | /// <summary> |
| | | /// åè£
ä½ä¸æ§ç´§ |
| | | /// </summary> |
| | | wboolLocation8ScanDone, |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½äº§åé¿åº¦ |
| | | /// </summary> |
| | | wrealProductLength, |
| | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æå |
| | | /// </summary> |
| | | wrealScrewTorqueOutput, |
| | | wrealScrewTorque, |
| | | /// <summary> |
| | | /// åè£
ä½èªå¨æ§ç´§æå¼ |
| | | /// åè£
ä½èªå¨æ§ç´§ç¨åºå· |
| | | /// </summary> |
| | | wDintAutoScrewOn, |
| | | wrealAutoScrewProgramNo, |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»1 |
| | | /// P0P2宽度 |
| | | /// </summary> |
| | | wrealXDirectionDistance1, |
| | | wrealP0P2Width, |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦1 |
| | | /// P0P3宽度 |
| | | /// </summary> |
| | | wrealYDirectionHeight1, |
| | | wrealP0P3Width, |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»2 |
| | | /// P1P3é«åº¦ |
| | | /// </summary> |
| | | wrealXDirectionDistance2, |
| | | wrealP1P3Height, |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦2 |
| | | /// P2P3é«åº¦ |
| | | /// </summary> |
| | | wrealYDirectionHeight2, |
| | | wrealP2P3Height, |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»3 |
| | | /// P0P1宽度 |
| | | /// </summary> |
| | | wrealXDirectionDistance3, |
| | | wrealP0P1Width, |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦3 |
| | | /// åè£
使çç |
| | | /// </summary> |
| | | wrealYDirectionHeight3 |
| | | wrealPressPalletCode, |
| | | /// <summary> |
| | | /// æ£æµä½æçç |
| | | /// </summary> |
| | | wrealCheckPalletCode, |
| | | |
| | | } |
| | | } |
| ÎļþÃû´Ó ´úÂë¹ÜÀí/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketClient.cs ÐÞ¸Ä |
| | |
| | | using System.Net.Sockets; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_DTO.System; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | namespace WIDESEAWCS_Common |
| | | { |
| | | public class TcpClientExample |
| | | { |
| | |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="Spire.XLS"> |
| | | <HintPath>..\WIDESEAWCS_BasicInfoService\Spire.XLS.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | { |
| | | public class ToolingBoardSubmitDto |
| | | { |
| | | /// <summary> |
| | | /// å·¥è£
æ¿ç¼å· (å¿
å¡«) |
| | | /// </summary> |
| | | public string ToolingBoardNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåç¼å· (å¿
å¡«) |
| | |
| | | { |
| | | public IRepository<Dt_BoxingDetail> Repository { get; } |
| | | |
| | | //æ¯è¾é¶ä»¶æ¯å¦é½å
¨ |
| | | public bool IsComponentCodesEqual(List<Dt_BoxingDetail> boxingDetails, List<Dt_FormulaDetail> formulaDetails); |
| | | public bool CheckComponentsMatchExactly(List<string> boxingDetails, List<string> formulaDetails); |
| | | |
| | | //æ·»å ç»çä¿¡æ¯ |
| | | public WebResponseContent SaveToolingBoardNo(ToolingBoardSubmitDto toolingBoardSubmitDto); |
| | |
| | | { |
| | | public IRepository<Dt_ProcessInfo> Repository { get; } |
| | | |
| | | // ä¸è½½æµç¨å¡ |
| | | public WebResponseContent ExportData(Dt_ProcessInfo dt_ProcessInfo); |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using OfficeOpenXml; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | public WebResponseContent GetLeftInitialData(); |
| | | //æ´æ°æ«ç ç¶æ |
| | | public WebResponseContent UpdatePartScannedStatus(UpdatePartScannedStatusRequest updatePartScannedStatusRequest); |
| | | |
| | | // ä¸è½½æµç¨å¡ |
| | | public WebResponseContent ExportData(Dt_ScanStation dt_ScanStation); |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// æåç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æåç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æåç¼å·")] |
| | | public string ProductCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æååç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æååç§°")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æååç§°")] |
| | | public string ProductName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµæ°´å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æµæ°´å·")] |
| | | public string BoxingNo { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)]//ä¸å䏿°æ®åºæ å°ï¼æµè¯ä½¿ç¨ |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_BoxingDetail.BoxingId), nameof(Id))] |
| | | public List<Dt_BoxingDetail> Details { get; set; } |
| | |
| | | /// <summary> |
| | | /// åè£
ä½äº§åé¿åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits =2, ColumnDescription = "åè£
ä½äº§åé¿åº¦")] |
| | | public decimal ProductLength { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½äº§åé¿åº¦")] |
| | | public decimal? ProductLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½äº§å宽度 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½äº§å宽度")] |
| | | public decimal ProductWidth { get; set; } |
| | | public decimal? ProductWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½äº§åé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½äº§åé«åº¦")] |
| | | public decimal ProductHeight { get; set; } |
| | | public decimal? ProductHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸æ§ç´§ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
ä½ä¸æ§ç´§")] |
| | | public int? PressNoTighten { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§ä¸éé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§ä¸éé«åº¦")] |
| | | public decimal ScrewDownsetDistance { get; set; } |
| | | public decimal? ScrewDownsetDistance { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æå")] |
| | | public decimal ScrewTorqueOutput { get; set; } |
| | | public decimal? ScrewTorqueOutput { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½èªå¨æ§ç´§æå¼ |
| | | /// åè£
ä½èªå¨æ§ç´§ç¨åºå· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½èªå¨æ§ç´§æå¼")] |
| | | public int DintAutoScrewOn { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
ä½èªå¨æ§ç´§ç¨åºå·")] |
| | | public int? DintAutoScrewOn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»1 |
| | | /// åè£
ä½ç´§åºæç© |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»1")] |
| | | public decimal XDirectionDistance1 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½ç´§åºæç©", DefaultValue = "0.00")] |
| | | public decimal? PressFastenTorque { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦1 |
| | | /// P0P1宽度 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Zé«åº¦1")] |
| | | public decimal YDirectionHeight1 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "P0P1宽度")] |
| | | public decimal? P0P1Width { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»2 |
| | | /// P0P2宽度 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»2")] |
| | | public decimal XDirectionDistance2 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "P0P2宽度")] |
| | | public decimal? P0P2Width { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦2 |
| | | /// P0P3宽度 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Zé«åº¦2")] |
| | | public decimal YDirectionHeight2 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "P0P3宽度")] |
| | | public decimal? P0P3Width { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»3 |
| | | /// P1P3é«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»3")] |
| | | public decimal XDirectionDistance3 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "P1P3é«åº¦")] |
| | | public decimal? P1P3Height { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦3 |
| | | /// P2P3é«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Zé«åº¦3")] |
| | | public decimal YDirectionHeight3 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "P2P3é«åº¦")] |
| | | public decimal? P2P3Height { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åå¾çè·¯å¾ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "产åå¾çè·¯å¾")] |
| | | public string ProductImagePath { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)]//ä¸å䏿°æ®åºæ å°ï¼æµè¯ä½¿ç¨ |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_FormulaDetail.FormulaId), nameof(Id))] |
| | | public List<Dt_FormulaDetail> Details { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// é¶ä»¶ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "é¶ä»¶ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶ç¼å·")] |
| | | public string ComponentCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶åç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "é¶ä»¶åç§°")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶åç§°")] |
| | | public string ComponentName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 便¹ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "便¹ä»£ç ")] |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ«ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "æ¯å¦æ«ç ")] |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "æ¯å¦æ«ç ")] |
| | | public int IsScanned { get; set; } |
| | | |
| | | |
| | |
| | | public string ProductName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµæ°´å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "æµæ°´å·")] |
| | | public string ProductSn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_æ§ç´§NG |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
æ§ç´§_æ§ç´§NG")] |
| | | public int? PressTightenNg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_æ§ç´§OK |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
æ§ç´§_æ§ç´§OK")] |
| | | public int? PressTightenOk { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_æ¬æ¬¡å å·¥æªå®æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
æ§ç´§_æ¬æ¬¡å å·¥æªå®æ")] |
| | | public int? PressTightenUnfinished { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµ_æ¬æ¬¡æ£æµæªå®æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "æ£æµ_æ¬æ¬¡æ£æµæªå®æ")] |
| | | public int? CheckUnfinished { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "é¶ä»¶æ°é")] |
| | | public int ComponentQty { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "é¶ä»¶æ°é")] |
| | | public int? ComponentQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåå¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æåå¼")] |
| | | public decimal TorsioValue { get; set; } |
| | | public decimal? TorsioValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå弿 å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æå弿 å")] |
| | | public decimal TorsioValueStandard { get; set; } |
| | | public decimal? TorsioValueStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº¦å¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "å度å¼")] |
| | | public decimal StiffnessValue { get; set; } |
| | | public decimal? StiffnessValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº¦å¼æ å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "ååº¦å¼æ å")] |
| | | public decimal StiffnessValueStandard { get; set; } |
| | | public decimal? StiffnessValueStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµè¯ç»æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æµè¯ç»æ")] |
| | | public int TestResult { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æµè¯ç»æ")] |
| | | public int? TestResult { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸åæ£æµé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½ä¸åæ£æµé«åº¦")] |
| | | public decimal PressHeight { get; set; } |
| | | public decimal? PressHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æ£æµæå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æ£æµæå")] |
| | | public decimal ScrewTorque { get; set; } |
| | | public decimal? ScrewTorque { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æ£æµè§åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æ£æµè§åº¦")] |
| | | public decimal ScrewAngle { get; set; } |
| | | public decimal? ScrewAngle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸ååå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½ä¸ååå")] |
| | | public decimal? PressPressure { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦1 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦1")] |
| | | public decimal Height1 { get; set; } |
| | | public decimal? Height1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦2 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦2")] |
| | | public decimal Height2 { get; set; } |
| | | public decimal? Height2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦3 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦3")] |
| | | public decimal Height3 { get; set; } |
| | | public decimal? Height3 { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æååç§°")] |
| | | public string ProductName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµæ°´å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "æµæ°´å·")] |
| | | public string ProductSn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_æ§ç´§NG |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
æ§ç´§_æ§ç´§NG")] |
| | | public int? PressTightenNg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_æ§ç´§OK |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
æ§ç´§_æ§ç´§OK")] |
| | | public int? PressTightenOk { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
æ§ç´§_æ¬æ¬¡å å·¥æªå®æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "åè£
æ§ç´§_æ¬æ¬¡å å·¥æªå®æ")] |
| | | public int? PressTightenUnfinished { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµ_æ¬æ¬¡æ£æµæªå®æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "æ£æµ_æ¬æ¬¡æ£æµæªå®æ")] |
| | | public int? CheckUnfinished { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "é¶ä»¶æ°é")] |
| | | public int? ComponentQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåå¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æåå¼")] |
| | | public decimal? TorsioValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå弿 å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æå弿 å")] |
| | | public decimal? TorsioValueStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº¦å¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "å度å¼")] |
| | | public decimal? StiffnessValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº¦å¼æ å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "ååº¦å¼æ å")] |
| | | public decimal? StiffnessValueStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµè¯ç»æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æµè¯ç»æ")] |
| | | public int? TestResult { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸åæ£æµé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½ä¸åæ£æµé«åº¦")] |
| | | public decimal? PressHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æ£æµæå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æ£æµæå")] |
| | | public decimal? ScrewTorque { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æ£æµè§åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æ£æµè§åº¦")] |
| | | public decimal? ScrewAngle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸ååå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½ä¸ååå")] |
| | | public decimal? PressPressure { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦1 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦1")] |
| | | public decimal? Height1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦2 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦2")] |
| | | public decimal? Height2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦3 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦3")] |
| | | public decimal? Height3 { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | public string StationEndProduct { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶æ°é |
| | | /// ç»è£
人å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "é¶ä»¶æ°é")] |
| | | public int StationComponentQty { get; set; } |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç»è£
人å")] |
| | | public string AssembleUser { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶1 |
| | | /// é¦ä»¶æµæ°´å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶1")] |
| | | public string StationComponent1 { get; set; } |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "é¦ä»¶æµæ°´å·")] |
| | | public string FirstProductSn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶2 |
| | | /// æ«ä»¶æµæ°´å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶2")] |
| | | public string StationComponent2 { get; set; } |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "æ«ä»¶æµæ°´å·")] |
| | | public string LastProductSn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶3 |
| | | /// æ¯å¦æ«ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶3")] |
| | | public string StationComponent3 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶4 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶4")] |
| | | public string StationComponent4 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶5 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶5")] |
| | | public string StationComponent5 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶6 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶6")] |
| | | public string StationComponent6 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶7 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶7")] |
| | | public string StationComponent7 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶8 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶8")] |
| | | public string StationComponent8 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶9 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶9")] |
| | | public string StationComponent9 { get; set; } |
| | | /// <summary> |
| | | /// é¶ä»¶10 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶10")] |
| | | public string StationComponent10 { get; set; } |
| | | [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "æ¯å¦æ«ç ")] |
| | | public int IsScanned { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// é¶ä»¶æ°é |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, ColumnDescription = "é¶ä»¶æ°é")] |
| | | //public int StationComponentQty { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// é¶ä»¶1 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶1")] |
| | | //public string StationComponent1 { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// é¶ä»¶2 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶2")] |
| | | //public string StationComponent2 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶3 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶3")] |
| | | //public string StationComponent3 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶4 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶4")] |
| | | //public string StationComponent4 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶5 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶5")] |
| | | //public string StationComponent5 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶6 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶6")] |
| | | //public string StationComponent6 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶7 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶7")] |
| | | //public string StationComponent7 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶8 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶8")] |
| | | //public string StationComponent8 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶9 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶9")] |
| | | //public string StationComponent9 { get; set; } |
| | | ///// <summary> |
| | | ///// é¶ä»¶10 |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "é¶ä»¶10")] |
| | | //public string StationComponent10 { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¸è½½æµç¨å¡ |
| | | /// </summary> |
| | | /// <param name="dt_ProcessInfo"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ExportData"), AllowAnonymous] |
| | | public WebResponseContent ExportData([FromBody] Dt_ProcessInfo dt_ProcessInfo) |
| | | { |
| | | return Service.ExportData(dt_ProcessInfo); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | return Service.UpdatePartScannedStatus(updatePartScannedStatusRequest); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸è½½æµç¨å¡ |
| | | /// </summary> |
| | | /// <param name="dt_ProcessInfo"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ExportData"), AllowAnonymous] |
| | | public WebResponseContent ExportData([FromBody] Dt_ScanStation dt_ScanStation) |
| | | { |
| | | return Service.ExportData(dt_ScanStation); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_TaskInfoService")] |
| | | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] |
| | | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] |
| | | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2eea48595c784d1d6d58d526f1da12427dfa0a25")] |
| | | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ba8aa925e7901381ceb394adb53eca8723d1c4c5")] |
| | | [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfoService")] |
| | | [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfoService")] |
| | | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] |
| | |
| | | c9c87e496556920f27ef09770ceb3d9cdc2a9b9b20ce0dfcd54bba65b5fd5b5e |
| | | c6989e39d044e493a5b0c470e8b5c9f7045d0148725be4e9d86c645b9e91d362 |
| | |
| | | using System.Text;
|
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
|
| | | using Quartz;
|
| | | using System.Linq;
|
| | | using System.Text;
|
| | | using WIDESEAWCS_BasicInfoService;
|
| | | using WIDESEAWCS_Common;
|
| | | using WIDESEAWCS_Common.PLCEnum;
|
| | | using WIDESEAWCS_Communicator;
|
| | | using WIDESEAWCS_Core;
|
| | | using WIDESEAWCS_Core.BaseRepository;
|
| | | using WIDESEAWCS_Core.Helper;
|
| | | using WIDESEAWCS_DTO.BasicInfo;
|
| | | using WIDESEAWCS_IBasicInfoService;
|
| | | using WIDESEAWCS_Model.Models;
|
| | | using WIDESEAWCS_QuartzJob;
|
| | |
| | | }
|
| | | public Task Execute(IJobExecutionContext context)
|
| | | {
|
| | | |
| | |
|
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
|
| | | if (flag && value != null)
|
| | | {
|
| | |
| | | OtherDevice device = (OtherDevice)value;
|
| | | try
|
| | | {
|
| | |
|
| | | if (!device.IsConnected) throw new Exception(device.DeviceName + "è¿æ¥å¤±è´¥");
|
| | | var Heart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolHeart);
|
| | | var EMG = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolEMG);
|
| | | var AutoExecuting = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolAutoExecuting);
|
| | | var OnlineExecuting = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolOnlineExecuting);
|
| | | var Error = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolError);
|
| | |
|
| | | if (Heart && !EMG && AutoExecuting && OnlineExecuting && !Error)
|
| | | if (/*Heart &&*/ !EMG && AutoExecuting && OnlineExecuting && !Error)
|
| | | {
|
| | | #region ä¸çº¿æ«ç
|
| | | HandleOnlineScan(device);
|
| | | #endregion
|
| | | //#region é¶ä»¶æ£æµ
|
| | | //HandlePartDetection(device);
|
| | | //#endregion
|
| | |
|
| | | //#region ä¸çº¿æ«ç
|
| | | //HandleOnlineScan(device);
|
| | | //#endregion
|
| | |
|
| | | #region åè£
æ«ç
|
| | | HandlePressScan(device);
|
| | | #endregion
|
| | |
|
| | | #region åè£
ä¿¡æ¯ä¸ä¼
|
| | | HandlePressInfoUpload(device);
|
| | | #endregion
|
| | |
|
| | | #region æ£æµæ«ç
|
| | | HandleDetectScan(device);
|
| | | #endregion
|
| | |
|
| | | #region æ£æµä¿¡æ¯ä¸ä¼
|
| | | HandleDetectInfoUpload(device);
|
| | | #endregion
|
| | |
|
| | | #region ä¸çº¿æ«ç
|
| | | HandleOfflineScan(device);
|
| | |
|
| | | #endregion
|
| | | }
|
| | |
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | return Task.CompletedTask;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// é¶ä»¶æ£æµ
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | /// <exception cref="InvalidOperationException"></exception>
|
| | | private void HandlePartDetection(OtherDevice device)
|
| | | {
|
| | | //DB800.1.4
|
| | | var Location5ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation5ScanStart);
|
| | | var Location5ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation5ScanDone);
|
| | | if (Location5ScanStart && !Location5ScanDone)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (_scanStationService.Repository.QueryFirst(x => x.StationCode == "001").IsScanned == 0)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, true);
|
| | | return;
|
| | | }
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryData(x => true, 1, "Id desc").FirstOrDefault();
|
| | | if (dt_Boxing == null)
|
| | | {
|
| | | throw new InvalidOperationException("æ ç»çæ°æ®");
|
| | | }
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | | if (dt_Formula == null)
|
| | | {
|
| | | throw new InvalidOperationException("æ æåé
æ¹");
|
| | | }
|
| | | List<Dt_BoxingDetail> dt_BoxingDetails = _boxingDetailService.Repository.QueryData(x => x.BoxingId == dt_Boxing.Id);
|
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == dt_Formula.Id && x.IsScanned == 1);
|
| | | if (!_boxingDetailService.CheckComponentsMatchExactly(dt_BoxingDetails.Select(x => x.ComponentCode).ToList(), dt_FormulaDetails.Select(x => x.ComponentCode).ToList()))
|
| | | {
|
| | | throw new InvalidOperationException("é¶ä»¶ä¸é
æ¹è¡¨ä¸ä¸å");
|
| | | }
|
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, true);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "æ£æµé¶ä»¶æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location5ScanStart && Location5ScanDone)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, false);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// ä¸çº¿æ«ç
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | private void HandleOnlineScan(OtherDevice device)
|
| | | {
|
| | | var Location1ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation1ScanStart);
|
| | | var Location1ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation1ScanDone);
|
| | | if (Location1ScanStart && !Location1ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢ç»çæ°æ®ï¼å¤ææçç»å®æåæ¯å¦å·²ç»å®æææéé¶ä»¶
|
| | | //DB800.1.4
|
| | | var Location5ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation5ScanStart);
|
| | | var Location5ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation5ScanDone);
|
| | | if (Location5ScanStart && !Location5ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢ç»çæ°æ®ï¼å¤ææçç»å®æåæ¯å¦å·²ç»å®æææéé¶ä»¶
|
| | | {
|
| | | Dt_Boxing dt_Boxing1 = _boxingService.Repository.QueryData(x => true, 1, "Id desc").FirstOrDefault();
|
| | | if (dt_Boxing1 != null && dt_Boxing1.ProductCode == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //var PalletCode = "PL111";
|
| | | var PalletCode = TcpClientExample.Start("192.168.2.120", 2001);
|
| | | try
|
| | | {
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | if (!PalletCode.IsNotEmptyOrNull() || PalletCode == "NoRead")
|
| | | {
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | var boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (boxing == null)
|
| | |
|
| | | if (_boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode && x.ProductCode != null) != null)
|
| | | {
|
| | | throw new InvalidOperationException("æªæ·»å ç»çä¿¡æ¯");
|
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, true);
|
| | | throw new InvalidOperationException("æç以åå¨");
|
| | | }
|
| | | List<Dt_BoxingDetail> dt_BoxingDetails = _boxingDetailService.Repository.QueryData(x => x.BoxingId == boxing.Id);
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == boxing.ProductCode);
|
| | | if (dt_Formula == null)
|
| | | {
|
| | | throw new InvalidOperationException("æ æåé
æ¹");
|
| | | }
|
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == dt_Formula.Id && x.IsScanned == 1);
|
| | | //æ¯è¾é¶ä»¶æ¯å¦é½å
¨
|
| | | if (!_boxingDetailService.IsComponentCodesEqual(dt_BoxingDetails, dt_FormulaDetails))
|
| | | {
|
| | | throw new InvalidOperationException("é¶ä»¶æé®é¢ï¼è¯·å¤ç");
|
| | | }
|
| | | device.SetValue(W_PLCDBName.wboolLocation1ScanDone, true);
|
| | |
|
| | | Dt_Boxing dt_Boxing = new Dt_Boxing();
|
| | | dt_Boxing.PalletCode = PalletCode;
|
| | | _boxingService.Repository.AddData(dt_Boxing);
|
| | |
|
| | |
|
| | |
|
| | | //Dt_ScanStation dt_ScanStation = _scanStationService.Repository.QueryFirst(x => x.StationCode == "001");
|
| | | //if (dt_ScanStation == null)
|
| | | //{
|
| | | // throw new InvalidOperationException("æ 工使°æ®");
|
| | | //}
|
| | | //Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_ScanStation.StationEndProduct);
|
| | |
|
| | | //if (dt_Formula == null)
|
| | | //{
|
| | | // throw new InvalidOperationException("æ æåé
æ¹");
|
| | | //}
|
| | |
|
| | | //List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == dt_Formula.Id && x.IsScanned == 1);
|
| | | //if (dt_ScanStation.IsScanned == 0)
|
| | | //{ |
| | | // Dt_Boxing dt_Boxing = new Dt_Boxing
|
| | | // {
|
| | | // PalletCode = PalletCode,
|
| | | // ProductCode = dt_Formula.ProductCode,
|
| | | // ProductName = dt_Formula.ProductName,
|
| | | // Creater = "admin",
|
| | | // CreateDate = new DateTime()
|
| | | // };
|
| | |
|
| | | // int id = _boxingService.Repository.AddData(dt_Boxing);
|
| | | // foreach (var item in dt_FormulaDetails)
|
| | | // {
|
| | | // Dt_BoxingDetail dt_BoxingDetail = new Dt_BoxingDetail()
|
| | | // {
|
| | | // BoxingId = id,
|
| | | // ComponentCode = item.ComponentCode,
|
| | | // ComponentName = item.ComponentName,
|
| | | // Creater = "admin",
|
| | | // CreateDate = new DateTime()
|
| | | // };
|
| | | // _boxingDetailService.Repository.AddData(dt_BoxingDetail);
|
| | | // }
|
| | | // device.SetValue(W_PLCDBName.wboolLocation5ScanDone, true);
|
| | | // return;
|
| | | //}
|
| | |
|
| | | //var boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | //if (boxing == null)
|
| | | //{
|
| | | // throw new InvalidOperationException("æªæ·»å ç»çä¿¡æ¯");
|
| | | //}
|
| | |
|
| | | //List<Dt_BoxingDetail> dt_BoxingDetails = _boxingDetailService.Repository.QueryData(x => x.BoxingId == boxing.Id);
|
| | |
|
| | |
|
| | | //if (!_boxingDetailService.CheckComponentsMatchExactly(dt_BoxingDetails.Select(x => x.ComponentCode).ToList(), dt_FormulaDetails.Select(x => x.ComponentCode).ToList()))
|
| | | //{
|
| | | // throw new InvalidOperationException("é¶ä»¶ä¸é
æ¹è¡¨ä¸ä¸å");
|
| | | //}
|
| | |
|
| | |
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "ä¸çº¿æ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location1ScanStart && Location1ScanDone)
|
| | | else if (!Location5ScanStart && Location5ScanDone)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation1ScanDone, false);
|
| | | device.SetValue(W_PLCDBName.wboolLocation5ScanDone, false);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// <param name="device"></param>
|
| | | private void HandlePressScan(OtherDevice device)
|
| | | {
|
| | | //DB800.1.1
|
| | | var Location2ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation2ScanStart);
|
| | | var Location2ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation2ScanDone);
|
| | | if (Location2ScanStart && !Location2ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢æçç»å®æåå å·¥æéæ°æ®ï¼åå
¥PLC
|
| | |
| | |
|
| | | try
|
| | | {
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | if (!PalletCode.IsNotEmptyOrNull() || PalletCode == "NoRead")
|
| | | {
|
| | | throw new InvalidOperationException("æç为空");
|
| | | throw new InvalidOperationException("æçå·ä¸ºç©º");
|
| | | }
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (dt_Boxing == null)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation2ScanDone, true);
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | if (dt_Boxing.ProductCode == null && dt_Boxing.BoxingNo == null)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation2ScanDone, true);
|
| | | return;
|
| | | }
|
| | |
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | | //åå
¥PLC
|
| | | device.SetValue(W_PLCDBName.wrealPressPalletCode, dt_Boxing.Id % 100);
|
| | | if(dt_Formula.PressNoTighten == 1)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation8ScanDone,true);
|
| | | }
|
| | | device.SetValue(W_PLCDBName.wrealProductLength, dt_Formula.ProductLength);
|
| | | device.SetValue(W_PLCDBName.wrealProductWidth, dt_Formula.ProductWidth);
|
| | | device.SetValue(W_PLCDBName.wrealProductHeight, dt_Formula.ProductHeight);
|
| | | device.SetValue(W_PLCDBName.wrealScrewDownsetDistance, dt_Formula.ScrewDownsetDistance);
|
| | | device.SetValue(W_PLCDBName.wrealScrewTorqueOutput, dt_Formula.ScrewTorqueOutput);
|
| | | device.SetValue(W_PLCDBName.wDintAutoScrewOn, dt_Formula.DintAutoScrewOn);
|
| | | //ä¸å¿é«åº¦
|
| | | device.SetValue(W_PLCDBName.wrealScrewTorque, dt_Formula.ScrewTorqueOutput);
|
| | | device.SetValue(W_PLCDBName.wrealAutoScrewProgramNo, dt_Formula.DintAutoScrewOn);
|
| | | //åè£
æ«ç 宿
|
| | | device.SetValue(W_PLCDBName.wboolLocation2ScanDone, true);
|
| | | //æ¥æ¶æ°æ®
|
| | | decimal PressHeight = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectPressHeight);
|
| | | decimal ScrewTorque = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectScrewTorque);
|
| | | decimal ScrewAngle = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectScrewAngle);
|
| | | //æ·»å å°æ°æ®åº
|
| | | Dt_ProcessInfo dt_ProcessInfo = new Dt_ProcessInfo()
|
| | | {
|
| | | PalletCode = PalletCode,
|
| | | ProductCode = dt_Formula.ProductCode,
|
| | | ProductName = dt_Formula.ProductName,
|
| | | PressHeight = PressHeight,
|
| | | ScrewTorque = ScrewTorque,
|
| | | ScrewAngle = ScrewAngle
|
| | | };
|
| | | _processInfoService.Repository.AddData(dt_ProcessInfo);
|
| | |
|
| | |
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// åè£
ä¿¡æ¯ä¸ä¼
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | /// <exception cref="NotImplementedException"></exception>
|
| | | private void HandlePressInfoUpload(OtherDevice device)
|
| | | {
|
| | | //DB800.1.5
|
| | | var Location6ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation6ScanStart);
|
| | | var Location6ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation6ScanDone);
|
| | | if (Location6ScanStart && !Location6ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢æçç»å®æåå å·¥æéæ°æ®ï¼åå
¥PLC
|
| | | {
|
| | |
|
| | | var PalletNum = device.GetValue<R_PLCDBName, int>(R_PLCDBName.rrealPressPalletCode);
|
| | | try
|
| | | {
|
| | | if (!PalletNum.IsNotEmptyOrNull())
|
| | | {
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.Id % 100 == PalletNum);
|
| | | if (dt_Boxing == null)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation6ScanDone, true);
|
| | | throw new InvalidOperationException("æªæ¾å°ç»çæ°æ®");
|
| | | }
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | |
|
| | |
|
| | | //æ¥æ¶æ°æ®
|
| | | decimal PressHeight = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectPressHeight);
|
| | | decimal ScrewTorque = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectScrewTorque);
|
| | | decimal ScrewAngle = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectScrewAngle);
|
| | | decimal PressPressure = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectPressForce);
|
| | | bool PressTightenNg = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rrealPressScrewByScrewNG);
|
| | | bool PressTightenOk = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rrealPressScrewByScrewOK);
|
| | | bool PressTightenUnfinished = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rrealPressScrewByProcessUnfinished);
|
| | |
|
| | | |
| | |
|
| | | //æ·»å å°æ°æ®åº
|
| | | Dt_ProcessInfo dt_ProcessInfo = new Dt_ProcessInfo()
|
| | | {
|
| | | PalletCode = dt_Boxing.PalletCode,
|
| | | ProductCode = dt_Formula.ProductCode,
|
| | | ProductName = dt_Formula.ProductName,
|
| | | ProductSn = dt_Boxing.BoxingNo,
|
| | | PressTightenNg = PressTightenNg?1:0,
|
| | | PressTightenOk = PressTightenOk?1:0,
|
| | | PressTightenUnfinished = PressTightenUnfinished?1:0,
|
| | | PressHeight = PressHeight,
|
| | | ScrewTorque = ScrewTorque,
|
| | | ScrewAngle = ScrewAngle,
|
| | | PressPressure = PressPressure,
|
| | | };
|
| | | _processInfoService.Repository.AddData(dt_ProcessInfo);
|
| | |
|
| | | // åè£
ä¿¡æ¯ä¸ä¼ 宿
|
| | | device.SetValue(W_PLCDBName.wboolLocation6ScanDone, true);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "åè£
ä¿¡æ¯ä¸ä¼ æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location6ScanStart && Location6ScanDone)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation6ScanDone, false);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// æ£æµæ«ç
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | private void HandleDetectScan(OtherDevice device)
|
| | | {
|
| | | //DB800.1.2
|
| | | var Location3ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation3ScanStart);
|
| | | var Location3ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation3ScanDone);
|
| | | if (Location3ScanStart && !Location3ScanDone)
|
| | | {
|
| | | var PalletCode = TcpClientExample.Start("192.168.2.122", 2001);
|
| | |
|
| | | try
|
| | | {
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | if (!PalletCode.IsNotEmptyOrNull() || PalletCode == "NoRead")
|
| | | {
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (dt_Boxing == null)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation3ScanDone, true);
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | if (dt_Boxing.ProductCode == null && dt_Boxing.BoxingNo == null)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation3ScanDone, true);
|
| | | return;
|
| | | }
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | | //åå
¥PLC
|
| | | device.SetValue(W_PLCDBName.wrealXDirectionDistance1, dt_Formula.XDirectionDistance1);
|
| | | device.SetValue(W_PLCDBName.wrealYDirectionHeight1, dt_Formula.YDirectionHeight1);
|
| | | device.SetValue(W_PLCDBName.wrealXDirectionDistance2, dt_Formula.XDirectionDistance2);
|
| | | device.SetValue(W_PLCDBName.wrealYDirectionHeight2, dt_Formula.YDirectionHeight2);
|
| | | device.SetValue(W_PLCDBName.wrealXDirectionDistance3, dt_Formula.XDirectionDistance3);
|
| | | device.SetValue(W_PLCDBName.wrealYDirectionHeight3, dt_Formula.YDirectionHeight3);
|
| | | device.SetValue(W_PLCDBName.wrealCheckPalletCode, dt_Boxing.Id % 100);
|
| | | device.SetValue(W_PLCDBName.wrealP0P1Width, dt_Formula.P0P1Width);
|
| | | device.SetValue(W_PLCDBName.wrealP0P2Width, dt_Formula.P0P2Width);
|
| | | device.SetValue(W_PLCDBName.wrealP0P3Width, dt_Formula.P0P3Width);
|
| | | device.SetValue(W_PLCDBName.wrealP0P3Width, dt_Formula.P0P3Width);
|
| | | device.SetValue(W_PLCDBName.wrealP1P3Height, dt_Formula.P1P3Height);
|
| | | device.SetValue(W_PLCDBName.wrealP2P3Height, dt_Formula.P2P3Height);
|
| | |
|
| | | //æ£æµæ«ç 宿
|
| | | device.SetValue(W_PLCDBName.wboolLocation3ScanDone, true);
|
| | |
|
| | | //æ¥æ¶æ°æ®
|
| | | decimal Height1 = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight1);
|
| | | decimal Height2 = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight2);
|
| | | decimal Height3 = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight3);
|
| | |
|
| | | Dt_ProcessInfo dt_ProcessInfo = _processInfoService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (dt_ProcessInfo == null)
|
| | | {
|
| | | throw new InvalidOperationException("æåæªåè£
");
|
| | | }
|
| | | dt_ProcessInfo.Height1 = Height1;
|
| | | dt_ProcessInfo.Height2 = Height2;
|
| | | dt_ProcessInfo.Height3 = Height3;
|
| | | _processInfoService.Repository.UpdateData(dt_ProcessInfo);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// æ£æµä¿¡æ¯ä¸ä¼
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | /// <exception cref="NotImplementedException"></exception>
|
| | | private void HandleDetectInfoUpload(OtherDevice device)
|
| | | {
|
| | |
|
| | | //DB800.1.6
|
| | | var Location7ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation7ScanStart);
|
| | | var Location7ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation7ScanDone);
|
| | | if (Location7ScanStart && !Location7ScanDone)
|
| | | {
|
| | | var PalletNum = device.GetValue<R_PLCDBName, int>(R_PLCDBName.rrealCheckPalletCode);
|
| | |
|
| | | try
|
| | | {
|
| | | if (!PalletNum.IsNotEmptyOrNull())
|
| | | {
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.Id % 100 == PalletNum);
|
| | |
|
| | | if (dt_Boxing == null)
|
| | | {
|
| | | throw new InvalidOperationException("æªæ¾å°ç»çæ°æ®");
|
| | | }
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | |
|
| | | //æ¥æ¶æ°æ®
|
| | | decimal Height1 = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight1);//113
|
| | | decimal Height2 = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight2);//92
|
| | | decimal Height3 = (decimal)device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight3);//11
|
| | | bool CheckUnfinished = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rrealDetectByInspectUnfinished);
|
| | |
|
| | | Dt_ProcessInfo dt_ProcessInfo = _processInfoService.Repository.QueryFirst(x => x.PalletCode == dt_Boxing.PalletCode);
|
| | | int id = 0;
|
| | | if (dt_ProcessInfo == null)
|
| | | {
|
| | | dt_ProcessInfo = new Dt_ProcessInfo()
|
| | | {
|
| | | PalletCode = dt_Boxing.PalletCode,
|
| | | ProductCode = dt_Formula.ProductCode,
|
| | | ProductName = dt_Formula.ProductName,
|
| | | ProductSn = dt_Boxing.BoxingNo,
|
| | | CheckUnfinished = CheckUnfinished?1:0,
|
| | | };
|
| | | id = _processInfoService.Repository.AddData(dt_ProcessInfo);
|
| | | }
|
| | | else
|
| | | {
|
| | | id = dt_ProcessInfo.Id;
|
| | | }
|
| | | dt_ProcessInfo.Id = id;
|
| | | dt_ProcessInfo.Height1 = Height1 = Height1 - Height3;
|
| | | dt_ProcessInfo.Height2 = Height2 = Height2 - Height3;
|
| | | dt_ProcessInfo.Height3 = Height3;
|
| | |
|
| | | _processInfoService.Repository.UpdateData(dt_ProcessInfo);
|
| | | //æ£æµä¿¡æ¯ä¸ä¼ 宿
|
| | | device.SetValue(W_PLCDBName.wboolLocation7ScanDone, true);
|
| | |
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "æ£æµæ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location7ScanStart && Location7ScanDone)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation7ScanDone, false);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// ä¸çº¿æ«ç
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | private void HandleOfflineScan(OtherDevice device)
|
| | | {
|
| | | //DB800.1.3
|
| | |
|
| | | var Location4ScanStart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolLocation4ScanStart);
|
| | | var Location4ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation4ScanDone);
|
| | | if (Location4ScanStart && !Location4ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢ç»çæ°æ®ï¼å¤ææçç»å®æåæ¯å¦å·²ç»å®æææéé¶ä»¶
|
| | |
| | | {
|
| | | try
|
| | | {
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | if (!PalletCode.IsNotEmptyOrNull() || PalletCode == "NoRead")
|
| | | {
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | Dt_ProcessInfo dt_ProcessInfo = _processInfoService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (dt_ProcessInfo == null)
|
| | | {
|
| | | throw new InvalidOperationException("æåæªåè£
忣æµ");
|
| | | }
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | _boxingService.Repository.DeleteData(dt_Boxing);
|
| | | List<Dt_BoxingDetail> dt_BoxingDetails = _boxingDetailService.Repository.QueryData(x => x.BoxingId == dt_Boxing.Id);
|
| | | _boxingDetailService.Repository.DeleteData(dt_BoxingDetails);
|
| | |
|
| | | Dt_ProcessInfoDetail dt_ProcessInfoDetail = new Dt_ProcessInfoDetail()
|
| | | if (dt_Boxing != null)
|
| | | {
|
| | | PalletCode = PalletCode,
|
| | | ProductCode = dt_ProcessInfo.ProductCode,
|
| | | ProductName = dt_ProcessInfo.ProductName,
|
| | | Creater = "admin",
|
| | | CreateDate = DateTime.Now
|
| | | };
|
| | | _processDetailInfoService.Repository.AddData(dt_ProcessInfoDetail);
|
| | | _processInfoService.DeleteData(dt_ProcessInfo);
|
| | | _boxingService.Repository.DeleteData(dt_Boxing);
|
| | | List<Dt_BoxingDetail> dt_BoxingDetails = _boxingDetailService.Repository.QueryData(x => x.BoxingId == dt_Boxing.Id);
|
| | | if (dt_BoxingDetails != null)
|
| | | {
|
| | | _boxingDetailService.Repository.DeleteData(dt_BoxingDetails);
|
| | | }
|
| | | }
|
| | | Dt_ProcessInfo dt_ProcessInfo = _processInfoService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (dt_ProcessInfo != null)
|
| | | {
|
| | | Dt_ProcessInfoDetail dt_ProcessInfoDetail = new Dt_ProcessInfoDetail()
|
| | | {
|
| | | PalletCode = PalletCode,
|
| | | ProductCode = dt_ProcessInfo.ProductCode?.ToString() ?? "",
|
| | | ProductName = dt_ProcessInfo.ProductName?.ToString() ?? "",
|
| | | ProductSn = dt_ProcessInfo.ProductSn,
|
| | | PressTightenNg = dt_ProcessInfo.PressTightenNg,
|
| | | PressTightenOk = dt_ProcessInfo.PressTightenOk,
|
| | | PressTightenUnfinished = dt_ProcessInfo.PressTightenUnfinished,
|
| | | CheckUnfinished = dt_ProcessInfo.CheckUnfinished,
|
| | | PressHeight = dt_ProcessInfo.PressHeight,
|
| | | ScrewTorque = dt_ProcessInfo.ScrewTorque,
|
| | | ScrewAngle = dt_ProcessInfo.ScrewAngle,
|
| | | PressPressure = dt_ProcessInfo.PressPressure,
|
| | | Height1 = dt_ProcessInfo.Height1,
|
| | | Height2 = dt_ProcessInfo.Height2,
|
| | | Height3 = dt_ProcessInfo.Height3,
|
| | | Creater = "admin",
|
| | | CreateDate = DateTime.Now
|
| | | };
|
| | | _processDetailInfoService.Repository.AddData(dt_ProcessInfoDetail);
|
| | | _processInfoService.DeleteData(dt_ProcessInfo);
|
| | | }
|
| | | uow.Commit();
|
| | | //ä¸çº¿æ«ç 宿
|
| | | device.SetValue(W_PLCDBName.wboolLocation4ScanDone, true);
|
| | |
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "ä¸çº¿æ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (!Location4ScanStart && Location4ScanDone)
|
| | | {
|
| | | device.SetValue(W_PLCDBName.wboolLocation2ScanDone, false);
|
| | | device.SetValue(W_PLCDBName.wboolLocation4ScanDone, false);
|
| | | }
|
| | | }
|
| | | }
|