diff --git a/hb_client/src/components/Gantt/components/leftMenu.vue b/hb_client/src/components/Gantt/components/leftMenu.vue
new file mode 100644
index 0000000..2167e1c
--- /dev/null
+++ b/hb_client/src/components/Gantt/components/leftMenu.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+ {{ scope.row.name }}
+
+
+ {{ scope.row.name }}
+
+
+
+
+
+
+
+
+
diff --git a/hb_client/src/components/Gantt/components/slider.vue b/hb_client/src/components/Gantt/components/slider.vue
new file mode 100644
index 0000000..b355b75
--- /dev/null
+++ b/hb_client/src/components/Gantt/components/slider.vue
@@ -0,0 +1,156 @@
+
+
+
+ {{ per }}
+ {{ per }}
+
+
+ {{ per1 }}
+
+
+
+
+
diff --git a/hb_client/src/components/Gantt/index.vue b/hb_client/src/components/Gantt/index.vue
new file mode 100644
index 0000000..1ba94e5
--- /dev/null
+++ b/hb_client/src/components/Gantt/index.vue
@@ -0,0 +1,1374 @@
+
+
+
+
+
+
+
+
+
{{ item.year }}年{{ key }}月
+
+
+
{{ fixdTopMonth }}
+
+
+
+
+
+ 今天
+
+ {{ j.date }}
+
+
+
+
+
+ {{ j.date }}
+
+
+
+
+
+
+
+ {{ j.date }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{currentDaySize.label}}
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+ {{ currentProjectMsg.name }}
+
+
+ 工作周期:
+ {{ currentProjectMsg.allTime }}天
+
+
+ 当前进度:
+ {{ currentProjectMsg.per }}
+
+
+ 合格数量:
+ {{ currentProjectMsg.per1 }}
+
+
+ 开始时间:
+ {{ currentProjectMsg.startTime }}
+
+
+ 结束时间:
+ {{ currentProjectMsg.endTime }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hb_client/src/views/pm/gantt.vue b/hb_client/src/views/pm/gantt.vue
index 36b3b6c..564d3b3 100644
--- a/hb_client/src/views/pm/gantt.vue
+++ b/hb_client/src/views/pm/gantt.vue
@@ -4,11 +4,12 @@
+
@@ -944,7 +945,7 @@
};
this.handlerSelect();
},
- //获取近三年的所有天数
+ //获取要显示的所有天数
getDay() {
this.getAllDate();
},
@@ -959,8 +960,13 @@
return false;
},
getAllDate() {
- let obj = {};
- let arr = [this.currentYear - 1, this.currentYear, this.currentYear + 1];
+ let obj = {},arr=[];
+ let start = new Date(this.timeRange[0]).getFullYear();
+ let end = new Date(this.timeRange[1]).getFullYear();
+ for(let i=start;i
{
obj.year = item;
obj.days = this.isLeapYear(item) ? 365 : 366;
@@ -974,7 +980,6 @@
this.allDays.forEach(item => {
item.month = this.handleMonthDay(item.days, item.year);
});
- // console.log(this.allDays);
this.allDays.forEach(element => {
if (element.year == this.currentYear) {
element.month[0][this.currentMonth].forEach(k => {
@@ -1063,15 +1068,6 @@
break;
}
},
- setList() {
- /*getPlanGantt().then(res=>{
- if(res.code===200){
- this.list = res.data.results;
- }else{
- this.$message.error(res.msg);
- }
- })*/
- },
//设置里程碑线的高度
setStoneLine(isFirst) {
this.$nextTick(() => {
@@ -1112,7 +1108,6 @@
mounted() {
document.addEventListener("scroll", this.handleScroll);
this.getDay();
- this.setList();
this.setStoneLine();
},
beforeDestroy() {
diff --git a/hb_client/src/views/pm/plan.vue b/hb_client/src/views/pm/plan.vue
index 7cc3913..4d114e1 100644
--- a/hb_client/src/views/pm/plan.vue
+++ b/hb_client/src/views/pm/plan.vue
@@ -1,63 +1,62 @@
-
- 生产任务列表
-
-
-
-
+ 生产任务列表
+
+
+
+
-
-
-
-
-
+
+
+
+
{{ scope.row.number }}
-
+
{{ scope.row.order_.number }}
-
+
{{ scope.row.order_.contract_.number }}
-
-
+
+
{{ scope.row.product_.name }}
-
+
{{ scope.row.product_.specification }}
-
+
{{ scope.row.product_.unit }}
-
+
{{ scope.row.count }}
-
+
{{ scope.row.start_date }}
-
+
{{ scope.row.end_date }}
-
+
{{ scope.row.order_.delivery_date }}
-
-
-
+
+
+
否
- 是
-
+ 是
+
-
+
{{ scope.row.create_time }}
查看子计划
- 生成子计划
+ v-if="scope.row.is_planed"
+ @click="handleselectplan(scope)"
+ >查看子计划
+
+ 生成子计划
+
-
-
-
-
-
-
-
-
-
- {{ scope.row.number }}
-
-
- {{ scope.row.customer_.name }}
-
-
-
- {{ scope.row.contract_.number }}
-
-
- {{ scope.row.contract_.name }}
-
-
- {{ scope.row.product_.name }}
-
-
- {{ scope.row.product_.specification }}
-
-
- {{ scope.row.count }}
-
-
- {{ scope.row.planed_count }}
-
-
-
- {{ scope.row.delivery_date }}
-
-
-
-
-
- {{ scope.row.create_time }}
-
-
+
+
-
-
- 排产
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ scope.row.number }}
+
+
+ {{ scope.row.customer_.name }}
+
+
+
+ {{ scope.row.contract_.number }}
+
+
+ {{ scope.row.contract_.name }}
+
+
+ {{ scope.row.product_.name }}
+
+
+ {{ scope.row.product_.specification }}
+
+
+ {{ scope.row.count }}
+
+
+ {{ scope.row.planed_count }}
+
+
+
+ {{ scope.row.delivery_date }}
+
+
+
+
+ {{ scope.row.create_time }}
+
+
+
+
+ 排产
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
+
+
+
-
+
-
\ No newline at end of file
+
diff --git a/hb_server/apps/wf/models.py b/hb_server/apps/wf/models.py
index cdc4780..34eb8ec 100644
--- a/hb_server/apps/wf/models.py
+++ b/hb_server/apps/wf/models.py
@@ -212,6 +212,14 @@ class Ticket(CommonBModel):
act_state = models.IntegerField('进行状态', default=1, help_text='当前工单的进行状态', choices=act_state_choices)
multi_all_person = models.JSONField('全部处理的结果', default=dict, blank=True, help_text='需要当前状态处理人全部处理时实际的处理结果,json格式')
+# class TicketCustomField(BaseModel):
+# """
+# 工单自定义表单数据
+# """
+# form_field = models.ForeignKey(CustomField, verbose_name='关联自定义表单字段', on_delete=models.CASCADE)
+# field_value = models.JSONField('录入值', null=True, blank=True)
+# field_display_value = models.CharField('展示值', max_length=1000, null=True, blank=True, help_text='可用于只读时展示')
+# ticket = models.ForeignKey(Ticket, verbose_name='关联的工单', on_delete=models.CASCADE, related_name='ticket_data')
class TicketFlow(BaseModel):
"""
diff --git a/hb_server/apps/wf/scripts.py b/hb_server/apps/wf/scripts.py
index 3bdb206..e96502f 100644
--- a/hb_server/apps/wf/scripts.py
+++ b/hb_server/apps/wf/scripts.py
@@ -12,4 +12,18 @@ class GetParticipants:
def get_create_by(cls, state:dict={}, ticket:dict={}, ticket_data:dict={}, request={}):
"""工单创建人"""
participant = ticket.create_by.id
- return participant
\ No newline at end of file
+ return participant
+
+class HandleScripts:
+ all_funcs = [
+ {'func': 'handle_wproduct', 'name':'处理不合格品'}
+ ]
+ @classmethod
+ def handle_wproduct(cls, ticket:dict={}):
+ """处理不合格品"""
+ ticket_data = ticket.ticket_data
+ wp = ticket.wt_ticket
+ wp = ticket_data
+ if 'shenli2' in ticket_data and ticket_data['shenli2']:
+ if ticket_data['shenli2'] in ['返工', '返修']:
+ pass
\ No newline at end of file
diff --git a/hb_server/apps/wpm/models.py b/hb_server/apps/wpm/models.py
index 5d82cca..4b10902 100644
--- a/hb_server/apps/wpm/models.py
+++ b/hb_server/apps/wpm/models.py
@@ -84,6 +84,7 @@ class WprouctTicket(CommonAModel):
step = models.ForeignKey(Step, verbose_name='所在步骤', on_delete=models.CASCADE)
subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='所在子生产计划', on_delete=models.CASCADE)
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单', on_delete=models.CASCADE, related_name='wt_ticket')
+ decision = models.CharField('最终决定', null=True, blank=True, max_length=100)
class Pick(CommonADModel):
"""
diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py
index a954a37..a9d6482 100644
--- a/hb_server/apps/wpm/views.py
+++ b/hb_server/apps/wpm/views.py
@@ -338,7 +338,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
报废操作
"""
obj = self.get_object()
- if obj.ow_wproduct.ow_operation.count() >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
+ if Operation.objects.filter(ow_operation__wproduct=obj, is_submited=True).count() >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
raise exceptions.APIException('该产品不支持直接报废')
obj.act_state = WProduct.WPR_ACT_STATE_SCRAP
obj.update_by = request.user