From 0d8fe4d7ebbd2485aeb20beccb0892327f44f82e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 11 Feb 2022 08:39:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=88=A0=E9=99=A4material=20check=20?= =?UTF-8?q?=E5=8F=AA=E8=A6=81=E7=BB=8F=E8=BF=87=E6=93=8D=E4=BD=9C=E5=B0=B1?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E7=89=A9=E6=96=99=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/wpm/migrations/0053_auto_20220129_1512.py | 10 ---------- hb_server/apps/wpm/models.py | 6 ------ hb_server/apps/wpm/views.py | 3 +-- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/hb_server/apps/wpm/migrations/0053_auto_20220129_1512.py b/hb_server/apps/wpm/migrations/0053_auto_20220129_1512.py index 21d27fe..0a60f4c 100644 --- a/hb_server/apps/wpm/migrations/0053_auto_20220129_1512.py +++ b/hb_server/apps/wpm/migrations/0053_auto_20220129_1512.py @@ -12,16 +12,6 @@ class Migration(migrations.Migration): ] operations = [ - migrations.AddField( - model_name='wproduct', - name='material_check', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='wp_material_check', to='mtm.material', verbose_name='按物料状态检查'), - ), - migrations.AddField( - model_name='wproductflow', - name='material_check', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='wpf_material_check', to='mtm.material', verbose_name='按物料状态检查'), - ), migrations.AlterField( model_name='wproduct', name='child', diff --git a/hb_server/apps/wpm/models.py b/hb_server/apps/wpm/models.py index 997e65c..f75908f 100644 --- a/hb_server/apps/wpm/models.py +++ b/hb_server/apps/wpm/models.py @@ -91,9 +91,6 @@ class WProduct(CommonAModel): material = models.ForeignKey( Material, verbose_name='所属物料状态', on_delete=models.CASCADE, related_name='wp_material') - material_check = models.ForeignKey( - Material, verbose_name='按物料状态检查', on_delete=models.CASCADE, - null=True, blank=True, related_name='wp_material_check') pre_step = models.ForeignKey(Step, verbose_name='已执行到', help_text='已执行完的步骤', null=True, blank=True, on_delete=models.CASCADE, related_name='wp_pre_step') step = models.ForeignKey(Step, verbose_name='所在步骤', on_delete=models.CASCADE, null=True, blank=True, @@ -170,9 +167,6 @@ class WproductFlow(CommonAModel): number = models.CharField('物品编号', null=True, blank=True, max_length=50) material = models.ForeignKey( Material, verbose_name='所属物料状态', on_delete=models.CASCADE, related_name='wpf_material') - material_check = models.ForeignKey( - Material, verbose_name='按物料状态检查', on_delete=models.CASCADE, - null=True, blank=True, related_name='wpf_material_check') pre_step = models.ForeignKey(Step, verbose_name='已执行到', help_text='已执行完的步骤', null=True, blank=True, on_delete=models.CASCADE, related_name='wpf_pre_step') step = models.ForeignKey(Step, verbose_name='所在步骤', on_delete=models.CASCADE, null=True, blank=True, diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index dbf50f0..81c18ed 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -684,10 +684,10 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd newstep, needTest = WpmService.get_next_step(wsp, step) wp.step = newstep wp.pre_step = step + wp.material = wsp.product if step == newstep: wp.act_state = WProduct.WPR_ACT_STATE_TOTEST - wp.material = wsp.product if wp.test:# 如果有正在进行的工序中检验 wp.test.is_midtesting = False wp.test.is_submited = False @@ -696,7 +696,6 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT if needTest: wp.act_state = WProduct.WPR_ACT_STATE_TOTEST - wp.material_check = wsp.product wp.operation = None wp.update_by = request.user From 09a938a146654e61140c3625d2133cc0a83fe1a2 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Fri, 11 Feb 2022 10:47:14 +0800 Subject: [PATCH 2/4] zuoyezhidaoshu --- hb_client/src/views/inm/product.vue | 4 +- hb_client/src/views/mtm/productprocess.vue | 2 +- hb_client/src/views/wpm/operationdo.vue | 51 +++++++++++++++++----- 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/hb_client/src/views/inm/product.vue b/hb_client/src/views/inm/product.vue index fed1966..9a5d629 100644 --- a/hb_client/src/views/inm/product.vue +++ b/hb_client/src/views/inm/product.vue @@ -13,7 +13,7 @@ stripe highlight-current-row height="100" - v-el-height-adaptive-table="{ bottomOffset: 42 }" + v-el-height-adaptive-table="{bottomOffset: 42}" > @@ -257,7 +257,7 @@ export default { _this.mtmId.push(item.material_.id); _this.materialshow.push(item); }); - this.ordershow = _this.materialshow[0].to_order_.number; + this.ordershow = _this.materialshow[0].order_.number; this.customershow=_this.materialshow[0].order_.customer_.name; this.contractshow=_this.materialshow[0].order_.contract_.name; getOrderList({ page: 0, material: _this.mtmId[0], tag:'not_done' }).then( diff --git a/hb_client/src/views/mtm/productprocess.vue b/hb_client/src/views/mtm/productprocess.vue index 5c7811f..0dc8172 100644 --- a/hb_client/src/views/mtm/productprocess.vue +++ b/hb_client/src/views/mtm/productprocess.vue @@ -622,7 +622,7 @@ :headers="upHeaders" :file-list="fileList" :limit="1" - accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx" + accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf" > 上传文件 diff --git a/hb_client/src/views/wpm/operationdo.vue b/hb_client/src/views/wpm/operationdo.vue index 6aae57c..a24d1a3 100644 --- a/hb_client/src/views/wpm/operationdo.vue +++ b/hb_client/src/views/wpm/operationdo.vue @@ -63,9 +63,17 @@ :visible.sync="drawer" direction="rtl" size="70%"> -
-
-
+ + + +
+ @@ -743,7 +751,7 @@ export default { tprogressData: [], tool:"", wordText: "", - + pdf:"", }; }, computed: {}, @@ -765,12 +773,15 @@ export default { checkPermission, //作业指导书 - - getWordText() { - this.drawer=true; - const xhr = new XMLHttpRequest(); +//选项卡切换 + handleClick(tab) { + + var str = tab.label.substr(tab.label.length-1,1); + if(str=='x') + { + const xhr = new XMLHttpRequest(); - xhr.open("get", this.techdocList, true); + xhr.open("get",tab.name, true); xhr.responseType = "arraybuffer"; @@ -787,12 +798,30 @@ export default { } }; xhr.send(); + var filediv = document.getElementById('file'); +filediv.innerHTML='
'; + + } + else if (str=='f') + { + this.pdf=tab.name; +var filediv = document.getElementById('file'); +filediv.innerHTML=' '; + + + } + }, + getWordText() { + this.drawer=true; + + + }, readbook(){ - gettechdocList({operation:this.id,page:0}).then((response) => { + gettechdocList({operation:this.id,page:0,enabled:true}).then((response) => { if (response.data) { - this.techdocList= response.data[0].file_.file; + this.techdocList= response.data; console.log( this.techdocList); } }); From 089a311768aeb608dcbcd1867efc1091f82c25e2 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Fri, 11 Feb 2022 10:56:25 +0800 Subject: [PATCH 3/4] zuoyezhidaoshbu --- hb_client/src/views/wpm/operationdo.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hb_client/src/views/wpm/operationdo.vue b/hb_client/src/views/wpm/operationdo.vue index a24d1a3..63d02bf 100644 --- a/hb_client/src/views/wpm/operationdo.vue +++ b/hb_client/src/views/wpm/operationdo.vue @@ -68,7 +68,7 @@ :key="item.file_.id" v-for="item in techdocList" :label="item.file_.name" - :name="item.file_.file" + :name="item.file_.path" :closable="item.close" > From da9bb2b79d47c17482f53c5adaf09536d50bbdaa Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 11 Feb 2022 11:20:44 +0800 Subject: [PATCH 4/4] =?UTF-8?q?settings=E5=90=8C=E6=BA=90=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/hrm/views.py | 1 + hb_server/server/settings.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hb_server/apps/hrm/views.py b/hb_server/apps/hrm/views.py index 5bf9457..ed733da 100644 --- a/hb_server/apps/hrm/views.py +++ b/hb_server/apps/hrm/views.py @@ -125,6 +125,7 @@ class FaceLogin(CreateAPIView): user, msg = HRMService.face_compare_from_base64(base64_data) if user: refresh = RefreshToken.for_user(user) + # 可设为在岗 return Response({ 'refresh': str(refresh), 'access': str(refresh.access_token), diff --git a/hb_server/server/settings.py b/hb_server/server/settings.py index 1d11566..2890f6b 100644 --- a/hb_server/server/settings.py +++ b/hb_server/server/settings.py @@ -63,6 +63,8 @@ INSTALLED_APPS = [ 'apps.develop' ] +X_FRAME_OPTIONS = 'SAMEORIGIN' + MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',