def cal(s,m): if s==u"废弃" or s==u"拆除": return 4 elif s==u"竣工": return 3 elif s==u"投运" and m==u"PE塑料管": return 2 else: return 1
cal(!STATUS!, !MATERIAL! )