已添加17个文件
已重命名2个文件
已删除15个文件
已修改44个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "ExpandedNodes": [ |
| | | "" |
| | | ], |
| | | "SelectedNode": "\\WIDESEAWCS_Server.sln", |
| | | "PreviewInSolutionExplorer": false |
| | | } |
| | |
| | | } |
| | | |
| | | else if (process.env.NODE_ENV == 'production') { |
| | | axios.defaults.baseURL = 'http://127.0.0.1:8098/'; |
| | | axios.defaults.baseURL = 'http://192.168.2.110:8098/'; |
| | | } |
| | | if (!axios.defaults.baseURL.endsWith('/')) { |
| | | axios.defaults.baseURL+="/"; |
| | |
| | | ></form-expand> |
| | | <!-- 2021.10.17å¢å 表å宿¶æ¹æ³è®¡ç® --> |
| | | <span |
| | | v-else-if=" |
| | | item.readonly && typeof formFields[item.field] == 'function' |
| | | " |
| | | v-else-if="item.readonly && typeof formFields[item.field] == 'function'" |
| | | >{{ formFields[item.field]() }}</span |
| | | > |
| | | <!-- åªè¯»å¾çææä»¶ --> |
| | |
| | | node-key="key" |
| | | :props="{ label: 'label' }" |
| | | > |
| | | <template #default="{data,node }"> |
| | | <template #default="{ data, node }"> |
| | | <!-- <el-checkbox v-model="node.checked"></el-checkbox> --> |
| | | <!-- {{getNode(node, data)}} --> |
| | | <!-- {{node.checked}} --> |
| | | <!-- è¿éè¿æç¹é®é¢ï¼åé¢å¤ç --> |
| | | {{ data.label}}</template |
| | | <!-- {{getNode(node, data)}} --> |
| | | <!-- {{node.checked}} --> |
| | | <!-- è¿éè¿æç¹é®é¢ï¼åé¢å¤ç --> |
| | | {{ data.label }}</template |
| | | > |
| | | </el-tree-select> |
| | | <template |
| | | v-else-if="['select', 'selectList'].indexOf(item.type) != -1" |
| | | > |
| | | <template v-else-if="['select', 'selectList'].indexOf(item.type) != -1"> |
| | | <el-select-v2 |
| | | :disabled="item.readonly || item.disabled" |
| | | v-show="!item.hidden" |
| | |
| | | <div |
| | | class="v-date-range" |
| | | style="display: flex" |
| | | v-else-if=" |
| | | ['date', 'datetime'].indexOf(item.type) != -1 && item.range |
| | | " |
| | | v-else-if="['date', 'datetime'].indexOf(item.type) != -1 && item.range" |
| | | > |
| | | <el-date-picker |
| | | :size="size" |
| | |
| | | :value-format="getDateFormat(item)" |
| | | > |
| | | </el-date-picker> |
| | | <span style="margin: 0px 5px; font-size: 13px; color: #6f6b6b" |
| | | >è³</span |
| | | > |
| | | <span style="margin: 0px 5px; font-size: 13px; color: #6f6b6b">è³</span> |
| | | <el-date-picker |
| | | :size="size" |
| | | :disabled="item.readonly || item.disabled" |
| | |
| | | v-model="formFields[item.field]" |
| | | @change="item.onChange" |
| | | :type="item.type" |
| | | :placeholder=" |
| | | item.placeholder ? item.placeholder : 'è¯·éæ©' + item.title |
| | | " |
| | | :placeholder="item.placeholder ? item.placeholder : 'è¯·éæ©' + item.title" |
| | | :disabledDate="(val) => getDateOptions(val, item)" |
| | | :value-format="getDateFormat(item)" |
| | | > |
| | |
| | | <el-scrollbar |
| | | style="border: 1px solid #c7d8db; border-radius: 5px" |
| | | :height="item.height || 150" |
| | | v-else-if=" |
| | | item.type == 'editor' && (item.readonly || item.disabled) |
| | | " |
| | | v-else-if="item.type == 'editor' && (item.readonly || item.disabled)" |
| | | > |
| | | <div ref="editor" v-html="formFields[item.field]"></div> |
| | | </el-scrollbar> |
| | |
| | | v-else-if="item.type == 'cascader'" |
| | | :options="item.data" |
| | | :props="{ |
| | | checkStrictly: item.changeOnSelect || item.checkStrictly |
| | | checkStrictly: item.changeOnSelect || item.checkStrictly, |
| | | }" |
| | | @change="item.onChange" |
| | | > |
| | |
| | | :max="item.max" |
| | | v-model="formFields[item.field]" |
| | | /> |
| | | <div |
| | | style="display: flex" |
| | | v-else-if="item.type == 'range' || item.range" |
| | | > |
| | | <div style="display: flex" v-else-if="item.type == 'range' || item.range"> |
| | | <el-input |
| | | :size="size" |
| | | :disabled="item.readonly || item.disabled" |
| | |
| | | type="textarea" |
| | | :autosize="{ |
| | | minRows: item.minRows || 2, |
| | | maxRows: item.maxRows || 10 |
| | | maxRows: item.maxRows || 10, |
| | | }" |
| | | :placeholder="item.placeholder ? item.placeholder : item.title" |
| | | /> |
| | |
| | | </template> |
| | | <script> |
| | | const rule = { |
| | | change: [ |
| | | 'checkbox', |
| | | 'select', |
| | | 'date', |
| | | 'datetime', |
| | | 'drop', |
| | | 'radio', |
| | | 'cascader' |
| | | ], // 2020.05.31å¢å 级èç±»å |
| | | change: ["checkbox", "select", "date", "datetime", "drop", "radio", "cascader"], // 2020.05.31å¢å 级èç±»å |
| | | phone: /^[1][3,4,5,6,7,8,9][0-9]{9}$/, |
| | | decimal: /(^[\-0-9][0-9]*(.[0-9]+)?)$/, |
| | | number: /(^[\-0-9][0-9]*([0-9]+)?)$/ |
| | | number: /(^[\-0-9][0-9]*([0-9]+)?)$/, |
| | | }; |
| | | const inputTypeArr = ['text', 'string', 'mail', 'textarea', 'password']; |
| | | const inputTypeArr = ["text", "string", "mail", "textarea", "password"]; |
| | | const types = { |
| | | int: 'number', |
| | | byte: 'number', |
| | | decimal: 'number', // "float", |
| | | string: 'string', |
| | | bool: 'boolean', |
| | | date: 'datetime', |
| | | date: 'date', |
| | | mail: 'email' |
| | | int: "number", |
| | | byte: "number", |
| | | decimal: "number", // "float", |
| | | string: "string", |
| | | bool: "boolean", |
| | | date: "datetime", |
| | | date: "date", |
| | | mail: "email", |
| | | }; |
| | | //表åéªè¯æ³¨æï¼æ¯æ¬¡éªè¯é½å¿
é¡»æ§è¡callback,å¦åéªè¯ä¸æ§è¡åè°æ¹æ³ |
| | | const colPow = Math.pow(10, 3); |
| | | import FormExpand from './VolForm/VolFormRender'; |
| | | import FormExpand from "./VolForm/VolFormRender"; |
| | | import { |
| | | defineAsyncComponent, |
| | | defineComponent, |
| | |
| | | toRefs, |
| | | getCurrentInstance, |
| | | onMounted, |
| | | watch |
| | | } from 'vue'; |
| | | watch, |
| | | } from "vue"; |
| | | export default defineComponent({ |
| | | components: { |
| | | FormExpand, |
| | | 'vol-upload': defineAsyncComponent(() => |
| | | import('@/components/basic/VolUpload.vue') |
| | | "vol-upload": defineAsyncComponent(() => import("@/components/basic/VolUpload.vue")), |
| | | "vol-wang-editor": defineAsyncComponent(() => |
| | | import("@/components/editor/VolWangEditor.vue") |
| | | ), |
| | | 'vol-wang-editor': defineAsyncComponent(() => |
| | | import('@/components/editor/VolWangEditor.vue') |
| | | ) |
| | | }, |
| | | props: { |
| | | loadKey: { |
| | | // æ¯å¦å è½½formRulesåæ®µé
ç½®çæ°æ®æº |
| | | type: Boolean, |
| | | default: true |
| | | default: true, |
| | | }, |
| | | width: { |
| | | // 表å宽度 |
| | | type: Number, |
| | | default: 0 |
| | | default: 0, |
| | | }, |
| | | labelWidth: { |
| | | // 表å左边labelæåæ ç¾ç宽度 |
| | | type: Number, |
| | | default: 100 |
| | | default: 100, |
| | | }, |
| | | formRules: { |
| | | // 表åé
ç½®è§åï¼å¦å段类åï¼æ¯å¦å¿
å¡« |
| | | type: Array, |
| | | default: [] |
| | | default: [], |
| | | }, |
| | | formFields: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | }, |
| | | }, |
| | | editor: { |
| | | // 2021.01.16ç¼è¾å¨ä¿¡æ¯ {uploadImgUrl:"",upload:null//ä¸ä¼ æ¹æ³} |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | }, |
| | | }, |
| | | size: { |
| | | type: String, //large / default / small |
| | | default: 'large' |
| | | default: "large", |
| | | }, |
| | | select2Count: { |
| | | //è¶
åºæ°éæ¾ç¤ºselect2ç»ä»¶ |
| | | type: Number, |
| | | default: 500 |
| | | } |
| | | default: 500, |
| | | }, |
| | | }, |
| | | computed: { |
| | | rules() { |
| | |
| | | }, 100); |
| | | } |
| | | return ruleResult; |
| | | } |
| | | }, |
| | | }, |
| | | setup(props, context) { |
| | | const { appContext, proxy } = getCurrentInstance(); |
| | |
| | | }); |
| | | } |
| | | row.forEach((item, yIndex) => { |
| | | if (item.type == 'number') { |
| | | if (item.type == "number") { |
| | | numberFields.push(item.field); |
| | | } |
| | | // ç®ååªæ¯æselectåéè¿ç¨æç´¢ï¼remoteè¿ç¨ä»åå°åå
¸æ°æ®æºè¿è¡æç´¢ï¼url仿å®çurlæç´¢ |
| | |
| | | // åå§åæ°æ®æºç©ºå¯¹è±¡ |
| | | if (item.dataKey) { |
| | | // 䏿æ¡é½å¼ºå¶è®¾ç½®ä¸ºå符串类å |
| | | item.columnType = 'string'; |
| | | item.columnType = "string"; |
| | | if (!item.data) { |
| | | item.data = []; |
| | | } |
| | | } |
| | | |
| | | if (item.range || item.type == 'range') { |
| | | if (item.range || item.type == "range") { |
| | | if ( |
| | | !(props.formFields[item.field] instanceof Array) || |
| | | props.formFields[item.field].length != 2 |
| | | ) { |
| | | props.formFields[item.field] = ['', '']; |
| | | props.formFields[item.field] = ["", ""]; |
| | | } |
| | | rangeFields.push(item.field); |
| | | } |
| | |
| | | |
| | | if (keys.length == 0) return; |
| | | appContext.config.globalProperties.http |
| | | .post('/api/Sys_Dictionary/GetVueDictionary', keys) |
| | | .post("/api/Sys_Dictionary/GetVueDictionary", keys) |
| | | .then((dic) => { |
| | | bindOptions(dic, binds); |
| | | proxy.$emit('dicInited', dic); |
| | | proxy.$emit("dicInited", dic); |
| | | }); |
| | | }; |
| | | const bindOptions = (dic, binds) => { |
| | |
| | | if (d.data.length > props.select2Count) { |
| | | if ( |
| | | !binds.some((x) => { |
| | | return x.key == d.dicNo && x.type == 'cascader'; |
| | | return x.key == d.dicNo && x.type == "cascader"; |
| | | }) |
| | | ) { |
| | | d.data.forEach((item) => { |
| | |
| | | // å¦æææ°æ®çå䏿¥è¯¢ |
| | | if (x.data.length > 0) return true; |
| | | //2022.03.13å¢å çº§èæ°æ®æºèªå¨è½¬æ¢ |
| | | if (x.type == 'cascader' || x.type == 'treeSelect') { |
| | | if (x.type == "cascader" || x.type == "treeSelect") { |
| | | let _data = JSON.parse(JSON.stringify(d.data)); |
| | | let cascaderArr = appContext.config.globalProperties.base.convertTree( |
| | | _data, |
| | |
| | | } |
| | | }); |
| | | }); |
| | | } else if (d.data.length > 0 && !d.data[0].hasOwnProperty('key')) { |
| | | } else if (d.data.length > 0 && !d.data[0].hasOwnProperty("key")) { |
| | | let source = d.data, |
| | | newSource = new Array(source.length); |
| | | for (let index = 0; index < source.length; index++) { |
| | | newSource[index] = { |
| | | key: source['key'] + '', |
| | | value: source['value'] |
| | | key: source["key"] + "", |
| | | value: source["value"], |
| | | }; |
| | | } |
| | | x.data.push(...newSource); |
| | |
| | | |
| | | const initUpload = (item, init) => { |
| | | if (!init) return; |
| | | if ( |
| | | ['img', 'excel', 'file'].indexOf(item.type != -1) || |
| | | item.columnType == 'img' |
| | | ) { |
| | | if (["img", "excel", "file"].indexOf(item.type != -1) || item.columnType == "img") { |
| | | // åªæ¯æ²¡è®¾ç½®æ¯å¦èªå¨ä¸ä¼ çï¼é»è®¤é½æ¯éæ©æä»¶åèªå¨ä¸ä¼ |
| | | if (!item.hasOwnProperty('autoUpload')) { |
| | | if (!item.hasOwnProperty("autoUpload")) { |
| | | item.autoUpload = true; |
| | | } |
| | | if (!item.hasOwnProperty('fileList')) { |
| | | if (!item.hasOwnProperty("fileList")) { |
| | | item.fileList = true; |
| | | } |
| | | if (!item.hasOwnProperty('downLoad')) { |
| | | if (!item.hasOwnProperty("downLoad")) { |
| | | item.downLoad = true; |
| | | } |
| | | if (!item.removeBefore) { |
| | |
| | | let result = true; |
| | | volform.value.validate((valid) => { |
| | | if (!valid) { |
| | | appContext.config.globalProperties.$message.error('æ°æ®éªè¯æªéè¿!'); |
| | | appContext.config.globalProperties.$message.error("æ°æ®éªè¯æªéè¿!"); |
| | | result = false; |
| | | } else if (typeof callback === 'function') { |
| | | } else if (typeof callback === "function") { |
| | | try { |
| | | callback(valid); |
| | | } catch (error) { |
| | |
| | | rangeFields, |
| | | numberFields, |
| | | validate, |
| | | volform |
| | | volform, |
| | | // initFormRules, |
| | | // initSource |
| | | }; |
| | |
| | | created() { |
| | | this.formRules.forEach((rules) => { |
| | | rules.forEach((option) => { |
| | | if (option.type == 'treeSelect' && option.multiple === undefined) { |
| | | if (option.type == "treeSelect" && option.multiple === undefined) { |
| | | option.multiple = true; |
| | | } |
| | | }); |
| | |
| | | data() { |
| | | return { |
| | | // remoteCall: true, |
| | | errorImg: 'this.src="' + require('@/assets/imgs/error-img.png') + '"' |
| | | errorImg: 'this.src="' + require("@/assets/imgs/error-img.png") + '"', |
| | | // span: 1, |
| | | // rangeFields: [], |
| | | }; |
| | |
| | | if (rowLength > _span) _span = rowLength; |
| | | }); |
| | | let rete = |
| | | Math.round(((item.colSize || 12 / _span) / 0.12) * colPow, 10.0) / |
| | | colPow; |
| | | Math.round(((item.colSize || 12 / _span) / 0.12) * colPow, 10.0) / colPow; |
| | | if (item.colSize) return rete.toFixed(3); |
| | | return rete.toFixed(3); |
| | | // return (100 - rete).toFixed(3); |
| | |
| | | }, |
| | | getSrc(path) { |
| | | if (!path) return; |
| | | if (!this.base.isUrl(path) && path.indexOf('.') != -1) { |
| | | if (!this.base.isUrl(path) && path.indexOf(".") != -1) { |
| | | return this.http.ipAddress + path; |
| | | } |
| | | return path; |
| | |
| | | // æ¯å¦ä¸ºå¾çæä»¶çæ ¼å¼å¹¶å¯¹å段çè½¬æ¢ææ°ç»ï¼[{name:'1.jpg',path:'127.0.0.1/ff/1.jpg'}] |
| | | isFile(item, formFields) { |
| | | if ( |
| | | item.type == 'img' || |
| | | item.columnType == 'img' || |
| | | item.type == 'excel' || |
| | | item.type == 'file' |
| | | item.type == "img" || |
| | | item.columnType == "img" || |
| | | item.type == "excel" || |
| | | item.type == "file" |
| | | ) { |
| | | this.convertFileToArray(item, formFields); |
| | | return true; |
| | |
| | | return; |
| | | } |
| | | // å°ä»¥éå·éå¼çæä»¶å岿æ°ç»127.0.0.1/aa/1.jpg,å°127.0.0.1/aa/2.jpg |
| | | if (typeof fileInfo === 'string') { |
| | | if (fileInfo.trim() === '') { |
| | | if (typeof fileInfo === "string") { |
| | | if (fileInfo.trim() === "") { |
| | | formFields[item.field] = []; |
| | | return; |
| | | } |
| | | // 妿æä»¶è·¯å¾æ¯å符串ï¼å使ç¨ï¼æå |
| | | fileInfo = fileInfo.replace(/\\/g, '/'); |
| | | let files = fileInfo.split(','); |
| | | fileInfo = fileInfo.replace(/\\/g, "/"); |
| | | let files = fileInfo.split(","); |
| | | formFields[item.field] = []; |
| | | for (let index = 0; index < files.length; index++) { |
| | | let file = files[index]; |
| | | let splitFile = file.split('/'); |
| | | let splitFile = file.split("/"); |
| | | formFields[item.field].push({ |
| | | name: splitFile.length > 0 ? splitFile[splitFile.length - 1] : file, |
| | | path: file // this.base.isUrl(file) ? file : this.http.ipAddress + file, |
| | | path: file, // this.base.isUrl(file) ? file : this.http.ipAddress + file, |
| | | }); |
| | | } |
| | | } |
| | |
| | | file.path, |
| | | file.name, |
| | | { |
| | | Authorization: this.$store.getters.getToken() |
| | | Authorization: this.$store.getters.getToken(), |
| | | }, |
| | | this.http.ipAddress |
| | | ); |
| | | }, |
| | | validatorPhone(ruleOption, value, callback) { |
| | | if (!ruleOption.required && !value && value != '0') { |
| | | if (!ruleOption.required && !value && value != "0") { |
| | | return callback(); |
| | | } |
| | | if (!rule.phone.test((value || '').trim())) { |
| | | return callback(new Error('请è¾å
¥æ£ç¡®çææºå·')); |
| | | if (!rule.phone.test((value || "").trim())) { |
| | | return callback(new Error("请è¾å
¥æ£ç¡®çææºå·")); |
| | | } |
| | | callback(); |
| | | }, |
| | | validatorPwd(ruleOption, value, callback) { |
| | | if (!ruleOption.required && !value && value != '0') { |
| | | if (!ruleOption.required && !value && value != "0") { |
| | | return callback(); |
| | | } |
| | | if ((value + '').trim().length < 6) { |
| | | return callback(new Error('å¯ç é¿åº¦ä¸è½å°äº6ä½')); |
| | | if ((value + "").trim().length < 6) { |
| | | return callback(new Error("å¯ç é¿åº¦ä¸è½å°äº6ä½")); |
| | | } |
| | | callback(); |
| | | }, |
| | |
| | | ? val.map((x) => { |
| | | return x; |
| | | }) |
| | | : val.split(','); |
| | | : val.split(","); |
| | | for (let index = 0; index < valArr.length; index++) { |
| | | var _item = data.find((x) => { |
| | | return x.key && x.key != '0' && x.key + '' == valArr[index] + ''; |
| | | return x.key && x.key != "0" && x.key + "" == valArr[index] + ""; |
| | | }); |
| | | if (_item) { |
| | | valArr[index] = _item.value; |
| | | } |
| | | } |
| | | return valArr.join(','); |
| | | return valArr.join(","); |
| | | }, |
| | | getText(formFields, item) { |
| | | // 2019.10.24ä¿®å¤è¡¨åselectç»ä»¶ä¸ºåªè¯»ç屿§æ¶æ²¡æç»å®æ°æ®æº |
| | | let text = formFields[item.field]; |
| | | if (typeof text === 'function') return text(formFields); |
| | | if (text === 'null' || text === '' || text === null || text === undefined) |
| | | return '--'; |
| | | if (typeof text === "function") return text(formFields); |
| | | if (text === "null" || text === "" || text === null || text === undefined) |
| | | return "--"; |
| | | //2021.03.02å¢å åªè¯»æ¶æ¥æå¤ç |
| | | if (item.type == 'date') { |
| | | return text.replace('T', ' ').split(' ')[0]; |
| | | if (item.type == "date") { |
| | | return text.replace("T", " ").split(" ")[0]; |
| | | } |
| | | //2021.03.31ä¿®å¤è¡¨åswitchåªè¯»æ¶æ²¡æè½¬æ¢å¼çé®é¢ |
| | | if (item.type == 'switch') { |
| | | return text ? 'æ¯' : 'å¦'; |
| | | if (item.type == "switch") { |
| | | return text ? "æ¯" : "å¦"; |
| | | } |
| | | if (!item.data) return text; |
| | | if (item.type == 'selectList' || item.type == 'checkbox') { |
| | | if (item.type == "selectList" || item.type == "checkbox") { |
| | | return this.convertArrayValue(item.data, text); |
| | | } |
| | | var _item = item.data.find((x) => { |
| | |
| | | // console.log(2); |
| | | }, |
| | | onChange(item, value) { |
| | | if (item.onChange && typeof item.onChange === 'function') { |
| | | if (item.onChange && typeof item.onChange === "function") { |
| | | item.onChange(value, item); |
| | | } |
| | | }, |
| | |
| | | // console.log('undefined'); |
| | | } |
| | | this.remoteCall = false; |
| | | if (item.onChange && typeof item.onChange === 'function') { |
| | | if (item.onChange && typeof item.onChange === "function") { |
| | | item.onChange(value, item); |
| | | } |
| | | }, |
| | |
| | | return; |
| | | } |
| | | if ( |
| | | val == '' || |
| | | (item.data.length == 1 && |
| | | (val == item.data[0].key || val == item.data[0].value)) |
| | | val == "" || |
| | | (item.data.length == 1 && (val == item.data[0].key || val == item.data[0].value)) |
| | | ) { |
| | | return; |
| | | } |
| | | // å¼¹åºæ¡æåå§åè¡¨åæ¶ç»data设置æ°ç»é»è®¤å¼2 |
| | | // 2020.09.26ä¿®å¤è¿ç¨æç´¢èªå®ä¹urlä¸èµ·ä½ç¨çé®é¢ |
| | | let url; |
| | | if (typeof item.url === 'function') { |
| | | if (typeof item.url === "function") { |
| | | url = item.url(val, item.dataKey, item); |
| | | } else { |
| | | url = |
| | | (item.url || '/api/Sys_Dictionary/GetSearchDictionary') + |
| | | '?dicNo=' + |
| | | (item.url || "/api/Sys_Dictionary/GetSearchDictionary") + |
| | | "?dicNo=" + |
| | | item.dataKey + |
| | | '&value=' + |
| | | "&value=" + |
| | | val; |
| | | } |
| | | this.http.post(url).then((dicData) => { |
| | |
| | | }); |
| | | }, |
| | | getObject(date) { |
| | | if (typeof date === 'object') { |
| | | if (typeof date === "object") { |
| | | return date; |
| | | } |
| | | return new Date(date); |
| | | }, |
| | | reset(sourceObj) { |
| | | // éç½®è¡¨åæ¶ï¼ç¦ç¨è¿ç¨æ¥è¯¢ |
| | | this.$refs['volform'].resetFields(); |
| | | this.$refs["volform"].resetFields(); |
| | | if (this.rangeFields.length) { |
| | | this.rangeFields.forEach((key) => { |
| | | this.formFields[key].splice(0); |
| | |
| | | if ( |
| | | // item.readonly || |
| | | // item.disabled || |
| | | item.type == 'switch' || |
| | | item.type == 'range' |
| | | item.type == "switch" || |
| | | item.type == "range" |
| | | ) |
| | | return { required: false }; |
| | | // ç¨æ·è®¾ç½®çèªå®ä¹æ¹æ³ |
| | | if (item.validator && typeof item.validator === 'function') { |
| | | if (item.validator && typeof item.validator === "function") { |
| | | return { |
| | | validator: (rule, val, callback) => { |
| | | // ç¨æ·èªå®ä¹çæ¹æ³ï¼å¦æè¿åäºå¼ï¼ç´æ¥æ¾ç¤ºè¿åçå¼ï¼éªè¯ä¸éè¿ |
| | | let message = item.validator(rule, val); |
| | | if (message) return callback(new Error(message + '')); |
| | | if (message) return callback(new Error(message + "")); |
| | | return callback(); |
| | | }, |
| | | required: item.required, |
| | | trigger: rule.change.indexOf(item.type) != -1 ? 'change' : 'blur' |
| | | trigger: rule.change.indexOf(item.type) != -1 ? "change" : "blur", |
| | | }; |
| | | } |
| | | if (['img', 'excel', 'file'].indexOf(item.type) != -1) { |
| | | if (["img", "excel", "file"].indexOf(item.type) != -1) { |
| | | return { |
| | | validator: (rule, val, callback) => { |
| | | //2021.09.05ç§»é¤æä»¶ä¸ä¼ é»è®¤å¿
å¡« |
| | | if ( |
| | | item.required && |
| | | !this.isReadonly(item) && |
| | | (!val || !val.length) |
| | | ) { |
| | | if (item.required && !this.isReadonly(item) && (!val || !val.length)) { |
| | | return callback( |
| | | new Error(item.type == 'img' ? '请ä¸ä¼ ç
§ç' : '请ä¸ä¼ æä»¶') |
| | | new Error(item.type == "img" ? "请ä¸ä¼ ç
§ç" : "请ä¸ä¼ æä»¶") |
| | | ); |
| | | } |
| | | return callback(); |
| | | }, |
| | | required: item.required, |
| | | trigger: 'change' |
| | | trigger: "change", |
| | | }; |
| | | } |
| | | // 设置æ°åçæå¤§å¼æ°æå°å¼ |
| | | if ( |
| | | item.type == 'number' || |
| | | item.columnType == 'number' || |
| | | item.columnType == 'int' || |
| | | item.type == 'decimal' |
| | | item.type == "number" || |
| | | item.columnType == "number" || |
| | | item.columnType == "int" || |
| | | item.type == "decimal" |
| | | ) { |
| | | // 妿æ¯å¿
å¡«é¡¹çæ°åï¼è®¾ç½®ä¸ä¸ªé»è®¤æå¤§ä¸æå¼å° |
| | | if (item.required && typeof item.min !== 'number') { |
| | | if (item.required && typeof item.min !== "number") { |
| | | item.min = 0; //item.type == "decimal" ? 0.1 : 1; |
| | | } |
| | | |
| | | return { |
| | | required: item.required, |
| | | message: item.title + 'åªè½æ¯æ°å', |
| | | message: item.title + "åªè½æ¯æ°å", |
| | | title: item.title, |
| | | trigger: 'blur', |
| | | trigger: "blur", |
| | | min: item.min, |
| | | max: item.max, |
| | | type: item.columnType || item.type, |
| | | validator: (ruleObj, value, callback) => { |
| | | if (!ruleObj.min && !ruleObj.max) { |
| | | if (ruleObj.required) { |
| | | if ((!value && value != '0') || !rule.decimal.test(value)) { |
| | | return callback(new Error('åªè½æ¯æ°å')); |
| | | if ((!value && value != "0") || !rule.decimal.test(value)) { |
| | | return callback(new Error("åªè½æ¯æ°å")); |
| | | } |
| | | } |
| | | return callback(); |
| | | } |
| | | if (this.isReadonly(item)) return callback(); |
| | | if (ruleObj.type == 'number') { |
| | | if (ruleObj.type == "number") { |
| | | if (!rule.number.test(value)) { |
| | | ruleObj.message = ruleObj.title + 'åªè½æ¯æ´æ°'; |
| | | ruleObj.message = ruleObj.title + "åªè½æ¯æ´æ°"; |
| | | return callback(new Error(ruleObj.message)); |
| | | } |
| | | } else { |
| | | if (!rule.decimal.test(value)) { |
| | | ruleObj.message = ruleObj.title + 'åªè½æ¯æ°å'; |
| | | ruleObj.message = ruleObj.title + "åªè½æ¯æ°å"; |
| | | return callback(new Error(ruleObj.message)); |
| | | } |
| | | } |
| | | if ( |
| | | ruleObj.min !== undefined && |
| | | typeof ruleObj.min === 'number' && |
| | | typeof ruleObj.min === "number" && |
| | | value < ruleObj.min |
| | | ) { |
| | | ruleObj.message = ruleObj.title + 'ä¸è½å°äº' + ruleObj.min; |
| | | ruleObj.message = ruleObj.title + "ä¸è½å°äº" + ruleObj.min; |
| | | return callback(new Error(ruleObj.message)); |
| | | } |
| | | if ( |
| | | ruleObj.max !== undefined && |
| | | typeof ruleObj.max === 'number' && |
| | | typeof ruleObj.max === "number" && |
| | | value > ruleObj.max |
| | | ) { |
| | | ruleObj.message = ruleObj.title + 'ä¸è½å¤§äº' + ruleObj.max; |
| | | ruleObj.message = ruleObj.title + "ä¸è½å¤§äº" + ruleObj.max; |
| | | return callback(new Error(ruleObj.message)); |
| | | } |
| | | return callback(); |
| | | } |
| | | }, |
| | | }; |
| | | } |
| | | |
| | | // ææºãå¯ç éªè¯ |
| | | if (item.type == 'password' || item.type == 'phone') { |
| | | if (item.type == "password" || item.type == "phone") { |
| | | return { |
| | | validator: |
| | | item.type == 'phone' ? this.validatorPhone : this.validatorPwd, |
| | | validator: item.type == "phone" ? this.validatorPhone : this.validatorPwd, |
| | | required: item.required, |
| | | trigger: 'blur' |
| | | trigger: "blur", |
| | | }; |
| | | } |
| | | |
| | | if (!item.required && item.type != 'mail') return { required: false }; |
| | | if (!item.required && item.type != "mail") return { required: false }; |
| | | |
| | | if (!item.hasOwnProperty('type')) item.type = 'text'; |
| | | if (!item.hasOwnProperty("type")) item.type = "text"; |
| | | |
| | | if (inputTypeArr.indexOf(item.type) != -1) { |
| | | let message = |
| | | item.title + |
| | | (item.type == 'mail' ? 'å¿
é¡»æ¯ä¸ä¸ªé®ç®±å°å' : 'ä¸è½ä¸ºç©º'); |
| | | let type = item.type == 'mail' ? 'email' : types[item.columnType]; |
| | | item.title + (item.type == "mail" ? "å¿
é¡»æ¯ä¸ä¸ªé®ç®±å°å" : "ä¸è½ä¸ºç©º"); |
| | | let type = item.type == "mail" ? "email" : types[item.columnType]; |
| | | let _rule = { |
| | | required: true, |
| | | message: message, |
| | | trigger: 'blur', |
| | | trigger: "blur", |
| | | type: type, |
| | | validator: (ruleObj, value, callback) => { |
| | | if ( |
| | | !this.isReadonly(item) && |
| | | (value === '' || value === undefined || value === null) |
| | | (value === "" || value === undefined || value === null) |
| | | ) { |
| | | return callback(new Error(ruleObj.message)); |
| | | } |
| | | return callback(); |
| | | } |
| | | }, |
| | | }; |
| | | if (item.type == 'mail') { |
| | | if (item.type == "mail") { |
| | | _rule.validator = undefined; |
| | | return _rule; |
| | | } |
| | | if (item.min) { |
| | | _rule.min = item.min; |
| | | _rule.message = item.title + 'è³å°' + item.min + '个å符!'; |
| | | _rule.message = item.title + "è³å°" + item.min + "个å符!"; |
| | | } |
| | | if (item.max) { |
| | | return [ |
| | |
| | | { |
| | | max: item.max, |
| | | required: true, |
| | | message: item.title + 'æå¤' + item.max + '个å符!', |
| | | trigger: 'blur' |
| | | } |
| | | message: item.title + "æå¤" + item.max + "个å符!", |
| | | trigger: "blur", |
| | | }, |
| | | ]; |
| | | } |
| | | return _rule; |
| | | } |
| | | |
| | | if (item.type == 'radio') { |
| | | if (item.type == "radio") { |
| | | return { |
| | | required: item.required, |
| | | message: 'è¯·éæ©' + item.title, |
| | | trigger: 'change', |
| | | type: 'string' |
| | | message: "è¯·éæ©" + item.title, |
| | | trigger: "change", |
| | | type: "string", |
| | | }; |
| | | } |
| | | if ( |
| | | item.type == 'date' || |
| | | item.type == 'datetime' || |
| | | item.type == 'month' || |
| | | item.type == 'time' |
| | | item.type == "date" || |
| | | item.type == "datetime" || |
| | | item.type == "month" || |
| | | item.type == "time" |
| | | ) { |
| | | return { |
| | | required: true, |
| | | message: 'è¯·éæ©' + item.title, |
| | | trigger: 'change', |
| | | type: item.range ? 'array' : 'string', |
| | | message: "è¯·éæ©" + item.title, |
| | | trigger: "change", |
| | | type: item.range ? "array" : "string", |
| | | validator: (rule, val, callback) => { |
| | | if (this.isReadonly(item)) return callback(); |
| | | // ç¨æ·èªå®ä¹çæ¹æ³ï¼å¦æè¿åäºå¼ï¼ç´æ¥æ¾ç¤ºè¿åçå¼ï¼éªè¯ä¸éè¿ |
| | | if (!val || (item.range && !val.length)) { |
| | | return callback(new Error('è¯·éæ©æ¥æ')); |
| | | return callback(new Error("è¯·éæ©æ¥æ")); |
| | | } |
| | | return callback(); |
| | | } |
| | | }, |
| | | }; |
| | | } |
| | | |
| | | if (item.type == 'cascader') { |
| | | if (item.type == "cascader") { |
| | | return { |
| | | type: 'array', |
| | | type: "array", |
| | | required: true, |
| | | min: item.min || 1, |
| | | // message: "è¯·éæ©" + item.title, |
| | | trigger: 'change', |
| | | trigger: "change", |
| | | validator: (rule, val, callback) => { |
| | | if (this.isReadonly(item)) return callback(); |
| | | // ç¨æ·èªå®ä¹çæ¹æ³ï¼å¦æè¿åäºå¼ï¼ç´æ¥æ¾ç¤ºè¿åçå¼ï¼éªè¯ä¸éè¿ |
| | | let _arr = this.formFields[item.field]; |
| | | if (!_arr || !_arr.length) { |
| | | return callback(new Error('è¯·éæ©' + item.title)); |
| | | return callback(new Error("è¯·éæ©" + item.title)); |
| | | } |
| | | return callback(); |
| | | } |
| | | }, |
| | | }; |
| | | } |
| | | |
| | | if ( |
| | | ['select', 'selectList', 'checkbox', 'cascader', 'treeSelect'].indexOf( |
| | | ["select", "selectList", "checkbox", "cascader", "treeSelect"].indexOf( |
| | | item.type |
| | | ) != -1 |
| | | ) { |
| | | let _rule = { |
| | | type: item.type == 'select' ? 'string' : 'array', |
| | | type: item.type == "select" ? "string" : "array", |
| | | required: true, |
| | | min: item.min || 1, |
| | | message: 'è¯·éæ©' + item.title, |
| | | trigger: 'change', |
| | | message: "è¯·éæ©" + item.title, |
| | | trigger: "change", |
| | | validator: (rule, value, callback) => { |
| | | if (this.isReadonly(item)) return callback(); |
| | | //2021.11.27ä¿®å¤å¤é没ææç¤ºçé®é¢ |
| | | if (value == undefined || value === '') { |
| | | if (value == undefined || value === "") { |
| | | return callback(new Error(rule.message)); |
| | | } else if ( |
| | | (item.type == 'checkbox' || |
| | | item.type == 'selectList' || |
| | | item.type == 'treeSelect') && |
| | | (item.type == "checkbox" || |
| | | item.type == "selectList" || |
| | | item.type == "treeSelect") && |
| | | (!(value instanceof Array) || !value.length) |
| | | ) { |
| | | return callback(new Error(rule.message)); |
| | | } |
| | | return callback(); |
| | | } |
| | | }, |
| | | }; |
| | | |
| | | if (_rule.max) { |
| | | _rule.nax = item.max; |
| | | _rule.message = 'æå¤åªè½éæ©' + item.max + '项'; |
| | | _rule.message = "æå¤åªè½éæ©" + item.max + "项"; |
| | | } |
| | | return _rule; |
| | | } |
| | |
| | | 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) { |
| | |
| | | if ((!item.min && !item.max) || !date) { |
| | | return false; |
| | | } |
| | | if (item.min && item.min.indexOf(' ') == -1) { |
| | | if (item.min && item.min.indexOf(" ") == -1) { |
| | | //ä¸è®¾ç½®æ¶åç§ï¼åé¢ä¼èªå¨å ä¸ 08:00 |
| | | item.min = item.min + ' 00:00:000'; |
| | | 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(item) { |
| | | if (item.type == 'month') { |
| | | return 'YYYY-MM'; |
| | | if (item.type == "month") { |
| | | return "YYYY-MM"; |
| | | } |
| | | // if (item.type=='time') { |
| | | // return 'HH:mm:ss' |
| | | // } |
| | | //è§https://day.js.org/docs/zh-CN/display/format |
| | | return item.type == 'date' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'; |
| | | return item.type == "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"; |
| | | }, |
| | | dateRangeChange(val, item) { |
| | | if (!val) { |
| | | this.$emit('update:formFields'); |
| | | this.$emit("update:formFields"); |
| | | return; |
| | | } |
| | | item.onChange && item.onChange(val); |
| | |
| | | filterMethod(value, data) { |
| | | return data.label.includes(value); |
| | | }, |
| | | getNode( label,node, data){ |
| | | console.log(label) |
| | | } |
| | | } |
| | | getNode(label, node, data) { |
| | | console.log(label); |
| | | }, |
| | | }, |
| | | }); |
| | | </script> |
| | | <style lang="less" scoped> |
| | |
| | | padding-left: 5px; |
| | | } |
| | | .el-form-item ::v-deep(textarea) { |
| | | font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', |
| | | 'Microsoft YaHei', '微软é
é»', Arial, sans-serif !important; |
| | | font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", |
| | | "Microsoft YaHei", "微软é
é»", Arial, sans-serif !important; |
| | | } |
| | | .el-form-item ::v-deep(.el-select .el-select__tags > span) { |
| | | display: flex; |
| | |
| | | default: 500, |
| | | }, |
| | | selectable: { |
| | | |
| | | type: Function, |
| | | default: (row, index) => { |
| | | return true; |
| | |
| | | rowDbClick(row, column, event) { |
| | | //2021.05.23å¢å åå»è¡äºä»¶ |
| | | this.$emit("rowDbClick", { row, column, event }); |
| | | }, |
| | | rowClick(row, column, event) { |
| | | //2022.02.20å¢å ç¹å»æ¶è¡¨æ ¼åæ°å¤æ |
| | | if (!column) { |
| | | return; |
| | | } |
| | | //æ£å¨ç¼è¾æ¶ï¼ç¦æ¢åºårowClickäºä»¶ |
| | | if (this.edit.rowIndex == -1) { |
| | | this.$emit("rowClick", { row, column, event }); |
| | | } |
| | | // ç¹å»è¡äºä»¶(2020.11.07) |
| | | },rowClick(row, column, event) { |
| | | // 2022.02.20å¢å ç¹å»æ¶è¡¨æ ¼åæ°å¤æ |
| | | if (!column) { |
| | | return; |
| | | } |
| | | |
| | | 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)) { |
| | | // ===== ä¼åï¼é离å¤éæ¡ç¹å»äºä»¶ï¼é¿å
åæ³¡å¹²æ° å¼å§ ===== |
| | | // 夿ç¹å»ç®æ æ¯å¦æ¯å¤éæ¡ï¼æå¤éæ¡æå¨çåå
æ ¼/徿 ï¼ |
| | | 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; |
| | | } |
| | | //彿£å¨ç¼è¾ï¼ä¸ç¹å»å°å
¶ä»è¡æ¶ï¼å¨åç¼è¾çè¡ç»æç¼è¾åï¼è§¦åæ°è¡çrowClickäºä»¶ |
| | | //æ£å¨ç¼è¾æ¶ï¼ç¦æ¢åºårowClickäºä»¶ |
| | | if (this.edit.rowIndex == -1) { |
| | | this.$emit("rowClick", { row, column, event }); |
| | | } |
| | | } |
| | | this.rowBeginEdit(row, column); |
| | | }, |
| | | 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); |
| | | // }, |
| | | dowloadFile(file) { |
| | | this.base.dowloadFile( |
| | | file.path, |
| | |
| | | return column.edit.type == "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"; |
| | | }, |
| | | userSelect(selection, row) { |
| | | console.log("userSelect", selection, row); |
| | | this.selectRows = selection; |
| | | if (!this.single) { |
| | | this.$emit("rowChange", { row, selection }); |
| | |
| | | |
| | | |
| | | let extension = { |
| | | components: {//卿æ©å
ç»ä»¶æç»ä»¶è·¯å¾ |
| | | //表åheaderãcontentãfooter对åºä½ç½®æ©å
çç»ä»¶ |
| | |
| | | |
| | | |
| | | let extension = { |
| | | components: {//卿æ©å
ç»ä»¶æç»ä»¶è·¯å¾ |
| | | //表åheaderãcontentãfooter对åºä½ç½®æ©å
çç»ä»¶ |
| | |
| | | |
| | | |
| | | 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() { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | |
| | | let extension = { |
| | | components: {//卿æ©å
ç»ä»¶æç»ä»¶è·¯å¾ |
| | | //表åheaderãcontentãfooter对åºä½ç½®æ©å
çç»ä»¶ |
| | | gridHeader:'', |
| | | gridbody:'', |
| | | gridFooter: '', |
| | | //å¼¹åºæ¡(ä¿®æ¹ãç¼è¾ãæ¥ç)headerãcontentãfooter对åºä½ç½®æ©å
çç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | buttons: [],//æ©å±çæé® |
| | | methods: {//äºä»¶æ©å± |
| | | onInit() { |
| | | }, |
| | | onInited() { |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | name: 'processInfo', |
| | | component: () => import('@/views/basicinfo/processInfo.vue') |
| | | }, { |
| | | path: '/processInfoDetail', |
| | | name: 'processInfoDetail', |
| | | component: () => import('@/views/basicinfo/processInfoDetail.vue') |
| | | }, { |
| | | path: '/scanStation', |
| | | name: 'scanStation', |
| | | component: () => import('@/views/basicinfo/scanStation.vue') |
| | |
| | | <template> |
| | | <div class="title"></div> |
| | | <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" |
| | | > |
| | | <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> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="left-bottom"> |
| | | <div class="form-row finished-product-row"> |
| | | <span class="label">æåç¼å·ï¼</span> |
| | | <input type="text" class="input-box" v-model="finishedProduct" disabled /> |
| | | </div> |
| | | <div class="parts-list"> |
| | | <div |
| | | class="form-row part-item" |
| | | v-for="(item, index) in leftPartCodes" |
| | | :key="index" |
| | | > |
| | | <span class="label">é¶ä»¶{{ index + 1 }}ï¼</span> |
| | | <input |
| | | type="text" |
| | | class="input-box" |
| | | v-model="leftPartCodes[index]" |
| | | disabled |
| | | /> |
| | | <label class="checkbox-container"> |
| | | <input |
| | | type="checkbox" |
| | | class="part-checkbox" |
| | | v-model="leftPartChecked[index]" |
| | | @change="handlePartCheck(index)" |
| | | /> |
| | | <span class="checkmark"></span> |
| | | <span class="checkbox-label">{{ |
| | | leftPartChecked[index] ? "æ«ç " : "䏿«" |
| | | }}</span> |
| | | </label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- å³ä¾§åºå - æ 任使 颿 注 ãå·²å 餿¸
空+ä¿åæé®ã --> |
| | | <div class="right-area"> |
| | | <div class="right-top"> |
| | | <div class="form-row"> |
| | | <span class="label">å½å
¥æ¡ï¼</span> |
| | | <!-- â
åªä¿ç纯å½å
¥æ¡ï¼æ¸
空/ä¿åæé®å·²å é¤ --> |
| | | <input type="text" class="input-box" v-model="rightTopInput" /> |
| | | </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> |
| | | <input |
| | | type="text" |
| | | class="input-box" |
| | | v-model="finishedProductCode" |
| | | placeholder="请è¾å
¥æåç¼å·" |
| | | /> |
| | | <button class="btn clear-btn" @click="clearFinishedProductCode"> |
| | | <i class="icon icon-clear"></i>æ¸
é¤ |
| | | </button> |
| | | </div> |
| | | <div |
| | | class="form-row part-item" |
| | | v-for="(item, index) in rightPartCodes" |
| | | :key="index" |
| | | > |
| | | <span class="label">é¶ä»¶{{ index + 1 }}ï¼</span> |
| | | <input |
| | | type="text" |
| | | class="input-box" |
| | | v-model="rightPartCodes[index]" |
| | | placeholder="请è¾å
¥é¶ä»¶ç¼å·" |
| | | /> |
| | | <button class="btn clear-btn" @click="clearRightPart(index)"> |
| | | <i class="icon icon-clear"></i>æ¸
é¤ |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, reactive } from 'vue' |
| | | import { ref, onMounted, onUnmounted, watch, computed } from "vue"; |
| | | import axios from "axios"; |
| | | |
| | | export default { |
| | | setup() { |
| | | return { |
| | | // åºç¡æ°æ®å®ä¹ - 1:1ç²¾å对æ¥å端 æåç¼å·+é¶ä»¶ç¼å· æ åä½å
¼å®¹ |
| | | const finishedProduct = ref(""); // 左侧æåç¼å·ï¼GetLeftInitialDataæ¥å£è¿åï¼ |
| | | const finishedProductId = ref(""); |
| | | 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(""); // å³ä¾§æåç¼å·ï¼å·¥è£
æ¿æ¥å£è¿åï¼ |
| | | |
| | | } |
| | | } |
| | | } |
| | | // 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; |
| | | let checkDebounceTimer = null; |
| | | let destroyDelayTimer = null; |
| | | const destroyDelayTime = 500; // â
æ ¸å¿ï¼å¡«å
+æ¸
空 é½å»¶è¿500æ¯«ç§ |
| | | let boardCodeDebounceTimer = null; |
| | | // â
æ°å¢ï¼èªå¨æäº¤é²æå®æ¶å¨ï¼é²æ¢éå¤æäº¤ |
| | | let autoSubmitDebounceTimer = null; |
| | | // â
æ°å¢ï¼æäº¤éï¼é²æ¢æ å¾éæ¶éå¤è§¦åæäº¤ |
| | | 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ï¼..."); |
| | | const response = await axios.get("/api/scanStation/GetLeftInitialData", { |
| | | timeout: 5000, |
| | | }); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | 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]; |
| | | } |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error("è·å左侧åå§æ°æ®å¤±è´¥ï¼", error); |
| | | } |
| | | }; |
| | | |
| | | // â
è·åä¿¡å·+PLCç¶æ |
| | | const fetchSignalAndPLCStates = async () => { |
| | | try { |
| | | const response = await axios.get("/api/scanStation/GetSignalStates", { |
| | | timeout: 5000, |
| | | }); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | 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); |
| | | } |
| | | }; |
| | | |
| | | // â
ãæ ¸å¿ä¿®æ¹ãå·¥è£
æ¿æ¥è¯¢æ¥å£ - ææ°æ®å°±å¡«å
ï¼æ æ°æ®/失败 å®å
¨ä¿çåæå
容ï¼ä¸å任使¸
空æä½ |
| | | 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 = setInterval(fetchSignalAndPLCStates, pollingInterval); |
| | | }; |
| | | const stopPolling = () => { |
| | | if (pollingTimer) clearInterval(pollingTimer); |
| | | 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 (!partId) { |
| | | alert(`é¶ä»¶${index + 1}æ°æ®åºIDä¸åå¨ï¼æ æ³æ´æ°æ«ç ç¶æï¼`); |
| | | leftPartChecked.value[index] = !isChecked; |
| | | return; |
| | | } |
| | | if (!partCode.trim()) { |
| | | alert(`é¶ä»¶${index + 1}ç¼å·ä¸ºç©ºï¼æ æ³æ´æ°æ«ç ç¶æï¼`); |
| | | 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) { |
| | | leftPartChecked.value[index] = !isChecked; |
| | | alert(`é¶ä»¶${index + 1}ç¶ææ´æ°è¯·æ±å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¥å£ï¼`); |
| | | console.error(`æ´æ°é¶ä»¶${index + 1}æ«ç ç¶æå¤±è´¥ï¼`, error); |
| | | } finally { |
| | | checkDebounceTimer = null; |
| | | } |
| | | }, 500); |
| | | }; |
| | | |
| | | // â
æ ¸å¿ä¿®æ¹ï¼å»¶è¿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()) { |
| | | finishedProductCode.value = inputValue; |
| | | } else if (fillIndex.value < 10) { |
| | | rightPartCodes.value[fillIndex.value] = inputValue; |
| | | fillIndex.value++; |
| | | } else { |
| | | alert("å·¥è£
æ¿ç¼å·ãæåç¼å·åé¶ä»¶1-10å·²å
¨é¨å¡«å
宿,æ æ³ç»§ç»å½å
¥!"); |
| | | rightTopInput.value = ""; |
| | | destroyDelayTimer = null; |
| | | return; |
| | | } |
| | | // å¡«å
宿å èªå¨æ¸
空å½å
¥æ¡ |
| | | rightTopInput.value = ""; |
| | | destroyDelayTimer = null; |
| | | }, destroyDelayTime); |
| | | }; |
| | | |
| | | // â
çå¬å½å
¥æ¡å
容ååèªå¨è§¦åå¡«å
é»è¾ |
| | | watch( |
| | | rightTopInput, |
| | | (newVal) => { |
| | | if (newVal.trim()) fillContent(); |
| | | }, |
| | | { 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("å·¥è£
æ¿ç¼å·ä¸è½ä¸ºç©ºï¼è¯·è¾å
¥ååæäº¤ï¼"); |
| | | return; |
| | | } |
| | | if (!finishedProductCode.value.trim()) { |
| | | alert("æåç¼å·ä¸è½ä¸ºç©ºï¼è¯·è¾å
¥ååæäº¤ï¼"); |
| | | return; |
| | | } |
| | | try { |
| | | const submitData = { |
| | | toolingBoardNo: toolingBoardNo.value.trim(), |
| | | finishedProductCode: finishedProductCode.value.trim(), |
| | | partsList: rightPartCodes.value.map((item) => item.trim()), |
| | | }; |
| | | console.log("â
æäº¤å·¥è£
æ¿æ°æ®ï¼", submitData); |
| | | const response = await axios.post( |
| | | "/api/boxingDetail/SaveToolingBoardNo", |
| | | submitData, |
| | | { timeout: 5000 } |
| | | ); |
| | | const resData = response.data; |
| | | const isSuccess = resData.Status === true || resData.status === true; |
| | | if (isSuccess) { |
| | | alert("â
æäº¤æåï¼"); |
| | | toolingBoardNo.value = ""; |
| | | finishedProductCode.value = ""; |
| | | rightPartCodes.value = Array(10).fill(""); |
| | | rightTopInput.value = ""; |
| | | fillIndex.value = -1; |
| | | // â
æäº¤æååï¼éç½®æäº¤é |
| | | submitLock.value = false; |
| | | } else { |
| | | alert("æäº¤å¤±è´¥ï¼" + (resData.Message || resData.message || "æªç¥é误")); |
| | | } |
| | | } catch (error) { |
| | | alert("æäº¤è¯·æ±å¤±è´¥ï¼è¯·æ£æ¥ç½ç»ææ¥å£ï¼"); |
| | | console.error("æäº¤æ¥å£å¤±è´¥ï¼", error); |
| | | // â
请æ±å¤±è´¥ä¹éç½®é |
| | | 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() !== ""; // æåæå¼ |
| | | |
| | | console.log(`â
èªå¨æäº¤æ ¡éªï¼å·¦ä¾§å¾é${needCheckNum}个ï¼å³ä¾§å¡«å
${filledNum}个`); |
| | | |
| | | // 忝1ï¼å·¦ä¾§æå¾é â åæé»è¾ï¼é¶ä»¶å¡«å
æ°â¥å¾éæ° ææäº¤ |
| | | if (needCheckNum > 0) { |
| | | if (hasBoardNo && hasProductCode && filledNum >= needCheckNum) { |
| | | console.log("â
满足å¾éæ°éæ¡ä»¶ï¼æ§è¡èªå¨æäº¤ï¼"); |
| | | saveToolingBoardNo(); |
| | | } |
| | | } |
| | | // 忝2ï¼å·¦ä¾§æ å¾é â æ°å¢é»è¾ï¼å·¥è£
æ¿+æåé½æå¼ å°±æäº¤ (å éé²éå¤) |
| | | else { |
| | | if (hasBoardNo && hasProductCode && !submitLock.value) { |
| | | console.log("â
左侧æ å¾éï¼æåç¼å·å¡«å
å®æï¼æ§è¡èªå¨æäº¤ï¼"); |
| | | submitLock.value = true; // å é鲿¢éå¤æäº¤ |
| | | saveToolingBoardNo(); |
| | | } |
| | | } |
| | | autoSubmitDebounceTimer = null; |
| | | }, 300); |
| | | }; |
| | | |
| | | // â
â
â
æ ¸å¿æ°å¢4ï¼çå¬å
³é®æ°æ®ååï¼è§¦åèªå¨æäº¤æ ¡éª |
| | | watch( |
| | | [checkedCount, filledPartCount, toolingBoardNo, finishedProductCode], |
| | | () => { |
| | | checkAutoSubmit(); |
| | | }, |
| | | { deep: true, immediate: false } |
| | | ); |
| | | |
| | | // èªå¨æ£æµå¡«å
ç´¢å¼é»è¾ |
| | | const detectFillIndex = () => { |
| | | if (!toolingBoardNo.value.trim() || !finishedProductCode.value.trim()) { |
| | | fillIndex.value = -1; |
| | | return; |
| | | } |
| | | for (let i = 0; i < 10; i++) { |
| | | if (!rightPartCodes.value[i].trim()) { |
| | | fillIndex.value = i; |
| | | return; |
| | | } |
| | | } |
| | | fillIndex.value = 10; |
| | | }; |
| | | |
| | | watch( |
| | | [toolingBoardNo, 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); |
| | | }); |
| | | |
| | | return { |
| | | finishedProduct, |
| | | finishedProductId, |
| | | rightTopInput, |
| | | leftPartCodes, |
| | | rightPartCodes, |
| | | leftPartChecked, |
| | | leftPartIds, |
| | | toolingBoardNo, |
| | | isPLCStarted, |
| | | isPLCPaused, |
| | | signalStates, |
| | | signalLabels, |
| | | finishedProductCode, |
| | | handleToggle, |
| | | handlePauseToggle, |
| | | handlePartCheck, |
| | | clearToolingBoardNo, |
| | | saveToolingBoardNo, |
| | | clearRightPart, |
| | | clearFinishedProductCode, |
| | | }; |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | line-height: 70vh; |
| | | text-align: center; |
| | | font-size: 28px; |
| | | color: orange; |
| | | /* åºç¡æ ·å¼éç½®ä¸å
¨å±æ ·å¼ */ |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | box-sizing: border-box; |
| | | font-family: "Microsoft Yahei", "PingFang SC", "Inter", sans-serif; |
| | | scrollbar-width: none; |
| | | -ms-overflow-style: none; |
| | | } |
| | | </style> |
| | | *::-webkit-scrollbar { |
| | | display: none; |
| | | } |
| | | |
| | | body { |
| | | background: linear-gradient(135deg, #f0f4f8 0%, #e9ecef 100%); |
| | | min-height: 100vh; |
| | | overflow: hidden; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* 容卿 ·å¼ - æ¾å¤§ é´è·å 宽 */ |
| | | .container { |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100vh; |
| | | margin: 0; |
| | | gap: 15px; |
| | | padding: 15px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | /* 颿¿éç¨æ ·å¼ - ç»ä¸å
è¾¹è· ç¡®ä¿å·¦å³å¯¹é½ */ |
| | | .left-area, |
| | | .right-area { |
| | | flex: 1; |
| | | width: 50%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 15px; |
| | | padding: 18px; |
| | | background: #ffffff; |
| | | border: 1px solid #e2e8f0; |
| | | border-radius: 15px; |
| | | box-shadow: 0 6px 16px rgba(149, 157, 165, 0.15); |
| | | transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); |
| | | } |
| | | |
| | | /* æé®+ä¿¡å· æ¨ªåæåå®¹å¨ - æ ¸å¿å¸å± */ |
| | | .btn-signal-group { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 20px; |
| | | width: 100%; |
| | | } |
| | | .btn-group { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | flex-shrink: 0; |
| | | } |
| | | .signal-status { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | gap: 18px; |
| | | flex-shrink: 0; |
| | | padding: 0; |
| | | } |
| | | |
| | | .left-top { |
| | | background: #f8fafc; |
| | | padding: 15px; |
| | | border-radius: 12px; |
| | | flex-shrink: 0; |
| | | width: 100%; |
| | | } |
| | | |
| | | .left-bottom, |
| | | .right-bottom { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 12px; |
| | | flex: 1; |
| | | overflow: hidden !important; |
| | | } |
| | | |
| | | .right-top { |
| | | padding: 15px; |
| | | background: #f8fafc; |
| | | border-radius: 12px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | /* 表åè¡æ ·å¼ - ç»ä¸é«åº¦åé´è· ç¡®ä¿å·¦å³å¯¹é½ */ |
| | | .form-row { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | 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 { |
| | | 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; |
| | | color: #334155; |
| | | font-size: 15px; |
| | | font-weight: 600; |
| | | 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; |
| | | height: 42px; |
| | | padding: 0 15px; |
| | | border: 1px solid #e2e8f0; |
| | | border-radius: 8px; |
| | | outline: none; |
| | | font-size: 15px; |
| | | 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; |
| | | padding: 0 16px; |
| | | border: none; |
| | | border-radius: 8px; |
| | | cursor: pointer; |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | transition: all 0.2s ease; |
| | | flex-shrink: 0; |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | gap: 8px; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .btn:disabled { |
| | | opacity: 0.6; |
| | | cursor: not-allowed; |
| | | transform: none !important; |
| | | box-shadow: none !important; |
| | | } |
| | | |
| | | .btn::after { |
| | | content: ""; |
| | | position: absolute; |
| | | top: 0; |
| | | left: -100%; |
| | | width: 100%; |
| | | height: 100%; |
| | | 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; |
| | | height: 18px; |
| | | background-size: contain; |
| | | 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; |
| | | padding: 0 12px; |
| | | } |
| | | .clear-btn:hover:not(:disabled) { |
| | | 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; |
| | | padding: 0 12px; |
| | | } |
| | | .save-btn:hover:not(:disabled) { |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 4px 8px rgba(59, 130, 246, 0.15); |
| | | } |
| | | |
| | | /* ä¿¡å·ç¯æ ·å¼ éç®æ¾å¤§ */ |
| | | .signal-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | gap: 5px; |
| | | min-width: 60px; |
| | | } |
| | | .signal-label { |
| | | font-size: 14px; |
| | | color: #334155; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | width: 100%; |
| | | text-align: center; |
| | | font-weight: 600; |
| | | } |
| | | .signal-light { |
| | | width: 32px; |
| | | height: 32px; |
| | | border-radius: 50%; |
| | | box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15); |
| | | transition: all 0.3s ease; |
| | | position: relative; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .signal-light-inner { |
| | | width: 14px; |
| | | height: 14px; |
| | | border-radius: 50%; |
| | | background: white; |
| | | opacity: 0.9; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .signal-active { |
| | | background: linear-gradient(135deg, #10b981 0%, #059669 100%); |
| | | box-shadow: 0 0 18px rgba(16, 185, 129, 0.7); |
| | | animation: pulse 2s infinite; |
| | | } |
| | | .signal-inactive { |
| | | background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); |
| | | } |
| | | @keyframes pulse { |
| | | 0% { |
| | | box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8); |
| | | } |
| | | 70% { |
| | | box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); |
| | | } |
| | | 100% { |
| | | box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); |
| | | } |
| | | } |
| | | |
| | | /* èªå®ä¹å¤éæ¡æ ·å¼ - æ¾å¤§ ç¹å»åºåæ´å¤§ */ |
| | | .checkbox-container { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 6px; |
| | | cursor: pointer; |
| | | font-size: 14px; |
| | | color: #334155; |
| | | flex-shrink: 0; |
| | | } |
| | | .part-checkbox { |
| | | display: none; |
| | | } |
| | | .checkmark { |
| | | width: 22px; |
| | | height: 22px; |
| | | background-color: #f1f5f9; |
| | | border: 1px solid #cbd5e1; |
| | | border-radius: 4px; |
| | | transition: all 0.2s ease; |
| | | position: relative; |
| | | } |
| | | .part-checkbox:checked ~ .checkmark { |
| | | background-color: #3b82f6; |
| | | border-color: #3b82f6; |
| | | } |
| | | .checkmark:after { |
| | | content: ""; |
| | | position: absolute; |
| | | display: none; |
| | | left: 7px; |
| | | top: 2px; |
| | | width: 6px; |
| | | height: 12px; |
| | | border: solid white; |
| | | border-width: 0 3px 3px 0; |
| | | transform: rotate(45deg); |
| | | } |
| | | .part-checkbox:checked ~ .checkmark:after { |
| | | display: block; |
| | | } |
| | | .checkbox-label { |
| | | font-size: 13px; |
| | | color: #475569; |
| | | width: 50px; |
| | | } |
| | | |
| | | /* ååºå¼éé
*/ |
| | | @media (max-width: 1200px) { |
| | | .container { |
| | | flex-direction: column; |
| | | height: auto; |
| | | } |
| | | .left-area, |
| | | .right-area { |
| | | width: 100%; |
| | | flex: none; |
| | | } |
| | | .btn-signal-group { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | .signal-status { |
| | | width: 100%; |
| | | justify-content: flex-start; |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .form-row { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | height: auto; |
| | | line-height: normal; |
| | | } |
| | | .label, |
| | | .short-label { |
| | | width: 100%; |
| | | text-align: left; |
| | | margin-bottom: 6px; |
| | | } |
| | | .input-box { |
| | | width: 100%; |
| | | } |
| | | .short-input { |
| | | width: 100% !important; |
| | | } |
| | | .btn { |
| | | width: 100%; |
| | | margin-top: 6px; |
| | | } |
| | | .btn-group { |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | width: 100%; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | footer: "Foots", |
| | | cnName: "ç»çä¿¡æ¯", |
| | | name: "boxing", |
| | | url: "/boxing/", |
| | | sortName: "createDate", |
| | | url: "/boxing/", |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | palletCode: "", |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | }); |
| | |
| | | field: "palletCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | link: true, |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æåç¼å·", |
| | | field: "productCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | } |
| | | require: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true |
| | | } |
| | | ] |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | const searchFormFields = ref({ |
| | |
| | | field: "palletCode", |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | type: "string", |
| | | link: true, |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | ]); |
| | | |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "", |
| | | cnName: "ç»ç详ç»ä¿¡æ¯", |
| | | table: "boxingDetail", |
| | | columns: [ |
| | | { |
| | | field: "boxingId", |
| | | title: "ç»çID", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "componentCode", |
| | | title: "é¶ä»¶ç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "componentName", |
| | | title: "é¶ä»¶åç§°", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | ], |
| | | sortName: "createDate", |
| | | key: "id", |
| | | }); |
| | | |
| | | return { |
| | |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | </script> |
| | |
| | | footer: "Foots", |
| | | cnName: "é
æ¹ä¿¡æ¯", |
| | | name: "formula", |
| | | url: "/formula/", |
| | | sortName: "createDate", |
| | | url: "/formula/", |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | productCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | productLength: 0, |
| | | productWidth: 0, |
| | |
| | | yDirectionHeight2: 0, |
| | | xDirectionDistance3: 0, |
| | | yDirectionHeight3: 0, |
| | | }); |
| | | |
| | | }); |
| | | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | |
| | | field: "productCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | }, |
| | | { |
| | | title: "åè£
ä½äº§åé¿åº¦", |
| | | field: "productLength", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "åè£
ä½äº§å宽度", |
| | | field: "productWidth", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "åè£
ä½äº§åé«åº¦", |
| | | field: "productHeight", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "åè£
使§ç´§ä¸éé«åº¦", |
| | | field: "screwDownsetDistance", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "åè£
使§ç´§æå", |
| | | field: "screwTorqueOutput", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "åè£
ä½èªå¨æ§ç´§æå¼", |
| | | field: "dintAutoScrewOn", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "æ£æµä½Xåç§»è·ç¦»1", |
| | | field: "xDirectionDistance1", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ£æµä½Zé«åº¦1", |
| | | field: "yDirectionHeight1", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "æ£æµä½Xåç§»è·ç¦»2", |
| | | field: "xDirectionDistance2", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "æ£æµä½Zé«åº¦2", |
| | | field: "yDirectionHeight2", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ£æµä½Xåç§»è·ç¦»3", |
| | | field: "xDirectionDistance3", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "æ£æµä½Zé«åº¦3", |
| | | field: "yDirectionHeight3", |
| | | type: "number", |
| | | width: 200, |
| | | require: false |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "主é®ID", |
| | |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true |
| | | } |
| | | ] |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | const searchFormFields = ref({ |
| | |
| | | field: "productCode", |
| | | title: "æåç¼å·", |
| | | type: "string", |
| | | link: true, |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productLength", |
| | | title: "åè£
ä½äº§åé¿åº¦", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productWidth", |
| | | title: "åè£
ä½äº§å宽度", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productHeight", |
| | | title: "åè£
ä½äº§åé«åº¦", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "screwDownsetDistance", |
| | | title: "åè£
使§ç´§ä¸éé«åº¦", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "screwTorqueOutput", |
| | | title: "åè£
使§ç´§æå", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "dintAutoScrewOn", |
| | | title: "åè£
ä½èªå¨æ§ç´§æå¼", |
| | | type: "int", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "xDirectionDistance1", |
| | | title: "æ£æµä½Xåç§»è·ç¦»1", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "yDirectionHeight1", |
| | | title: "æ£æµä½Zé«åº¦1", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "xDirectionDistance2", |
| | | title: "æ£æµä½Xåç§»è·ç¦»2", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "yDirectionHeight2", |
| | | title: "æ£æµä½Zé«åº¦2", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "xDirectionDistance3", |
| | | title: "æ£æµä½Xåç§»è·ç¦»3", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "yDirectionHeight3", |
| | | title: "æ£æµä½Zé«åº¦3", |
| | | type: "float", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "", |
| | | cnName: "é¶ä»¶è¯¦ç»ä¿¡æ¯", |
| | | table: "componentDetail", |
| | | columns: [ |
| | | { |
| | | field: "formulaId", |
| | | title: "ID", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "componentCode", |
| | | title: "é¶ä»¶ç¼å·", |
| | | type: "string", |
| | | width: 120, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "componentName", |
| | | title: "é¶ä»¶åç§°", |
| | | type: "string", |
| | | width: 150, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | sortName: "createDate", |
| | | key: "id", |
| | | }); |
| | | |
| | | return { |
| | |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | </script> |
| | |
| | | footer: "Foots", |
| | | cnName: "é
æ¹ä¿¡æ¯è¯¦æ
", |
| | | name: "formulaDetail", |
| | | url: "/formulaDetail/", |
| | | sortName: "createDate", |
| | | url: "/formulaDetail/", |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | formulaId: "", |
| | | formulaId: "", |
| | | componentCode: "", |
| | | componentName: "", |
| | | }); |
| | | |
| | | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | |
| | | field: "formulaId", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "é¶ä»¶ç¼å·", |
| | | field: "componentCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "é¶ä»¶åç§°", |
| | | field: "componentName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | } |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true |
| | | } |
| | | ] |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | const searchFormFields = ref({ |
| | |
| | | { title: "é
æ¹ä¿¡æ¯ä¸»é®", field: "formulaId", type: "int" }, |
| | | { title: "é¶ä»¶ç¼å·", field: "componentCode", type: "like" }, |
| | | { title: "é¶ä»¶åç§°", field: "componentName", type: "like" }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | |
| | | <script> |
| | | import extend from "@/extension/basicinfo/processInfoDetail.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "å 工信æ¯è¯¦æ
", |
| | | name: "processInfoDetail", |
| | | url: "/processInfoDetail/", |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | }); |
| | | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | field: "palletCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æåç¼å·", |
| | | field: "productCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "主é®ID", |
| | | field: "id", |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | productCode: "", |
| | | productName: "", |
| | | creater: "", |
| | | createDate: "", |
| | | }); |
| | | |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "å·¥è£
æ¿ç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like" }, |
| | | { title: "æååç§°", field: "productName", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "åºå·", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "å·¥è£
æ¿ç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productCode", |
| | | title: "æåç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | |
| | | const detail = ref({ |
| | | cnName: "", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "", |
| | | }); |
| | | |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | |
| | | <script> |
| | | import extend from "@/extension/basicinfo/scanStation.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ref, defineComponent, onMounted } from "vue"; |
| | | import axios from "axios"; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | // å
¨å±ä¸ææ°æ®æºåé - ææä¸ææ¡å
±ç¨ï¼ä¸å¤èµå¼ï¼ä¸å¤å¤ç¨ |
| | | const stationEndProductList = ref([]); |
| | | |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "æ«æå·¥ä½", |
| | | name: "scanStation", |
| | | url: "/scanStation/", |
| | | sortName: "createDate", |
| | | url: "/scanStation/", |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | stationCode: "", |
| | | stationCode: "", |
| | | stationName: "", |
| | | stationEndProduct: "", |
| | | stationComponentQty: "", |
| | | stationComponent1: "", |
| | | stationComponent2: "", |
| | | stationComponent3: "", |
| | | stationComponent4: "", |
| | | stationComponent5: "", |
| | | stationComponent6: "", |
| | | stationComponent7: "", |
| | | stationComponent8: "", |
| | | stationComponent9: "", |
| | | stationComponent10: "", |
| | | }); |
| | | |
| | | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | |
| | | field: "stationCode", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | require: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ç«å°åç§°", |
| | | field: "stationName", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | require: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ç«å°æå", |
| | | field: "stationEndProduct", |
| | | type: "input", |
| | | type: "select", |
| | | data: stationEndProductList, // ç»å®å
¨å±æ¥å£æ°æ® |
| | | width: 200, |
| | | require: false |
| | | } |
| | | require: false, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "é¶ä»¶æ°é", |
| | | field: "stationComponentQty", |
| | | type: "input", |
| | | width: 200, |
| | | require: true |
| | | }, |
| | | { |
| | | title: "é¶ä»¶1", |
| | | field: "stationComponent1", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "é¶ä»¶2", |
| | | field: "stationComponent2", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "é¶ä»¶3", |
| | | field: "stationComponent3", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "é¶ä»¶4", |
| | | field: "stationComponent4", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "é¶ä»¶5", |
| | | field: "stationComponent5", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "é¶ä»¶6", |
| | | field: "stationComponent6", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "é¶ä»¶7", |
| | | field: "stationComponent7", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "é¶ä»¶8", |
| | | field: "stationComponent8", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | } |
| | | ], |
| | | [ |
| | | { |
| | | title: "é¶ä»¶9", |
| | | field: "stationComponent9", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "é¶ä»¶10", |
| | | field: "stationComponent10", |
| | | type: "input", |
| | | width: 200, |
| | | require: false |
| | | }, |
| | | { |
| | | title: "主é®ID", |
| | | field: "id", |
| | | type: "input", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true |
| | | } |
| | | ] |
| | | readonly: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | const searchFormFields = ref({ |
| | |
| | | [ |
| | | { title: "ç«å°ç¼å·", field: "stationCode", type: "like" }, |
| | | { title: "ç«å°åç§°", field: "stationName", type: "like" }, |
| | | { title: "ç«å°æå", field: "stationEndProduct", type: "like" }, |
| | | { |
| | | title: "ç«å°æå", |
| | | field: "stationEndProduct", |
| | | type: "select-search", |
| | | data: stationEndProductList, // ç»å®å
¨å±æ¥å£æ°æ® |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | |
| | | { |
| | | field: "stationEndProduct", |
| | | title: "ç«å°æå", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponentQty", |
| | | title: "é¶ä»¶æ°é", |
| | | type: "int", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent1", |
| | | title: "é¶ä»¶1", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent2", |
| | | title: "é¶ä»¶2", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent3", |
| | | title: "é¶ä»¶3", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent4", |
| | | title: "é¶ä»¶4", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent5", |
| | | title: "é¶ä»¶5", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent6", |
| | | title: "é¶ä»¶6", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent7", |
| | | title: "é¶ä»¶7", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent8", |
| | | title: "é¶ä»¶8", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent9", |
| | | title: "é¶ä»¶9", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stationComponent10", |
| | | title: "é¶ä»¶10", |
| | | type: "string", |
| | | type: "select", |
| | | bind: { |
| | | key: "value", |
| | | data: stationEndProductList, // ç»å®å
¨å±æ¥å£æ°æ® |
| | | }, |
| | | link: true, |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | key: "", |
| | | }); |
| | | |
| | | const getStationEndProductData = async () => { |
| | | try { |
| | | const res = await axios.get("/api/formula/getEndProductList"); |
| | | stationEndProductList.value = (res.data?.data || []).map( |
| | | (item) => item || { key: "", value: "", disabled: false } |
| | | ); |
| | | } catch (error) { |
| | | stationEndProductList.value = []; |
| | | console.error("è·åç«å°æåæ°æ®å¤±è´¥ï¼", error); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getStationEndProductData(); |
| | | }); |
| | | |
| | | return { |
| | | table, |
| | | extend, |
| | |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | </script> |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | | { |
| | | public class BoxingDetailService : ServiceBase<Dt_BoxingDetail, IRepository<Dt_BoxingDetail>>, IBoxingDetailService |
| | | { |
| | | public BoxingDetailService(IRepository<Dt_BoxingDetail> BaseDal) : base(BaseDal) |
| | | |
| | | private readonly IBoxingService _boxingService; |
| | | private readonly IFormulaService _formulaService; |
| | | private readonly IFormulaDetailService _formulaDetailService; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | | public BoxingDetailService( |
| | | IRepository<Dt_BoxingDetail> BaseDal, |
| | | IFormulaService formulaService, |
| | | IBoxingService boxingService, |
| | | IFormulaDetailService formulaDetailService, |
| | | IUnitOfWorkManage unitOfWorkManage |
| | | ) : base(BaseDal) |
| | | { |
| | | _formulaService = formulaService; |
| | | _boxingService = boxingService; |
| | | _formulaDetailService = formulaDetailService; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | |
| | | public IRepository<Dt_BoxingDetail> Repository => BaseDal; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¯è¾é¶ä»¶æ¯å¦é½å
¨ |
| | |
| | | { |
| | | 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(); |
| | | } |
| | | |
| | | List<string> BoxingIdList = new List<string>(); |
| | | List<string> FormulaIdList = new List<string>(); |
| | | |
| | | for (int i = 0; i < boxingDetails.Count; i++) |
| | | /// <summary> |
| | | /// æ£æ¥é¶ä»¶ |
| | | /// </summary> |
| | | /// <param name="boxingDetails"></param> |
| | | /// <param name="formulaDetails"></param> |
| | | /// <returns></returns> |
| | | public string IsComponentCodesEqual(List<string> boxingDetails, List<string> formulaDetails) |
| | | { |
| | | // å¤çnulléåï¼è§é¿ç©ºæéå¼å¸¸ |
| | | var boxList = boxingDetails ?? new List<string>(); |
| | | var formulaList = formulaDetails ?? new List<string>(); |
| | | |
| | | var validBoxCodes = boxList.Where(code => !string.IsNullOrEmpty(code)).ToList(); |
| | | var validFormulaCodes = formulaList.Where(code => !string.IsNullOrEmpty(code)).ToList(); |
| | | |
| | | foreach (var group in validBoxCodes.GroupBy(code => code)) |
| | | { |
| | | BoxingIdList.Add(boxingDetails[i].ComponentCode); |
| | | FormulaIdList.Add(formulaDetails[i].ComponentCode); |
| | | } |
| | | BoxingIdList.Sort(); |
| | | FormulaIdList.Sort(); |
| | | string componentCode = group.Key; |
| | | int boxCount = group.Count(); |
| | | int formulaCount = validFormulaCodes.Count(code => code == componentCode); |
| | | |
| | | for (int i = 0; i < BoxingIdList.Count; i++) |
| | | { |
| | | if (BoxingIdList[i] != FormulaIdList[i]) |
| | | if (formulaCount == 0 || formulaCount < boxCount) |
| | | { |
| | | return false; |
| | | return componentCode; |
| | | } |
| | | } |
| | | return true; |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ·»å /ä¿®æ¹ç»çä¿¡æ¯ï¼ä¸ä½åæ¥å£ï¼ä¼ å·¥è£
æ¿ç¼å·åå¨åä¿®æ¹ï¼ä¸åå¨åæ°å¢ï¼ |
| | | /// </summary> |
| | | /// <param name="toolingBoardSubmitDto"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent SaveToolingBoardNo(ToolingBoardSubmitDto toolingBoardSubmitDto) |
| | | { |
| | | using (var uow = _unitOfWorkManage.CreateUnitOfWork()) |
| | | { |
| | | try |
| | | { |
| | | // 1. åæ°æ ¡éª |
| | | if (toolingBoardSubmitDto == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æäº¤åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | string palletCode = toolingBoardSubmitDto.ToolingBoardNo?.Trim(); |
| | | string productCode = toolingBoardSubmitDto.FinishedProductCode?.Trim(); |
| | | if (string.IsNullOrWhiteSpace(palletCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error("å·¥è£
æ¿ç¼å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (string.IsNullOrWhiteSpace(productCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error("æåç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // 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() |
| | | { |
| | | 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(msg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine($"ä¿åå·¥è£
æ¿ç»çä¿¡æ¯å¼å¸¸ï¼{ex.Message}ï¼å æ ï¼{ex.StackTrace}"); |
| | | return WebResponseContent.Instance.Error($"æäº¤å¤±è´¥ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åæåç¼å·åé¶ä»¶ç¼å· |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetProductAndPartsByBoardNo(string palletCode) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(palletCode)) |
| | | { |
| | | return WebResponseContent.Instance.OK("æ¥è¯¢æå", new |
| | | { |
| | | finishedProductCode = "", |
| | | partsList = Enumerable.Repeat("", 10).ToList() |
| | | }); |
| | | } |
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (dt_Boxing == null) |
| | | { |
| | | return WebResponseContent.Instance.OK("æªæ¥è¯¢å°è¯¥å·¥è£
æ¿å¯¹åºçæåä¿¡æ¯", new |
| | | { |
| | | finishedProductCode = "", |
| | | partsList = Enumerable.Repeat("", 10).ToList() |
| | | }); |
| | | } |
| | | List<Dt_BoxingDetail> dt_BoxingDetails = BaseDal.QueryData(x => x.BoxingId == dt_Boxing.Id)?.ToList() ?? new List<Dt_BoxingDetail>(); |
| | | // åé¶ä»¶ç¼å· |
| | | List<string> partsList = dt_BoxingDetails.Select(d => d.ComponentCode).ToList(); |
| | | List<string> resultPartsList = new List<string>(); |
| | | for (int i = 0; i < 10; i++) |
| | | { |
| | | if (i < partsList.Count) |
| | | { |
| | | resultPartsList.Add(partsList[i] ?? ""); |
| | | } |
| | | else |
| | | { |
| | | resultPartsList.Add(""); |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.OK("é¶ä»¶ç¼å·å表æ¥è¯¢æå", new |
| | | { |
| | | finishedProductCode = dt_Boxing.ProductCode ?? "", |
| | | partsList = resultPartsList |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¥è¯¢é¶ä»¶ç¼å·å表å¼å¸¸ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | |
| | | } |
| | | |
| | | public IRepository<Dt_FormulaDetail> Repository => BaseDal; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | Id = saveModel.MainData["id"].ObjToInt(), |
| | | ProductCode = saveModel.MainData["productCode"].ToString(), |
| | | ProductName = saveModel.MainData["productName"].ToString(), |
| | | ProductLength = float.Parse(saveModel.MainData["productLength"].ToString()), |
| | | ProductWidth = float.Parse(saveModel.MainData["productWidth"].ToString()), |
| | | ProductHeight = float.Parse(saveModel.MainData["productHeight"].ToString()), |
| | | ScrewDownsetDistance = float.Parse(saveModel.MainData["screwDownsetDistance"].ToString()), |
| | | ScrewTorqueOutput = float.Parse(saveModel.MainData["screwTorqueOutput"].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 = float.Parse(saveModel.MainData["xDirectionDistance1"].ToString()), |
| | | YDirectionHeight1 = float.Parse(saveModel.MainData["yDirectionHeight1"].ToString()), |
| | | XDirectionDistance2 = float.Parse(saveModel.MainData["xDirectionDistance2"].ToString()), |
| | | YDirectionHeight2 = float.Parse(saveModel.MainData["yDirectionHeight2"].ToString()), |
| | | XDirectionDistance3 = float.Parse(saveModel.MainData["xDirectionDistance3"].ToString()), |
| | | YDirectionHeight3 = float.Parse(saveModel.MainData["yDirectionHeight3"].ToString()) |
| | | 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()) |
| | | |
| | | //ScrewTorque = float.Parse(saveModel.MainData["ScrewTorque"].ToString()), |
| | | //UpdateBy = saveModel.UpdateBy, |
| | |
| | | { |
| | | return base.UpdateData(entity); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åç«å°æå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent getEndProductList() |
| | | { |
| | | try |
| | | { |
| | | List<Dt_Formula> dt_Formulas = BaseDal.QueryData(x => 1 == 1); |
| | | var resultList = dt_Formulas.Select(item => new |
| | | { |
| | | key = item.ProductCode, |
| | | value = item.ProductCode |
| | | }).ToList(); |
| | | return WebResponseContent.Instance.OK("æ¥è¯¢ç«å°æåæå", resultList); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¥è¯¢ç«å°æå失败ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | | { |
| | | |
| | | public class ProcessInfoDetailService : ServiceBase<Dt_ProcessInfoDetail, IRepository<Dt_ProcessInfoDetail>>, IProcessInfoDetailService |
| | | { |
| | | public ProcessInfoDetailService(IRepository<Dt_ProcessInfoDetail> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public IRepository<Dt_ProcessInfoDetail> Repository => BaseDal; |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using OfficeOpenXml; |
| | | using Spire.Xls; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | |
| | | } |
| | | |
| | | 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 System; |
| | | using Autofac.Core; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.PLCEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | | { |
| | | public class ScanStationService : ServiceBase<Dt_ScanStation, IRepository<Dt_ScanStation>>, IScanStationService |
| | | { |
| | | public ScanStationService(IRepository<Dt_ScanStation> BaseDal) : base(BaseDal) |
| | | private readonly IFormulaService _formulaService; |
| | | private readonly IFormulaDetailService _formulaDetailService; |
| | | |
| | | public ScanStationService(IRepository<Dt_ScanStation> BaseDal, |
| | | IFormulaService formulaService, |
| | | IFormulaDetailService formulaDetailService |
| | | ) : base(BaseDal) |
| | | { |
| | | _formulaService = formulaService; |
| | | _formulaDetailService = formulaDetailService; |
| | | } |
| | | |
| | | public IRepository<Dt_ScanStation> Repository => BaseDal; |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¯å¨PLC |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | /// <summary> |
| | | public WebResponseContent StartPLC(bool isStop) |
| | | { |
| | | try |
| | | { |
| | | 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设å¤é讯å¼å¸¸"); |
| | | if (isStop) |
| | | { |
| | | device.SetValue(W_PLCDBName.wboolAutoStart, false); |
| | | //æåä¿¡å· |
| | | device.SetValue(W_PLCDBName.wboolAutoPause, false); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | var Heart = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolHeart); |
| | | var EMG = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolEMG); |
| | | var OnlineExecuting = device.GetValue<R_PLCDBName, bool>(R_PLCDBName.rboolOnlineExecuting); |
| | | 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); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | return WebResponseContent.Instance.Error("设å¤ä¸æ¯å¨çº¿ç¶æ"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æå/æ¢å¤PLCï¼ååæ§å¶ï¼ |
| | | /// </summary> |
| | | /// <param name="isPause">æ¯å¦ä¸ºæåæä½ï¼true=æåï¼false=æ¢å¤</param> |
| | | /// <returns>ç»ä¸æ ¼å¼çååºç»æ</returns> |
| | | public WebResponseContent PausePLC(bool isPause) |
| | | { |
| | | try |
| | | { |
| | | 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设å¤é讯å¼å¸¸"); |
| | | |
| | | 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)) |
| | | { |
| | | return WebResponseContent.Instance.Error("è®¾å¤æªå¯å¨"); |
| | | } |
| | | |
| | | if (!Heart || EMG || Error) |
| | | { |
| | | return WebResponseContent.Instance.Error("设å¤ç¶æå¼å¸¸ï¼æ æ³æ§è¡æå/æ¢å¤æä½"); |
| | | } |
| | | device.SetValue(W_PLCDBName.wboolAutoPause, isPause); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¿åä¿¡å· |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public WebResponseContent GetSignalStates() |
| | | { |
| | | 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设å¤é讯å¼å¸¸"); |
| | | |
| | | //è·åä¿¡å·ç¯ç¶æ |
| | | 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); |
| | | |
| | | //è·åå¯å¨æåç¶æ |
| | | var IsStarted = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolAutoStart); |
| | | var IsPaused = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolAutoPause); |
| | | |
| | | //è¿å对象 |
| | | var responseData = new |
| | | { |
| | | // ä¿¡å·ç¯ç¶ææ°ç»ï¼ä¿æåæé¡ºåºï¼ |
| | | signalStates = new bool[] { Heart, EMG, AutoExecuting, OnlineExecuting, Error }, |
| | | // PLCå¯å¨/æåç¶æå¯¹è±¡ |
| | | plcStatus = new |
| | | { |
| | | isStarted = IsStarted, |
| | | isPaused = IsPaused |
| | | } |
| | | }; |
| | | return WebResponseContent.Instance.OK(data: responseData); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetLeftInitialData() |
| | | { |
| | | try |
| | | { |
| | | Dt_ScanStation dt_ScanStation = BaseDal.QueryFirst(x => x.StationCode == "001"); |
| | | if (dt_ScanStation == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°å·¥ä½ç¼ç 为001çå·¥ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_ScanStation.StationEndProduct); |
| | | if (dt_Formula == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æåç¼å·ã{dt_ScanStation.StationEndProduct}ã对åºçé
æ¹ä¿¡æ¯"); |
| | | } |
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == dt_Formula.Id); |
| | | |
| | | var responseData = new |
| | | { |
| | | finishedProductId = dt_Formula.Id, |
| | | finishedProduct = dt_Formula.ProductCode, |
| | | leftPartCodes = new List<string>(), |
| | | leftPartIds = new List<int>(), |
| | | leftPartChecked = new List<int>() |
| | | }; |
| | | |
| | | foreach (var detail in dt_FormulaDetails.Take(10)) |
| | | { |
| | | responseData.leftPartCodes.Add(detail.ComponentCode ?? ""); |
| | | responseData.leftPartIds.Add(detail.Id); |
| | | responseData.leftPartChecked.Add(detail.IsScanned); |
| | | } |
| | | |
| | | int needFillCount = 10 - responseData.leftPartCodes.Count; |
| | | for (int i = 0; i < needFillCount; i++) |
| | | { |
| | | responseData.leftPartCodes.Add(""); |
| | | responseData.leftPartIds.Add(0); |
| | | responseData.leftPartChecked.Add(0); |
| | | } |
| | | return WebResponseContent.Instance.OK("è·å左侧åå§æ°æ®æå", responseData); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è·å左侧åå§æ°æ®å¤±è´¥ï¼è¯·ç¨åéè¯ã{ex.Message}ã"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°æ¯å¦æ«ç |
| | | /// </summary> |
| | | /// <param name="updatePartScannedStatusRequest"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpdatePartScannedStatus(UpdatePartScannedStatusRequest updatePartScannedStatusRequest) |
| | | { |
| | | try |
| | | { |
| | | Dt_FormulaDetail dt_FormulaDetail = _formulaDetailService.Repository.QueryFirst(x => x.Id == updatePartScannedStatusRequest.Id); |
| | | dt_FormulaDetail.IsScanned = updatePartScannedStatusRequest.IsScanned; |
| | | bool flag = _formulaDetailService.Repository.UpdateData(dt_FormulaDetail); |
| | | if (flag) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | return WebResponseContent.Instance.Error("æ´æ°é误"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="1.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.11" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEAWCS_IBasicInfoService\WIDESEAWCS_IBasicInfoService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Reference Include="Spire.XLS"> |
| | | <HintPath>Spire.XLS.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| ÎļþÃû´Ó ´úÂë¹ÜÀí/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Tasks/R_PLCDBName.cs ÐÞ¸Ä |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | namespace WIDESEAWCS_Common.PLCEnum |
| | | { |
| | | public enum R_PLCDBName |
| | | { |
| ÎļþÃû´Ó ´úÂë¹ÜÀí/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Tasks/W_PLCDBName.cs ÐÞ¸Ä |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | namespace WIDESEAWCS_Common.PLCEnum |
| | | { |
| | | public enum W_PLCDBName |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_DTO.BasicInfo |
| | | { |
| | | public class ToolingBoardSubmitDto |
| | | { |
| | | /// <summary> |
| | | /// å·¥è£
æ¿ç¼å· (å¿
å¡«) |
| | | /// </summary> |
| | | public string ToolingBoardNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåç¼å· (å¿
å¡«) |
| | | /// </summary> |
| | | public string FinishedProductCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶å表(åºå®10个ï¼å¯¹åºé¶ä»¶1~é¶ä»¶10ï¼ç©ºåä¼ ç©ºå符串) |
| | | /// </summary> |
| | | public List<string> PartsList { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_DTO.BasicInfo |
| | | { |
| | | public class UpdatePartScannedStatusRequest |
| | | { |
| | | /// <summary> |
| | | /// é¶ä»¶æ°æ®åºä¸»é®ID |
| | | /// </summary> |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ«ç |
| | | /// </summary> |
| | | public int IsScanned { get; set; } |
| | | } |
| | | |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | |
| | | |
| | | //æ¯è¾é¶ä»¶æ¯å¦é½å
¨ |
| | | public bool IsComponentCodesEqual(List<Dt_BoxingDetail> boxingDetails, List<Dt_FormulaDetail> formulaDetails); |
| | | |
| | | //æ·»å ç»çä¿¡æ¯ |
| | | public WebResponseContent SaveToolingBoardNo(ToolingBoardSubmitDto toolingBoardSubmitDto); |
| | | //è·åæåç¼å·åé¶ä»¶ |
| | | public WebResponseContent GetProductAndPartsByBoardNo(string palletCode); |
| | | } |
| | | } |
| | |
| | | { |
| | | public IRepository<Dt_FormulaDetail> Repository { get; } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | public interface IFormulaService : IService<Dt_Formula> |
| | | { |
| | | public IRepository<Dt_Formula> Repository { get; } |
| | | |
| | | //è·åç«å°æå |
| | | public WebResponseContent getEndProductList(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_IBasicInfoService |
| | | { |
| | | public interface IProcessInfoDetailService : IService<Dt_ProcessInfoDetail> |
| | | { |
| | | public IRepository<Dt_ProcessInfoDetail> Repository { get; } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | public interface IProcessInfoService : IService<Dt_ProcessInfo> |
| | | { |
| | | public IRepository<Dt_ProcessInfo> Repository { get; } |
| | | |
| | | // ä¸è½½æµç¨å¡ |
| | | public WebResponseContent ExportData(Dt_ProcessInfo dt_ProcessInfo); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | |
| | | public interface IScanStationService : IService<Dt_ScanStation> |
| | | { |
| | | public IRepository<Dt_ScanStation> Repository { get; } |
| | | |
| | | //å¯å¨PLC |
| | | public WebResponseContent StartPLC(bool isStop); |
| | | |
| | | //æåPLC |
| | | public WebResponseContent PausePLC(bool isPause); |
| | | |
| | | //è¿åä¿¡å· |
| | | public WebResponseContent GetSignalStates(); |
| | | |
| | | //è·åæåä¿¡æ¯ |
| | | public WebResponseContent GetLeftInitialData(); |
| | | //æ´æ°æ«ç ç¶æ |
| | | public WebResponseContent UpdatePartScannedStatus(UpdatePartScannedStatusRequest updatePartScannedStatusRequest); |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// åè£
ä½äº§åé¿åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
ä½äº§åé¿åº¦")] |
| | | public float ProductLength { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits =2, ColumnDescription = "åè£
ä½äº§åé¿åº¦")] |
| | | public decimal ProductLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½äº§å宽度 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
ä½äº§å宽度")] |
| | | public float ProductWidth { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½äº§å宽度")] |
| | | public decimal ProductWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½äº§åé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
ä½äº§åé«åº¦")] |
| | | public float ProductHeight { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½äº§åé«åº¦")] |
| | | public decimal ProductHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§ä¸éé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
使§ç´§ä¸éé«åº¦")] |
| | | public float ScrewDownsetDistance { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§ä¸éé«åº¦")] |
| | | public decimal ScrewDownsetDistance { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
使§ç´§æå")] |
| | | public float ScrewTorqueOutput { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æå")] |
| | | public decimal ScrewTorqueOutput { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½èªå¨æ§ç´§æå¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
ä½èªå¨æ§ç´§æå¼")] |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½èªå¨æ§ç´§æå¼")] |
| | | public int DintAutoScrewOn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»1 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»1")] |
| | | public float XDirectionDistance1 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»1")] |
| | | public decimal XDirectionDistance1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦1 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµä½Zé«åº¦1")] |
| | | public float YDirectionHeight1 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Zé«åº¦1")] |
| | | public decimal YDirectionHeight1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»2 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»2")] |
| | | public float XDirectionDistance2 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»2")] |
| | | public decimal XDirectionDistance2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦2 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµä½Zé«åº¦2")] |
| | | public float YDirectionHeight2 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Zé«åº¦2")] |
| | | public decimal YDirectionHeight2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Xåç§»è·ç¦»3 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»3")] |
| | | public float XDirectionDistance3 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Xåç§»è·ç¦»3")] |
| | | public decimal XDirectionDistance3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµä½Zé«åº¦3 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµä½Zé«åº¦3")] |
| | | public float YDirectionHeight3 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ£æµä½Zé«åº¦3")] |
| | | public decimal YDirectionHeight3 { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)]//ä¸å䏿°æ®åºæ å°ï¼æµè¯ä½¿ç¨ |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_FormulaDetail.FormulaId), nameof(Id))] |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "é¶ä»¶åç§°")] |
| | | public string ComponentName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ«ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "æ¯å¦æ«ç ")] |
| | | public int IsScanned { get; set; } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// æåå¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æåå¼")] |
| | | public float TorsioValue { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æåå¼")] |
| | | public decimal TorsioValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå弿 å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æå弿 å")] |
| | | public float TorsioValueStandard { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æå弿 å")] |
| | | public decimal TorsioValueStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº¦å¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "å度å¼")] |
| | | public float StiffnessValue { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "å度å¼")] |
| | | public decimal StiffnessValue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº¦å¼æ å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ååº¦å¼æ å")] |
| | | public float StiffnessValueStandard { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "ååº¦å¼æ å")] |
| | | public decimal StiffnessValueStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµè¯ç»æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æµè¯ç»æ")] |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æµè¯ç»æ")] |
| | | public int TestResult { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
ä½ä¸åæ£æµé«åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
ä½ä¸åæ£æµé«åº¦")] |
| | | public float PressHeight { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
ä½ä¸åæ£æµé«åº¦")] |
| | | public decimal PressHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æ£æµæå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
使§ç´§æ£æµæå")] |
| | | public float ScrewTorque { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æ£æµæå")] |
| | | public decimal ScrewTorque { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè£
使§ç´§æ£æµè§åº¦ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åè£
使§ç´§æ£æµè§åº¦")] |
| | | public float ScrewAngle { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "åè£
使§ç´§æ£æµè§åº¦")] |
| | | public decimal ScrewAngle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦1 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦1")] |
| | | public float Height1 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦1")] |
| | | public decimal Height1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦2 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦2")] |
| | | public float Height2 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦2")] |
| | | public decimal Height2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§ç´§ä½æ£æµé«åº¦3 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦3")] |
| | | public float Height3 { get; set; } |
| | | [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "æ§ç´§ä½æ£æµé«åº¦3")] |
| | | public decimal Height3 { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.DB.Models; |
| | | |
| | | namespace WIDESEAWCS_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_ProcessInfoDetail), "å 工信æ¯è¯¦æ
表")] |
| | | public class Dt_ProcessInfoDetail : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥è£
æ¿ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "å·¥è£
æ¿ç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æåç¼å·")] |
| | | public string ProductCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æååç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æååç§°")] |
| | | public string ProductName { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// ç«å°æå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç«å°æå")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°æå")] |
| | | public string StationEndProduct { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¶ä»¶æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "é¶ä»¶æ°é")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "é¶ä»¶æ°é")] |
| | | public int StationComponentQty { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" /> |
| | | <PackageReference Include="WIDESEAWCS_Core" Version="1.0.17" /> |
| | | <PackageReference Include="WIDESEAWCS_Core" Version="1.0.32" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "version": 1, |
| | | "isRoot": true, |
| | | "tools": {} |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_Server.Controllers.BoxingInfo |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | [HttpPost, Route("SaveToolingBoardNo"), AllowAnonymous] |
| | | public WebResponseContent SaveToolingBoardNo([FromBody] ToolingBoardSubmitDto toolingBoardSubmitDto) |
| | | { |
| | | return Service.SaveToolingBoardNo(toolingBoardSubmitDto); |
| | | } |
| | | |
| | | |
| | | [HttpGet, Route("GetProductAndPartsByBoardNo"), AllowAnonymous] |
| | | public WebResponseContent GetProductAndPartsByBoardNo([FromQuery] string palletCode) |
| | | { |
| | | return Service.GetProductAndPartsByBoardNo(palletCode); |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åç«å°æå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("getEndProductList"), AllowAnonymous] |
| | | public WebResponseContent getEndProductList() |
| | | { |
| | | return Service.getEndProductList(); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <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); |
| | | } |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | |
| | | namespace WIDESEAWCS_Server.Controllers.BasicInfo |
| | | { |
| | | /// <summary> |
| | | /// å å·¥ä¿¡æ¯ |
| | | /// </summary> |
| | | [Route("api/processInfoDetail")] |
| | | [ApiController] |
| | | public class ProcessInfoDetailController : ApiBaseController<IProcessInfoDetailService, Dt_ProcessInfoDetail> |
| | | { |
| | | public ProcessInfoDetailController(IProcessInfoDetailService service) : base(service) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_Server.Controllers.BasicInfo |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¯å¨PLC |
| | | /// </summary> |
| | | /// <param name="isStop"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("StartPLC"), AllowAnonymous] |
| | | public WebResponseContent StartPLC([FromQuery] bool isStop) |
| | | { |
| | | return Service.StartPLC(isStop); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æåPLC |
| | | /// </summary> |
| | | /// <param name="isPause"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("PausePLC"), AllowAnonymous] |
| | | public WebResponseContent PausePLC([FromQuery] bool isPause) |
| | | { |
| | | return Service.PausePLC(isPause); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åä¿¡å·ç¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("GetSignalStates"), AllowAnonymous] |
| | | public WebResponseContent GetSignalStates() |
| | | { |
| | | return Service.GetSignalStates(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åæåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("GetLeftInitialData"), AllowAnonymous] |
| | | public WebResponseContent GetLeftInitialData() |
| | | { |
| | | return Service.GetLeftInitialData(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°æ¯å¦æ«ç |
| | | /// </summary> |
| | | /// <param name="updatePartScannedStatusRequest"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("UpdatePartScannedStatus"), AllowAnonymous] |
| | | public WebResponseContent UpdatePartScannedStatus([FromBody] UpdatePartScannedStatusRequest updatePartScannedStatusRequest) |
| | | { |
| | | return Service.UpdatePartScannedStatus(updatePartScannedStatusRequest); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
| | | <LastUsedPlatform>Any CPU</LastUsedPlatform> |
| | | <PublishProvider>FileSystem</PublishProvider> |
| | | <PublishUrl>bin\Release\net6.0\publish\</PublishUrl> |
| | | <PublishUrl>F:\IIS\æå¨åæ\WCS</PublishUrl> |
| | | <WebPublishMethod>FileSystem</WebPublishMethod> |
| | | <_TargetId>Folder</_TargetId> |
| | | <SiteUrlToLaunchAfterPublish /> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ProjectGuid>487fa45b-ea1a-4aca-bb5b-0f6708f462c0</ProjectGuid> |
| | | <SelfContained>false</SelfContained> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEAWCS_IProductRecordServer\WIDESEAWCS_IProductRecordService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEAWCS_SystemServices\WIDESEAWCS_SystemServices.csproj" /> |
| | | <ProjectReference Include="..\WIDESEAWCs_TaskInfoService\WIDESEAWCs_TaskInfoService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEAWCS_Tasks\WIDESEAWCS_Tasks.csproj" /> |
| | |
| | | [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+86f5db51a5fd895dcae671d01b28cd0d4948af0e")] |
| | | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2eea48595c784d1d6d58d526f1da12427dfa0a25")] |
| | | [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfoService")] |
| | | [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfoService")] |
| | | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] |
| | |
| | | d4cf05aa7aa7ae843c211aeed38667b4957a26b93e653654b3b863537f1c7404 |
| | | c9c87e496556920f27ef09770ceb3d9cdc2a9b9b20ce0dfcd54bba65b5fd5b5e |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.ComponentModel;
|
| | | using System.Linq;
|
| | | using System.Reflection;
|
| | | using System.Text;
|
| | | using System.Threading.Tasks;
|
| | | using Autofac.Core;
|
| | | using HslCommunication;
|
| | | using HslCommunication.Core;
|
| | | using Microsoft.VisualBasic.FileIO;
|
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
|
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
|
| | | using System.Text;
|
| | | using Quartz;
|
| | | using SixLabors.ImageSharp.PixelFormats;
|
| | | using WIDESEAWCS_BasicInfoService;
|
| | | using WIDESEAWCS_Common.PLCEnum;
|
| | | using WIDESEAWCS_Communicator;
|
| | | using WIDESEAWCS_Core.BaseRepository;
|
| | | using WIDESEAWCS_Core.Helper;
|
| | | using WIDESEAWCS_IBasicInfoService;
|
| | | using WIDESEAWCS_Model.Models;
|
| | | using WIDESEAWCS_QuartzJob;
|
| | | using WIDESEAWCS_QuartzJob.DeviceBase;
|
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
|
| | |
|
| | | namespace WIDESEAWCS_Tasks
|
| | | {
|
| | |
| | | private readonly IFormulaService _formulaService;
|
| | | private readonly IFormulaDetailService _formulaDetailService;
|
| | | private readonly IProcessInfoService _processInfoService;
|
| | | private readonly IProcessInfoDetailService _processDetailInfoService;
|
| | | private readonly IUnitOfWorkManage _unitOfWorkManage;
|
| | | public PLCJob(IBoxingService boxingService, IBoxingDetailService boxingDetailService, IFormulaService formulaService, IFormulaDetailService formulaDetailService, IProcessInfoService processInfoService, IUnitOfWorkManage unitOfWorkManage)
|
| | | private readonly IScanStationService _scanStationService;
|
| | | //private readonly string PalletCode = "PL107";
|
| | |
|
| | | public PLCJob(IBoxingService boxingService,
|
| | | IBoxingDetailService boxingDetailService,
|
| | | IFormulaService formulaService,
|
| | | IFormulaDetailService formulaDetailService,
|
| | | IProcessInfoService processInfoService,
|
| | | IProcessInfoDetailService processDetailInfoService,
|
| | | IUnitOfWorkManage unitOfWorkManage,
|
| | | IScanStationService scanStationService
|
| | | )
|
| | | {
|
| | | _boxingService = boxingService;
|
| | | _boxingDetailService = boxingDetailService;
|
| | | _formulaService = formulaService;
|
| | | _formulaDetailService = formulaDetailService;
|
| | | _processInfoService = processInfoService;
|
| | | _processDetailInfoService = processDetailInfoService;
|
| | | _unitOfWorkManage = unitOfWorkManage;
|
| | | _scanStationService = scanStationService;
|
| | | }
|
| | | private readonly string set = "0x16,0x4D,0x0D,0x30,0x34,0x30,0x31,0x44,0x30,0x35,0x2E";//主æºåéè®¾ç½®æ«ææ¨¡å¼ä¸ºä¸»æºæ¨¡å¼çå½ä»¤,æ«æå¨è¿åæ¥æ¶å°çå½ä»¤å<ACK>ï¼0x06ï¼åï¼å°æ«ææ¨¡å¼æ´æ¹ä¸ºä¸»æºæ¨¡å¼
|
| | | private readonly string Text = "å¼å¯æ«ç ";//主æºåéè®¾ç½®æ«ææ¨¡å¼ä¸ºä¸»æºæ¨¡å¼çå½ä»¤,æ«æå¨è¿åæ¥æ¶å°çå½ä»¤å<ACK>ï¼0x06ï¼åï¼å°æ«ææ¨¡å¼æ´æ¹ä¸ºä¸»æºæ¨¡å¼
|
| | | private readonly string command = "0x16,0x54,0x0D";//åéå¼å§è§£ç å½ä»¤ï¼"0x16,0x55,0x0D"åéåæ¢è§£ç å½ä»¤
|
| | | public Task Execute(IJobExecutionContext context)
|
| | | {
|
| | |
|
| | | |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
|
| | | if (flag && value != null)
|
| | | {
|
| | |
| | | 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)
|
| | | {
|
| | | #region ä¸çº¿æ«ç
|
| | |
| | | var Location1ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation1ScanDone);
|
| | | if (Location1ScanStart && !Location1ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢ç»çæ°æ®ï¼å¤ææçç»å®æåæ¯å¦å·²ç»å®æææéé¶ä»¶
|
| | | {
|
| | | #region 串å£è¿æ¥
|
| | | SerialPortCommunicator portCommunicator1 = new SerialPortCommunicator("COM1", 9600, "ä¸çº¿æ«ç æª");
|
| | | bool IsConnected1 = false;
|
| | | SerialPortCommunicator portCommunicator2 = new SerialPortCommunicator("COM2", 9600, "ä¸çº¿æ«ç æª");
|
| | | bool IsConnected2 = false;
|
| | | if (!IsConnected1) IsConnected1 = portCommunicator1.Connect();
|
| | | if (!IsConnected2) IsConnected2 = portCommunicator2.Connect();
|
| | | byte[] dataToSend1 = Encoding.ASCII.GetBytes(command);//转æåèæ°ç»
|
| | | portCommunicator1.Write(dataToSend1);
|
| | | string receiveData = portCommunicator2.ToString(Encoding.UTF8);
|
| | | //if (receiveData == "0x16,0x54,0x0D")
|
| | | //{
|
| | | // Console.WriteLine(receiveData);
|
| | | byte[] dataToSend2 = Encoding.ASCII.GetBytes("PL106");//转æåèæ°ç»
|
| | | portCommunicator2.Write(dataToSend2);
|
| | | //}
|
| | | string PalletCode = portCommunicator1.ToString(Encoding.UTF8);
|
| | | using (var uow = _unitOfWorkManage.CreateUnitOfWork())
|
| | | var PalletCode = TcpClientExample.Start("192.168.2.120", 2001);
|
| | | try
|
| | | {
|
| | | try
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | if (PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | var boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (boxing == null)
|
| | | {
|
| | | WriteError(device.DeviceName, "空æç");
|
| | | return;
|
| | | }
|
| | | 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)
|
| | | {
|
| | | WriteError(device.DeviceName, "æ æåé
æ¹");
|
| | | return;
|
| | | }
|
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == dt_Formula.Id);
|
| | | //æ¯è¾é¶ä»¶æ¯å¦é½å
¨
|
| | | if (!_boxingDetailService.IsComponentCodesEqual(dt_BoxingDetails, dt_FormulaDetails))
|
| | | {
|
| | | WriteError(device.DeviceName, "é¶ä»¶æé®é¢ï¼è¯·å¤ç");
|
| | | return;
|
| | | }
|
| | | }
|
| | | //æäº¤äºå¡
|
| | | uow.Commit();
|
| | |
|
| | | IsConnected1 = !portCommunicator1.Disconnect();
|
| | | IsConnected2 = !portCommunicator2.Disconnect();
|
| | | #endregion
|
| | | device.SetValue(W_PLCDBName.wboolLocation1ScanDone, true);
|
| | | |
| | |
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | catch (Exception ex)
|
| | | var boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (boxing == null)
|
| | | {
|
| | | WriteError(device.DeviceName, "ä¸çº¿æ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | 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);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "ä¸çº¿æ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location1ScanStart && Location1ScanDone)
|
| | |
| | | var Location2ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation2ScanDone);
|
| | | if (Location2ScanStart && !Location2ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢æçç»å®æåå å·¥æéæ°æ®ï¼åå
¥PLC
|
| | | {
|
| | | #region MyRegion
|
| | | #region 串å£è¿æ¥
|
| | | SerialPortCommunicator portCommunicator17 = new SerialPortCommunicator("COM17", 9600, "åè£
æ«ç æª");
|
| | | bool IsConnected17 = false;
|
| | | SerialPortCommunicator portCommunicator18 = new SerialPortCommunicator("COM18", 9600, "åè£
æ«ç æª");
|
| | | bool IsConnected18 = false;
|
| | | if (!IsConnected17) IsConnected17 = portCommunicator17.Connect();
|
| | | if (!IsConnected18) IsConnected18 = portCommunicator18.Connect();
|
| | | byte[] dataToSend1 = Encoding.ASCII.GetBytes(command);//转æåèæ°ç»
|
| | | portCommunicator17.Write(dataToSend1);
|
| | | string receiveData = portCommunicator18.ToString(Encoding.UTF8);
|
| | | byte[] dataToSend2 = Encoding.ASCII.GetBytes("PL106");//转æåèæ°ç»
|
| | | portCommunicator18.Write(dataToSend2);
|
| | | //}
|
| | | string PalletCode = portCommunicator17.ToString(Encoding.UTF8);
|
| | | using (var uow = _unitOfWorkManage.CreateUnitOfWork())
|
| | | var PalletCode = TcpClientExample.Start("192.168.2.121", 2001);
|
| | |
|
| | | try
|
| | | {
|
| | | try
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | if (PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | | //åå
¥PLC
|
| | | 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.wboolLocation2ScanDone, true);
|
| | |
|
| | | //æ¥æ¶æ°æ®
|
| | | float PressHeight = device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectPressHeight);
|
| | | float ScrewTorque = device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectScrewTorque);
|
| | | float ScrewAngle = 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);
|
| | | }
|
| | | //æäº¤äºå¡
|
| | | uow.Commit();
|
| | |
|
| | | IsConnected17 = !portCommunicator17.Disconnect();
|
| | | IsConnected18 = !portCommunicator18.Disconnect();
|
| | | #endregion
|
| | | #endregion
|
| | |
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | catch (Exception ex)
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | Dt_Formula dt_Formula = _formulaService.Repository.QueryFirst(x => x.ProductCode == dt_Boxing.ProductCode);
|
| | | //åå
¥PLC
|
| | | 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.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()
|
| | | {
|
| | | WriteError(device.DeviceName, "åè£
æ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | PalletCode = PalletCode,
|
| | | ProductCode = dt_Formula.ProductCode,
|
| | | ProductName = dt_Formula.ProductName,
|
| | | PressHeight = PressHeight,
|
| | | ScrewTorque = ScrewTorque,
|
| | | ScrewAngle = ScrewAngle
|
| | | };
|
| | | _processInfoService.Repository.AddData(dt_ProcessInfo);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "åè£
æ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location2ScanStart && Location2ScanDone)
|
| | |
| | | var Location3ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation3ScanDone);
|
| | | if (Location3ScanStart && !Location3ScanDone)
|
| | | {
|
| | | #region MyRegion
|
| | | #region 串å£è¿æ¥
|
| | | SerialPortCommunicator portCommunicator19 = new SerialPortCommunicator("COM19", 9600, "æ£æµæ«ç æª");
|
| | | bool IsConnected19 = false;
|
| | | SerialPortCommunicator portCommunicator20 = new SerialPortCommunicator("COM20", 9600, "æ£æµæ«ç æª");
|
| | | bool IsConnected20 = false;
|
| | | if (!IsConnected19) IsConnected19 = portCommunicator19.Connect();
|
| | | if (!IsConnected20) IsConnected20 = portCommunicator20.Connect();
|
| | | byte[] dataToSend1 = Encoding.ASCII.GetBytes(command);//转æåèæ°ç»
|
| | | portCommunicator19.Write(dataToSend1);
|
| | | string receiveData = portCommunicator20.ToString(Encoding.UTF8);
|
| | | byte[] dataToSend2 = Encoding.ASCII.GetBytes("PL106");//转æåèæ°ç»
|
| | | portCommunicator20.Write(dataToSend2);
|
| | | //}
|
| | | string PalletCode = portCommunicator19.ToString(Encoding.UTF8);
|
| | |
|
| | | using (var uow = _unitOfWorkManage.CreateUnitOfWork())
|
| | | var PalletCode = TcpClientExample.Start("192.168.2.122", 2001);
|
| | | try
|
| | | {
|
| | | try
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | if (PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | 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.wboolLocation3ScanDone, true);
|
| | |
|
| | | //æ¥æ¶æ°æ®
|
| | | float Height1 = device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight1);
|
| | | float Height2 = device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight2);
|
| | | float Height3 = device.GetValue<R_PLCDBName, float>(R_PLCDBName.rrealDetectHeight3);
|
| | |
|
| | | Dt_ProcessInfo dt_ProcessInfo = _processInfoService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | if (dt_ProcessInfo == null)
|
| | | {
|
| | | WriteInfo(device.DeviceName, "æåæªåè£
");
|
| | | device.SetValue(W_PLCDBName.wboolLocation1ScanDone, true);
|
| | | return;
|
| | | }
|
| | | dt_ProcessInfo.Height1 = Height1;
|
| | | dt_ProcessInfo.Height2 = Height2;
|
| | | dt_ProcessInfo.Height3 = Height3;
|
| | | _processInfoService.Repository.UpdateData(dt_ProcessInfo);
|
| | |
|
| | | }
|
| | | //æäº¤äºå¡
|
| | | uow.Commit();
|
| | |
|
| | | IsConnected19 = !portCommunicator19.Disconnect();
|
| | | IsConnected20 = !portCommunicator20.Disconnect();
|
| | | #endregion
|
| | | #endregion
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | catch (Exception ex)
|
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode);
|
| | | 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.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)
|
| | | {
|
| | | WriteError(device.DeviceName, "æ£æµæ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | throw new InvalidOperationException("æåæªåè£
");
|
| | | }
|
| | | dt_ProcessInfo.Height1 = Height1;
|
| | | dt_ProcessInfo.Height2 = Height2;
|
| | | dt_ProcessInfo.Height3 = Height3;
|
| | | _processInfoService.Repository.UpdateData(dt_ProcessInfo);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | WriteError(device.DeviceName, "æ£æµæ«ç æµç¨æ§è¡å¼å¸¸", ex);
|
| | | }
|
| | | }
|
| | | else if (!Location3ScanStart && Location3ScanDone)
|
| | |
| | | var Location4ScanDone = device.GetValue<W_PLCDBName, bool>(W_PLCDBName.wboolLocation4ScanDone);
|
| | | if (Location4ScanStart && !Location4ScanDone)//æ§å¶æ«ç æªæ«ææçç ï¼æ ¹æ®æçç æ¥è¯¢ç»çæ°æ®ï¼å¤ææçç»å®æåæ¯å¦å·²ç»å®æææéé¶ä»¶
|
| | | {
|
| | | SerialPortCommunicator portCommunicator21 = new SerialPortCommunicator("COM21", 9600, "ä¸çº¿æ«ç æª");
|
| | | bool IsConnected21 = false;
|
| | | SerialPortCommunicator portCommunicator22 = new SerialPortCommunicator("COM22", 9600, "ä¸çº¿æ«ç æª");
|
| | | bool IsConnected22 = false;
|
| | | if (!IsConnected21) IsConnected21 = portCommunicator21.Connect();
|
| | | if (!IsConnected22) IsConnected22 = portCommunicator22.Connect();
|
| | | byte[] dataToSend1 = Encoding.ASCII.GetBytes(command);//转æåèæ°ç»
|
| | | portCommunicator21.Write(dataToSend1);
|
| | | string receiveData = portCommunicator22.ToString(Encoding.UTF8);
|
| | | byte[] dataToSend2 = Encoding.ASCII.GetBytes("PL106");//转æåèæ°ç»
|
| | | portCommunicator22.Write(dataToSend2);
|
| | | //}
|
| | | string PalletCode = portCommunicator21.ToString(Encoding.UTF8);
|
| | | var PalletCode = TcpClientExample.Start("192.168.2.123", 2001);
|
| | | using (var uow = _unitOfWorkManage.CreateUnitOfWork())
|
| | | {
|
| | | try
|
| | | {
|
| | | if (PalletCode.IsNotEmptyOrNull())
|
| | | if (!PalletCode.IsNotEmptyOrNull())
|
| | | {
|
| | | 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);
|
| | | foreach (Dt_BoxingDetail dt_BoxingDetail in dt_BoxingDetails)
|
| | | {
|
| | | _boxingDetailService.Repository.DeleteDataById(dt_BoxingDetail.Id);
|
| | | }
|
| | | uow.Commit();
|
| | | //ä¸çº¿æ«ç 宿
|
| | | device.SetValue(W_PLCDBName.wboolLocation4ScanDone, true);
|
| | | throw new InvalidOperationException("æç为空");
|
| | | }
|
| | | IsConnected21 = !portCommunicator21.Disconnect();
|
| | | IsConnected22 = !portCommunicator22.Disconnect();
|
| | | 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()
|
| | | {
|
| | | PalletCode = PalletCode,
|
| | | ProductCode = dt_ProcessInfo.ProductCode,
|
| | | ProductName = dt_ProcessInfo.ProductName,
|
| | | 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)
|
| | | {
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Sockets; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_DTO.System; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | public class TcpClientExample |
| | | { |
| | | public static string Start(string Ip, int Prot) |
| | | { |
| | | try |
| | | { |
| | | // 1. å建 Socket 对象 |
| | | Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); |
| | | // 1.é
ç½®è¶
æ¶ï¼æ ¸å¿ï¼é¿å
Receiveæ éé»å¡ï¼ |
| | | clientSocket.SendTimeout = 3000; // è¿æ¥è¶
æ¶3ç§ |
| | | clientSocket.ReceiveTimeout = 3000; // è¿æ¥è¶
æ¶3ç§ |
| | | // 2. è¿æ¥æå¡å¨ï¼IP 为æå¡å¨ç IPï¼ç«¯å£ä¸æå¡å¨ä¸è´ï¼ |
| | | IPAddress serverIp = IPAddress.Parse(Ip); // æ¬å°æµè¯ç¨ 127.0.0.1ï¼å®é
æ¿æ¢ä¸ºæå¡å¨ IP |
| | | IPEndPoint serverEndPoint = new IPEndPoint(serverIp, Prot); |
| | | clientSocket.Connect(serverEndPoint); |
| | | //Console.WriteLine("å·²æåè¿æ¥å°æå¡å¨"); |
| | | |
| | | // å°å符串转æ¢ä¸ºåèæ°ç»å¹¶åé |
| | | byte[] sendBuffer = Encoding.UTF8.GetBytes("start"); |
| | | clientSocket.Send(sendBuffer); |
| | | // æ¥æ¶æå¡å¨åå¤ |
| | | byte[] recvBuffer = new byte[1024]; |
| | | int recvLen = clientSocket.Receive(recvBuffer); |
| | | string recvMsg = Encoding.UTF8.GetString(recvBuffer, 0, recvLen); |
| | | //Console.WriteLine($"æ¶å°æå¡å¨åå¤ï¼{recvMsg}"); |
| | | |
| | | // 4. å
³éè¿æ¥ |
| | | clientSocket.Shutdown(SocketShutdown.Both); |
| | | clientSocket.Close(); |
| | | //Console.WriteLine("å·²æå¼ä¸æå¡å¨çè¿æ¥"); |
| | | |
| | | return recvMsg; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | return ""; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.9" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.11" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |